Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 13.1.0 |
Comparing to | |
See all releases |
Code changes from version 13.0.0 to 13.1.0
build/block-directory/index.js
CHANGED
@@ -1186,6 +1186,7 @@ function DownloadableBlockListItem(_ref3) {
|
|
1186 |
}
|
1187 |
|
1188 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({
|
|
|
1189 |
role: "option",
|
1190 |
as: external_wp_components_namespaceObject.Button
|
1191 |
}, composite, {
|
1186 |
}
|
1187 |
|
1188 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, _extends({
|
1189 |
+
__experimentalIsFocusable: true,
|
1190 |
role: "option",
|
1191 |
as: external_wp_components_namespaceObject.Button
|
1192 |
}, composite, {
|
build/block-directory/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'ca53cf76add5dfa7d0eb84d7d539639f');
|
build/block-directory/index.min.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
!function(){"use strict";var e={n:function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,{a:l}),l},d:function(t,l){for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return $}});var l={};e.r(l),e.d(l,{getDownloadableBlocks:function(){return
|
2 |
(0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),a=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),a},P=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=S(e);await N()({method:"PUT",url:t,data:{status:"inactive"}}),await N()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(I.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function A(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function M(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}const V=e=>async t=>{let{dispatch:l}=t;if(e)try{l(C(e));l(O((await N()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>(0,u.mapKeys)(e,((e,t)=>(0,u.camelCase)(t))))),e))}catch{}},H={reducer:m,selectors:l,actions:n,resolvers:o},$=(0,c.createReduxStore)("core/block-directory",H);function K(){const{uninstallBlockType:e}=(0,c.useDispatch)($),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e($).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,s.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)($);var z=window.wp.components,Y=window.wp.compose,j=window.wp.coreData;function q(){return(q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}var U=window.wp.htmlEntities,G=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},W=window.wp.primitives,Q=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),J=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),X=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),Z=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)(
|
3 |
/* translators: %s: number of stars. */
|
4 |
(0,v.__)("%s out of 5 stars"),l)},(0,u.times)(n,(e=>(0,r.createElement)(G,{key:`full_stars_${e}`,className:"block-directory-block-ratings__star-full",icon:Q,size:16}))),(0,u.times)(o,(e=>(0,r.createElement)(G,{key:`half_stars_${e}`,className:"block-directory-block-ratings__star-half-full",icon:J,size:16}))),(0,u.times)(a,(e=>(0,r.createElement)(G,{key:`empty_stars_${e}`,className:"block-directory-block-ratings__star-empty",icon:X,size:16}))))},ee=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(Z,{rating:t}))},te=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(p.BlockIcon,{className:l,icon:t,showColors:!0})},le=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e($).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function ne(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:i}=t;const s=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,U.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,U.decodeEntities)(l)):i?(0,v.sprintf)("Installing %s.",(0,U.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,U.decodeEntities)(l)):(0,v.sprintf)(
|
5 |
/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
|
6 |
-
(0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,U.decodeEntities)(l),s,o)}var oe=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:i,rating:d,title:u}=l,m=!!(0,s.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e($),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let
|
7 |
/* translators: %1$s: block title, %2$s: author name. */
|
8 |
-
(0,v.__)("%1$s <span>by %2$s</span>"),(0,U.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(le,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},
|
9 |
/* translators: %d: number of available blocks. */
|
10 |
(0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},se=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.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"})),ce=function(){return(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(G,{className:"block-editor-inserter__no-results-icon",icon:se}),(0,r.createElement)("p",null,(0,v.__)("No results found.")))},de=(0,Y.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e($),{canInsertBlockType:a}=e(p.store),i=e(j.store).canUser("read","block-directory/search");return{downloadableItems:i?o(l).filter((e=>a(e,n,!0))):[],hasPermission:i,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:i,isTyping:s}=e;return void 0===a||i||s?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(z.Spinner,null))):!1===a?o?null:(0,r.createElement)(ce,null):t.length?(0,r.createElement)(ie,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(re,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(ce,null)})),ue=function(){const[e,t]=(0,r.useState)(""),l=(0,u.debounce)(t,400);return(0,r.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:i,rootClientId:s}=t;return e!==a&&l(a),e?(0,r.createElement)(de,{onSelect:n,onHover:o,rootClientId:s,filterValue:e,hasLocalBlocks:i,isTyping:a!==e}):null}))},me=window.wp.editPost;function pe(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(te,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)(
|
11 |
/* translators: %s: Name of the block author. */
|
12 |
(0,v.__)("By %s"),o))))}))):null}function ke(){const e=(0,c.useSelect)((e=>e($).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(me.PluginPrePublishPanel,{icon:se,title:(0,v.sprintf)(// translators: %d: number of blocks (number).
|
13 |
(0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(pe,{items:e})):null}function be(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e($).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)($),{replaceBlock:i}=(0,c.useDispatch)(p.store);return(0,r.createElement)(z.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,s.getBlockType)(l.name),[o]=(0,s.parse)(t.originalContent);o&&e&&i(n,(0,s.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
|
14 |
/* translators: %s: block name */
|
15 |
-
(0,v.__)("Install %s"),l.title))}const
|
16 |
/* translators: %s: block name */
|
17 |
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const m=[(0,r.createElement)(be,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return i&&d&&(u=(0,v.sprintf)(
|
18 |
/* translators: %s: block name */
|
19 |
-
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),m.push((0,r.createElement)(z.Button,{key:"convert",onClick:()=>{a(l.clientId,(0,s.createBlock)("core/html",{content:o}))},variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,p.useBlockProps)(),(0,r.createElement)(p.Warning,{actions:m},u),(0,r.createElement)(r.RawHTML,null,o))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(K,null),(0,r.createElement)(ue,null),(0,r.createElement)(ke,null))}),(0,i.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:l}=e($),n=l("block:"+t).filter((e=>{let{name:l}=e;return t===l}));return{hasPermission:e(j.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(
|
20 |
//# sourceMappingURL=index.min.js.map
|
1 |
+
!function(){"use strict";var e={n:function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,{a:l}),l},d:function(t,l){for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return $}});var l={};e.r(l),e.d(l,{getDownloadableBlocks:function(){return _},getErrorNoticeForBlock:function(){return h},getErrorNotices:function(){return y},getInstalledBlockTypes:function(){return g},getNewBlockTypes:function(){return w},getUnusedBlockTypes:function(){return E},isInstalling:function(){return f},isRequestingDownloadableBlocks:function(){return b}});var n={};e.r(n),e.d(n,{addInstalledBlockType:function(){return R},clearErrorNotice:function(){return F},fetchDownloadableBlocks:function(){return C},installBlockType:function(){return D},receiveDownloadableBlocks:function(){return O},removeInstalledBlockType:function(){return A},setErrorNotice:function(){return x},setIsInstalling:function(){return M},uninstallBlockType:function(){return P}});var o={};e.r(o),e.d(o,{getDownloadableBlocks:function(){return V}});var r=window.wp.element,a=window.wp.plugins,i=window.wp.hooks,s=window.wp.blocks,c=window.wp.data,d=window.wp.editor,u=window.lodash,m=(0,c.combineReducers)({downloadableBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":return(0,u.omit)(e,t.blockId)}return e}}),p=window.wp.blockEditor;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some((t=>{let{name:l}=t;return l===e.name})))return!0;for(let l=0;l<t.length;l++)if(k(e,t[l].innerBlocks))return!0;return!1}function b(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.isRequesting)&&void 0!==l&&l}function _(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.results)&&void 0!==l?l:[]}function g(e){return e.blockManagement.installedBlockTypes}const w=(0,c.createRegistrySelector)((e=>t=>{const l=e(p.store).getBlocks();return g(t).filter((e=>k(e,l)))})),E=(0,c.createRegistrySelector)((e=>t=>{const l=e(p.store).getBlocks();return g(t).filter((e=>!k(e,l)))}));function f(e,t){return e.blockManagement.isInstalling[t]||!1}function y(e){return e.errorNotices}function h(e,t){return e.errorNotices[t]}var v=window.wp.i18n,B=window.wp.apiFetch,N=e.n(B),I=window.wp.notices,T=window.wp.url;const L=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function S(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function C(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function O(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const D=e=>async t=>{let{registry:l,dispatch:n}=t;const{id:o,name:r}=e;let a=!1;n.clearErrorNotice(o);try{n.setIsInstalling(o,!0);const t=S(e);let i={};t?await N()({method:"PUT",url:t,data:{status:"active"}}):i=(await N()({method:"POST",path:"wp/v2/plugins",data:{slug:o,status:"active"}}))._links,n.addInstalledBlockType({...e,links:{...e.links,...i}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];if(await N()({path:(0,T.addQueryArgs)(`/wp/v2/block-types/${r}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,s.unstable__bootstrapServerSideBlockDefinitions)({[r]:(0,u.pick)(e,c)})})),await async function(){const e=await N()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await L(e)}(),!l.select(s.store).getBlockTypes().some((e=>e.name===r)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));l.dispatch(I.store).createInfoNotice((0,v.sprintf)(// translators: %s is the block title.
|
2 |
(0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),a=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),a},P=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=S(e);await N()({method:"PUT",url:t,data:{status:"inactive"}}),await N()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(I.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function A(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function M(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}const V=e=>async t=>{let{dispatch:l}=t;if(e)try{l(C(e));l(O((await N()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>(0,u.mapKeys)(e,((e,t)=>(0,u.camelCase)(t))))),e))}catch{}},H={reducer:m,selectors:l,actions:n,resolvers:o},$=(0,c.createReduxStore)("core/block-directory",H);function K(){const{uninstallBlockType:e}=(0,c.useDispatch)($),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e($).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,s.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)($);var z=window.wp.components,Y=window.wp.compose,j=window.wp.coreData;function q(){return(q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}var U=window.wp.htmlEntities,G=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},W=window.wp.primitives,Q=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),J=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),X=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),Z=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)(
|
3 |
/* translators: %s: number of stars. */
|
4 |
(0,v.__)("%s out of 5 stars"),l)},(0,u.times)(n,(e=>(0,r.createElement)(G,{key:`full_stars_${e}`,className:"block-directory-block-ratings__star-full",icon:Q,size:16}))),(0,u.times)(o,(e=>(0,r.createElement)(G,{key:`half_stars_${e}`,className:"block-directory-block-ratings__star-half-full",icon:J,size:16}))),(0,u.times)(a,(e=>(0,r.createElement)(G,{key:`empty_stars_${e}`,className:"block-directory-block-ratings__star-empty",icon:X,size:16}))))},ee=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(Z,{rating:t}))},te=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(p.BlockIcon,{className:l,icon:t,showColors:!0})},le=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e($).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function ne(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:i}=t;const s=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,U.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,U.decodeEntities)(l)):i?(0,v.sprintf)("Installing %s.",(0,U.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,U.decodeEntities)(l)):(0,v.sprintf)(
|
5 |
/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
|
6 |
+
(0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,U.decodeEntities)(l),s,o)}var oe=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:i,rating:d,title:u}=l,m=!!(0,s.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e($),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let _="";return m?_=(0,v.__)("Installed!"):k&&(_=(0,v.__)("Installing…")),(0,r.createElement)(z.__unstableCompositeItem,q({__experimentalIsFocusable:!0,role:"option",as:z.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:k,disabled:k||!b,label:ne(l,{hasNotice:p,isInstalled:m,isInstalling:k}),showTooltip:!0,tooltipPosition:"top center"}),(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(te,{icon:i,title:u}),k?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(z.Spinner,null)):(0,r.createElement)(ee,{rating:d})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,v.sprintf)(
|
7 |
/* translators: %1$s: block title, %2$s: author name. */
|
8 |
+
(0,v.__)("%1$s <span>by %2$s</span>"),(0,U.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(le,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},_||(0,U.decodeEntities)(a)),b&&!(m||k)&&(0,r.createElement)(z.VisuallyHidden,null,(0,v.__)("Install block")))))},re=function(e){let{items:t,onHover:l=u.noop,onSelect:n}=e;const o=(0,z.__unstableUseCompositeState)(),{installBlockType:a}=(0,c.useDispatch)($);return t.length?(0,r.createElement)(z.__unstableComposite,q({},o,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install")}),t.map((e=>(0,r.createElement)(oe,{key:e.id,composite:o,onClick:()=>{(0,s.getBlockType)(e.name)?n(e):a(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},ae=window.wp.a11y,ie=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,r.useEffect)((()=>{(0,ae.speak)((0,v.sprintf)(
|
9 |
/* translators: %d: number of available blocks. */
|
10 |
(0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},se=(0,r.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(W.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"})),ce=function(){return(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(G,{className:"block-editor-inserter__no-results-icon",icon:se}),(0,r.createElement)("p",null,(0,v.__)("No results found.")))},de=(0,Y.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e($),{canInsertBlockType:a}=e(p.store),i=e(j.store).canUser("read","block-directory/search");return{downloadableItems:i?o(l).filter((e=>a(e,n,!0))):[],hasPermission:i,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:i,isTyping:s}=e;return void 0===a||i||s?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(z.Spinner,null))):!1===a?o?null:(0,r.createElement)(ce,null):t.length?(0,r.createElement)(ie,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(re,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(ce,null)})),ue=function(){const[e,t]=(0,r.useState)(""),l=(0,u.debounce)(t,400);return(0,r.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:i,rootClientId:s}=t;return e!==a&&l(a),e?(0,r.createElement)(de,{onSelect:n,onHover:o,rootClientId:s,filterValue:e,hasLocalBlocks:i,isTyping:a!==e}):null}))},me=window.wp.editPost;function pe(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(te,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)(
|
11 |
/* translators: %s: Name of the block author. */
|
12 |
(0,v.__)("By %s"),o))))}))):null}function ke(){const e=(0,c.useSelect)((e=>e($).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(me.PluginPrePublishPanel,{icon:se,title:(0,v.sprintf)(// translators: %d: number of blocks (number).
|
13 |
(0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(pe,{items:e})):null}function be(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e($).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)($),{replaceBlock:i}=(0,c.useDispatch)(p.store);return(0,r.createElement)(z.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,s.getBlockType)(l.name),[o]=(0,s.parse)(t.originalContent);o&&e&&i(n,(0,s.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
|
14 |
/* translators: %s: block name */
|
15 |
+
(0,v.__)("Install %s"),l.title))}const _e=e=>{let{originalBlock:t,...l}=e;const{originalName:n,originalUndelimitedContent:o}=l.attributes,{replaceBlock:a}=(0,c.useDispatch)(p.store),i=!!o,d=(0,s.getBlockType)("core/html");let u=(0,v.sprintf)(
|
16 |
/* translators: %s: block name */
|
17 |
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const m=[(0,r.createElement)(be,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return i&&d&&(u=(0,v.sprintf)(
|
18 |
/* translators: %s: block name */
|
19 |
+
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),m.push((0,r.createElement)(z.Button,{key:"convert",onClick:()=>{a(l.clientId,(0,s.createBlock)("core/html",{content:o}))},variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,p.useBlockProps)(),(0,r.createElement)(p.Warning,{actions:m},u),(0,r.createElement)(r.RawHTML,null,o))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(K,null),(0,r.createElement)(ue,null),(0,r.createElement)(ke,null))}),(0,i.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:l}=e($),n=l("block:"+t).filter((e=>{let{name:l}=e;return t===l}));return{hasPermission:e(j.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(_e,q({},e,{originalBlock:n})):(0,r.createElement)(l,e)})),e;var l})),(window.wp=window.wp||{}).blockDirectory=t}();
|
20 |
//# sourceMappingURL=index.min.js.map
|
build/block-directory/index.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,SAASI,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,q2BCLvD,IAAI,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GlD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGJ,EAA+BH,OAAW,GAAe,YCS9C,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,IAAI,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,SCAtD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe9C,MAAMuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EAAqBP,GAAWQ,MAAAA,IAGtC,IAH8C,SACpDC,EADoD,SAEpDC,GACM,EACN,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAoBD,SAlBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFtExBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GEgDXC,IACmBpC,EAASrC,OAAQ0E,EAAAA,OAAcC,gBAChCnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQKkD,EAAuB9D,GAAWQ,MAAAA,IAGxC,IAHgD,SACtDC,EADsD,SAEtDC,GACM,EACN,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBAAmBN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAYrC,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GCxQK,MAAMY,EAA0BtB,GAAiB8D,MAAAA,IAEjD,IAFyD,SAC/DE,GACM,EACN,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAQnCgE,EAAUJ,SAPYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtBsH,KAAOC,IAC7BC,EAAAA,EAAAA,SAASD,GAAQ,CAAE9H,EAAOb,KAAS6I,EAAAA,EAAAA,WAAW7I,OAGFoB,IAC5C,SCPU0H,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEb,IAAuBc,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAa3G,IAC3C,MAAM,iBAAE4G,EAAF,aAAoBC,GAAiB7G,EAAQ8G,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtB3G,GAAYA,EAAQyG,GAAsBrG,uBAC5C,IAYD,OATA4G,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiBxH,QAC/CwH,EAAiB/F,SAAWlC,IAC3B4G,EAAoB5G,IACpBmI,EAAAA,EAAAA,qBAAqBnI,EAAUC,WAG/B,CAAE2H,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,IAAI,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA3C,SAASmJ,IAetB,OAdAA,EAAW/J,OAAOgK,QAAU,SAAUC,GACpC,IAAK,IAAI5H,EAAI,EAAGA,EAAI6H,UAAU/H,OAAQE,IAAK,CACzC,IAAI8H,EAASD,UAAU7H,GAEvB,IAAK,IAAIvC,KAAOqK,EACVnK,OAAOM,UAAUC,eAAeC,KAAK2J,EAAQrK,KAC/CmK,EAAOnK,GAAOqK,EAAOrK,IAK3B,OAAOmK,IAGOG,MAAMC,KAAMH,WCf9B,IAAI,EAA+BtJ,OAAW,GAAgB,aCwB9D,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBD,EAA+B5J,OAAW,GAAc,WCW5D,GALC,mBAAC,EAAAgK,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,qVCIV,GALC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,4dCQV,GATC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CACCC,SAAS,UACTtL,EAAE,+jBACFuL,SAAS,aC4CZ,EA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAa7D,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ2D,KAGCQ,EAAAA,EAAAA,OAAOL,GAAiBjJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,2CACVtB,KAAOuB,EACPtB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOH,GAAiBnJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,gDACVtB,KAAOwB,EACPvB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOD,GAAkBrJ,IAC1B,mBAAC,EAAD,CACCvC,IAAO,eAAeuC,IACtBuJ,UAAU,4CACVtB,KAAOyB,EACPxB,KAAO,SCpCZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,EAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYtH,IAAMgG,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE3H,GAAa,EACvD,MAAM4H,GAAc7C,EAAAA,EAAAA,YACjB3G,GACDA,EAAQyG,GAAsBnG,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO4H,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYtK,QACZsK,EAAYrK,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAAS6E,GAAT,KAGE,IAFD,MAAEzE,EAAF,OAASsD,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BjL,GACzB,EACD,MAAM4J,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd5E,EAAAA,EAAAA,SAAS,wBAAwB8E,EAAAA,EAAAA,gBAAgB7E,IAGpD4E,GAEG7E,EAAAA,EAAAA,SAAS,WAAW8E,EAAAA,EAAAA,gBAAgB7E,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkB8E,EAAAA,EAAAA,gBAAgB7E,IAI9C0E,EAAc,GAEX3E,EAAAA,EAAAA,SAAS,eAAe8E,EAAAA,EAAAA,gBAAgB7E,KAGzCD,EAAAA,EAAAA;;CAEN+E,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,EAAAA,gBAAgB7E,GAChBuD,EACAmB,GAqGF,OAjGA,YAAmE,IAA/B,UAAEK,EAAF,KAAanL,EAAb,QAAmBoL,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCtD,GAAUpG,EAE/CgL,KAAiBO,EAAAA,EAAAA,cAAcvL,EAAKG,OAEpC,UAAE4K,EAAF,aAAahL,EAAb,cAA2ByL,IAAkBzD,EAAAA,EAAAA,YAChD3G,IACD,MAAM,uBACLM,EACA3B,aAAc0L,GACXrK,EAAQyG,GACN6D,EAAShK,EAAwB1B,EAAK2D,IACtCgI,EAAWD,GAAUA,EAAOnL,QAClC,MAAO,CACNwK,YAAcW,EACd3L,aAAc0L,EAAmBzL,EAAK2D,IACtC6H,eAAiBG,KAGnB,CAAE3L,IAGH,IAAI4L,EAAa,GAOjB,OANKZ,EACJY,GAAa5F,EAAAA,EAAAA,IAAI,cACNjG,IACX6L,GAAa5F,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,GACC6F,KAAK,SACLC,GAAKC,EAAAA,QACAZ,EAHN,CAICf,UAAU,+CACVgB,QAAYY,IACXA,EAAMC,iBACNb,KAEDc,OAASnM,EACToM,SAAWpM,IAAkByL,EAC7BY,MAAQvB,GAA2B7K,EAAM,CACxC+K,UAAAA,EACAC,YAAAA,EACAjL,aAAAA,IAEDsM,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKlC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,IAC3CrG,GACD,2BAAMqK,UAAU,0DACf,mBAAC,EAAAmC,QAAD,QAGD,mBAAC,GAAD,CAAc7C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACboC,EAAAA,EAAAA,2BACDrG,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJiF,EAAAA,EAAAA,gBAAgB7E,GAChBiF,GAED,CACCoB,MACC,2BAAMrC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyB/H,MAAQhD,KAEjC,oCACC,2BAAMoK,UAAU,sDACVwB,IAEFX,EAAAA,EAAAA,gBAAgBK,IAElBE,KACGR,GAAejL,KAClB,mBAAC,EAAA2M,eAAD,MACG1G,EAAAA,EAAAA,IAAI,sBCrFf,GA5CA,YAAuE,IAAtC,MAAE2G,EAAF,QAASC,EAAUC,EAAAA,KAAnB,SAAyBC,GAAa,EACtE,MAAM3B,GAAY4B,EAAAA,EAAAA,gCACZ,iBAAExJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAO8E,EAAMhM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECU,KAAK,UACLzB,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf2G,EAAM3F,KAAOhH,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACXwH,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAcvL,EAAKG,MACvB2M,EAAU9M,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJkJ,EAAU9M,MAIb4M,EAAS,OAEVA,QAAUA,EACV5M,KAAOA,OA/BJ,MC3BL,GAA+BZ,OAAW,GAAQ,KCsDtD,GA/CA,YAII,IAJsC,SACzC4N,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkBtM,OAehC,OAdAyH,EAAAA,EAAAA,YAAW,MACV/B,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAEC+E,EAAAA,EAAAA,IACC,+CACA,iDACAiC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IAAI,sDAIR,0BAAKoE,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXpE,EAAAA,EAAAA,IAAI,0BAEP,wBAAGoE,UAAU,2DACVpE,EAAAA,EAAAA,IACD,wDAIDgH,KCrCN,IALC,mBAAC,EAAA5D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,oLCWV,GAZA,WACC,OACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOsE,MAER,6BAAKpH,EAAAA,EAAAA,IAAI,wBC0DZ,IAAeqH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAElM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAe6N,EAAe,MAAY,EAC/D,MAAM,sBACLvM,EADK,+BAELD,GACGK,EAAQyG,IACN,mBAAE2F,GAAuBpM,EAAQE,EAAAA,OAEjCmM,EAAgBrM,EAAQsM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNV,kBANyBQ,EALlBzM,EAMiBtB,GANaO,QAAU+C,GAC9CwK,EAAoBxK,EAAOuK,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiB7M,EAAgCrB,QAtBpD,EArDA,YAQI,IAR8B,kBACjCuN,EADiC,SAEjCH,EAFiC,QAGjCF,EAHiC,eAIjCM,EAJiC,cAKjCO,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBP,IACpB,oCACC,wBAAG9C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAmC,QAAD,SAMC,IAAUkB,EACPP,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBtM,QAC3B,mBAAC,GAAD,CACCsM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCP,MAAQM,EACRH,SAAWA,EACXF,QAAUA,MAIVM,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQY,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHrB,EADG,QAEHF,EAFG,YAGHlN,EAHG,SAIH0O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBpO,GAC7BuO,EAAyBvO,GAGnBoO,GAKN,mBAAC,GAAD,CACChB,SAAWA,EACXF,QAAUA,EACVW,aAAeA,EACf7N,YAAcoO,EACdZ,eAAiBkB,EACjBP,SAAWnO,IAAgBoO,IAVrB,SClCR,GAA+B1O,OAAW,GAAY,SCU3C,SAASiP,GAAT,GAAkC,IAAZ,MAAE1B,GAAU,EAChD,OAAOA,EAAMhM,QAKZ,yBAAIyJ,UAAU,gCACXuC,EAAM3F,KAAK,QAAE,KAAE8B,EAAF,GAAQnF,EAAR,MAAYyC,EAAZ,OAAmBiF,GAArB,SACZ,yBAAI/M,IAAMqF,EAAKyG,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,KAE7C,0BAAKgE,UAAU,+CACd,0BAAKA,UAAU,4CACZhE,IAEH,0BAAKgE,UAAU,8CACZjE,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJqF,UAjBC,KCEM,SAASiD,KACvB,MAAMC,GAAgBxG,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOqN,EAAc5N,QAKpB,mBAAC,GAAA6N,sBAAD,CACC1F,KAAOsE,GACPhH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAqD,EAAc5N,QAEf4N,EAAc5N,QAEf8N,aAAc,IAEd,wBAAGrE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAqD,EAAc5N,UAGhB,mBAAC0N,GAAD,CAAa1B,MAAQ4B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc3L,EAAd,SAAqB4L,GAAa,EACxE,MAAMC,GAAoB9G,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEiH,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAEtC,OACC,mBAAC,EAAAyK,OAAD,CACCX,QAAU,IACT7H,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYqL,EAAAA,EAAAA,cAAcvI,EAAM7C,OAC9B4O,IAAkB9J,EAAAA,EAAAA,OACzB0J,EAAWK,iBAEPD,GAAiB7O,GACrB4O,EACCF,GACAK,EAAAA,EAAAA,aACC/O,EAAUC,KACV4O,EAAcJ,WACdI,EAAcjO,kBAOpBqL,SAAW0C,EACX3C,OAAS2C,EACTK,QAAQ,YAEN/I,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BM+I,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkB/F,GAAa,EAC1D,MAAM,aAAEoG,EAAF,2BAAgBC,GAA+BrG,EAAM2F,YACrD,aAAEG,IAAiBlH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCgO,IAAgBD,EAChBE,GAAehE,EAAAA,EAAAA,cAAc,aAEnC,IAAIiE,GAAcrJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAED+I,EAAc3I,OAASgJ,GAExB,MAAM7H,EAAU,EACf,mBAACmH,GAAD,CACCpQ,IAAI,UACJ0E,MAAQ+L,EACRJ,WAAa3F,EAAM2F,WACnBC,SAAW5F,EAAM4F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcrJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAED+I,EAAc3I,OAASgJ,GAExB7H,EAAQkI,MACP,mBAAC,EAAA1D,OAAD,CAAQzN,IAAI,UAAU8M,QArCF,KACrB0D,EACC9F,EAAM4F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDlJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU2J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASrI,QAAUA,GAAYiI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACpI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC2G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAU9P,KACX,MAAc,iBAATA,IAGL8P,EAASC,MDZiBC,ECYSF,EAASC,KDZOlH,IACpD,MAAM,aAAEoG,GAAiBpG,EAAM2F,YAGzB,MAAE3L,EAAF,cAASyK,IAAkB1F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWoO,GACVnP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBiP,IAAiBjP,KAC3C,MAAO,CACNsN,cAAerM,EAAQsM,EAAAA,OAAYC,QAClC,OACA,0BAED3K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE0O,IAIH,OAAO3B,GAAmBzK,GAInB,mBAACmM,GAAD,KAAsBnG,EAAtB,CAA8B+F,cAAgB/L,MAH7C,mBAACmN,EAAuBnH,MCbvBiH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\tconst { id, name } = block;\n\tlet success = false;\n\tdispatch.clearErrorNotice( id );\n\ttry {\n\t\tdispatch.setIsInstalling( id, true );\n\n\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\tconst url = getPluginUrl( block );\n\t\tlet links = {};\n\t\tif ( url ) {\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'active' },\n\t\t\t} );\n\t\t} else {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t} );\n\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\tlinks = response._links;\n\t\t}\n\n\t\tdispatch.addInstalledBlockType( {\n\t\t\t...block,\n\t\t\tlinks: { ...block.links, ...links },\n\t\t} );\n\n\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\tconst metadataFields = [\n\t\t\t'api_version',\n\t\t\t'title',\n\t\t\t'category',\n\t\t\t'parent',\n\t\t\t'icon',\n\t\t\t'description',\n\t\t\t'keywords',\n\t\t\t'attributes',\n\t\t\t'provides_context',\n\t\t\t'uses_context',\n\t\t\t'supports',\n\t\t\t'styles',\n\t\t\t'example',\n\t\t\t'variations',\n\t\t];\n\t\tawait apiFetch( {\n\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t_fields: metadataFields,\n\t\t\t} ),\n\t\t} )\n\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t.catch( () => {} )\n\t\t\t.then( ( response ) => {\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t} );\n\t\t\t} );\n\n\t\tawait loadAssets();\n\t\tconst registeredBlocks = registry.select( blocksStore ).getBlockTypes();\n\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s is the block title.\n\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\tblock.title\n\t\t\t),\n\t\t\t{\n\t\t\t\tspeak: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tsuccess = true;\n\t} catch ( error ) {\n\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t// Errors we throw are fatal.\n\t\tlet isFatal = error instanceof Error;\n\n\t\t// Specific API errors that are fatal.\n\t\tconst fatalAPIErrors = {\n\t\t\tfolder_exists: __(\n\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t),\n\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t),\n\t\t};\n\n\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\tisFatal = true;\n\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t}\n\n\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\tspeak: true,\n\t\t\tisDismissible: true,\n\t\t} );\n\t}\n\tdispatch.setIsInstalling( id, false );\n\treturn success;\n};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\ttry {\n\t\tconst url = getPluginUrl( block );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'PUT',\n\t\t\turl,\n\t\t\tdata: { status: 'inactive' },\n\t\t} );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'DELETE',\n\t\t\turl,\n\t\t} );\n\t\tdispatch.removeInstalledBlockType( block );\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice( error.message || __( 'An error occurred.' ) );\n\t}\n};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/**\n * External dependencies\n */\nimport { camelCase, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks = ( filterValue ) => async ( {\n\tdispatch,\n} ) => {\n\tif ( ! filterValue ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\tconst results = await apiFetch( {\n\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t} );\n\t\tconst blocks = results.map( ( result ) =>\n\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t);\n\n\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t} catch {}\n};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * External dependencies\n */\nimport { times } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ times( fullStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( halfStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( emptyStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetErrorNoticeForBlock,\n\t\t\t\tisInstalling: isBlockInstalling,\n\t\t\t} = select( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<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\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\ticon={ blockDefault }\n\t\t\t/>\n\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t</div>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst {\n\t\t\tgetDownloadableBlocks,\n\t\t\tisRequestingDownloadableBlocks,\n\t\t} = select( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","map","result","mapKeys","camelCase","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","assign","target","arguments","source","apply","this","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","times","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","items","onHover","noop","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
1 |
+
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"yBACA,IAAIA,EAAsB,CCA1B,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,SACpC,WAAa,OAAOA,GAErB,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,SAASI,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,SAASM,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICC/F,EAAwB,SAAST,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,q2BCLvD,IAAI,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GlD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGJ,EAA+BH,OAAW,GAAe,YCS9C,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,IAAI,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,SCAtD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe9C,MAAMuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EAAqBP,GAAWQ,MAAAA,IAGtC,IAH8C,SACpDC,EADoD,SAEpDC,GACM,EACN,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAoBD,SAlBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFtExBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GEgDXC,IACmBpC,EAASrC,OAAQ0E,EAAAA,OAAcC,gBAChCnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQKkD,EAAuB9D,GAAWQ,MAAAA,IAGxC,IAHgD,SACtDC,EADsD,SAEtDC,GACM,EACN,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBAAmBN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAYrC,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GCxQK,MAAMY,EAA0BtB,GAAiB8D,MAAAA,IAEjD,IAFyD,SAC/DE,GACM,EACN,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAQnCgE,EAAUJ,SAPYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtBsH,KAAOC,IAC7BC,EAAAA,EAAAA,SAASD,GAAQ,CAAE9H,EAAOb,KAAS6I,EAAAA,EAAAA,WAAW7I,OAGFoB,IAC5C,SCPU0H,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEb,IAAuBc,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAa3G,IAC3C,MAAM,iBAAE4G,EAAF,aAAoBC,GAAiB7G,EAAQ8G,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtB3G,GAAYA,EAAQyG,GAAsBrG,uBAC5C,IAYD,OATA4G,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiBxH,QAC/CwH,EAAiB/F,SAAWlC,IAC3B4G,EAAoB5G,IACpBmI,EAAAA,EAAAA,qBAAqBnI,EAAUC,WAG/B,CAAE2H,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,IAAI,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA3C,SAASmJ,IAetB,OAdAA,EAAW/J,OAAOgK,QAAU,SAAUC,GACpC,IAAK,IAAI5H,EAAI,EAAGA,EAAI6H,UAAU/H,OAAQE,IAAK,CACzC,IAAI8H,EAASD,UAAU7H,GAEvB,IAAK,IAAIvC,KAAOqK,EACVnK,OAAOM,UAAUC,eAAeC,KAAK2J,EAAQrK,KAC/CmK,EAAOnK,GAAOqK,EAAOrK,IAK3B,OAAOmK,IAGOG,MAAMC,KAAMH,WCf9B,IAAI,EAA+BtJ,OAAW,GAAgB,aCwB9D,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBD,EAA+B5J,OAAW,GAAc,WCW5D,GALC,mBAAC,EAAAgK,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,qVCIV,GALC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,4dCQV,GATC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CACCC,SAAS,UACTtL,EAAE,+jBACFuL,SAAS,aC4CZ,EA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAa7D,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ2D,KAGCQ,EAAAA,EAAAA,OAAOL,GAAiBjJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,2CACVtB,KAAOuB,EACPtB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOH,GAAiBnJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,gDACVtB,KAAOwB,EACPvB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOD,GAAkBrJ,IAC1B,mBAAC,EAAD,CACCvC,IAAO,eAAeuC,IACtBuJ,UAAU,4CACVtB,KAAOyB,EACPxB,KAAO,SCpCZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,EAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYtH,IAAMgG,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE3H,GAAa,EACvD,MAAM4H,GAAc7C,EAAAA,EAAAA,YACjB3G,GACDA,EAAQyG,GAAsBnG,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO4H,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYtK,QACZsK,EAAYrK,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAAS6E,GAAT,KAGE,IAFD,MAAEzE,EAAF,OAASsD,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BjL,GACzB,EACD,MAAM4J,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd5E,EAAAA,EAAAA,SAAS,wBAAwB8E,EAAAA,EAAAA,gBAAgB7E,IAGpD4E,GAEG7E,EAAAA,EAAAA,SAAS,WAAW8E,EAAAA,EAAAA,gBAAgB7E,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkB8E,EAAAA,EAAAA,gBAAgB7E,IAI9C0E,EAAc,GAEX3E,EAAAA,EAAAA,SAAS,eAAe8E,EAAAA,EAAAA,gBAAgB7E,KAGzCD,EAAAA,EAAAA;;CAEN+E,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,EAAAA,gBAAgB7E,GAChBuD,EACAmB,GAsGF,OAlGA,YAAmE,IAA/B,UAAEK,EAAF,KAAanL,EAAb,QAAmBoL,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCtD,GAAUpG,EAE/CgL,KAAiBO,EAAAA,EAAAA,cAAcvL,EAAKG,OAEpC,UAAE4K,EAAF,aAAahL,EAAb,cAA2ByL,IAAkBzD,EAAAA,EAAAA,YAChD3G,IACD,MAAM,uBACLM,EACA3B,aAAc0L,GACXrK,EAAQyG,GACN6D,EAAShK,EAAwB1B,EAAK2D,IACtCgI,EAAWD,GAAUA,EAAOnL,QAClC,MAAO,CACNwK,YAAcW,EACd3L,aAAc0L,EAAmBzL,EAAK2D,IACtC6H,eAAiBG,KAGnB,CAAE3L,IAGH,IAAI4L,EAAa,GAOjB,OANKZ,EACJY,GAAa5F,EAAAA,EAAAA,IAAI,cACNjG,IACX6L,GAAa5F,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,GACC6F,2BAAyB,EACzBC,KAAK,SACLC,GAAKC,EAAAA,QACAb,EAJN,CAKCf,UAAU,+CACVgB,QAAYa,IACXA,EAAMC,iBACNd,KAEDe,OAASpM,EACTqM,SAAWrM,IAAkByL,EAC7Ba,MAAQxB,GAA2B7K,EAAM,CACxC+K,UAAAA,EACAC,YAAAA,EACAjL,aAAAA,IAEDuM,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKnC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,IAC3CrG,GACD,2BAAMqK,UAAU,0DACf,mBAAC,EAAAoC,QAAD,QAGD,mBAAC,GAAD,CAAc9C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACbqC,EAAAA,EAAAA,2BACDtG,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJiF,EAAAA,EAAAA,gBAAgB7E,GAChBiF,GAED,CACCqB,MACC,2BAAMtC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyB/H,MAAQhD,KAEjC,oCACC,2BAAMoK,UAAU,sDACVwB,IAEFX,EAAAA,EAAAA,gBAAgBK,IAElBE,KACGR,GAAejL,KAClB,mBAAC,EAAA4M,eAAD,MACG3G,EAAAA,EAAAA,IAAI,sBCtFf,GA5CA,YAAuE,IAAtC,MAAE4G,EAAF,QAASC,EAAUC,EAAAA,KAAnB,SAAyBC,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAEzJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAO+E,EAAMjM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf4G,EAAM5F,KAAOhH,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACXwH,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAcvL,EAAKG,MACvB4M,EAAU/M,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJmJ,EAAU/M,MAIb6M,EAAS,OAEVA,QAAUA,EACV7M,KAAOA,OA/BJ,MC3BL,GAA+BZ,OAAW,GAAQ,KCsDtD,GA/CA,YAII,IAJsC,SACzC6N,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkBvM,OAehC,OAdAyH,EAAAA,EAAAA,YAAW,MACV/B,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAEC+E,EAAAA,EAAAA,IACC,+CACA,iDACAkC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IAAI,sDAIR,0BAAKoE,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXpE,EAAAA,EAAAA,IAAI,0BAEP,wBAAGoE,UAAU,2DACVpE,EAAAA,EAAAA,IACD,wDAIDiH,KCrCN,IALC,mBAAC,EAAA7D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,oLCWV,GAZA,WACC,OACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKrH,EAAAA,EAAAA,IAAI,wBC0DZ,IAAesH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAEnM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAe8N,EAAe,MAAY,EAC/D,MAAM,sBACLxM,EADK,+BAELD,GACGK,EAAQyG,IACN,mBAAE4F,GAAuBrM,EAAQE,EAAAA,OAEjCoM,EAAgBtM,EAAQuM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNV,kBANyBQ,EALlB1M,EAMiBtB,GANaO,QAAU+C,GAC9CyK,EAAoBzK,EAAOwK,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiB9M,EAAgCrB,QAtBpD,EArDA,YAQI,IAR8B,kBACjCwN,EADiC,SAEjCH,EAFiC,QAGjCF,EAHiC,eAIjCM,EAJiC,cAKjCO,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBP,IACpB,oCACC,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUkB,EACPP,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBvM,QAC3B,mBAAC,GAAD,CACCuM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCP,MAAQM,EACRH,SAAWA,EACXF,QAAUA,MAIVM,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQY,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHrB,EADG,QAEHF,EAFG,YAGHnN,EAHG,SAIH2O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBrO,GAC7BwO,EAAyBxO,GAGnBqO,GAKN,mBAAC,GAAD,CACChB,SAAWA,EACXF,QAAUA,EACVW,aAAeA,EACf9N,YAAcqO,EACdZ,eAAiBkB,EACjBP,SAAWpO,IAAgBqO,IAVrB,SClCR,GAA+B3O,OAAW,GAAY,SCU3C,SAASkP,GAAT,GAAkC,IAAZ,MAAE1B,GAAU,EAChD,OAAOA,EAAMjM,QAKZ,yBAAIyJ,UAAU,gCACXwC,EAAM5F,KAAK,QAAE,KAAE8B,EAAF,GAAQnF,EAAR,MAAYyC,EAAZ,OAAmBiF,GAArB,SACZ,yBAAI/M,IAAMqF,EAAKyG,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,KAE7C,0BAAKgE,UAAU,+CACd,0BAAKA,UAAU,4CACZhE,IAEH,0BAAKgE,UAAU,8CACZjE,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJqF,UAjBC,KCEM,SAASkD,KACvB,MAAMC,GAAgBzG,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOsN,EAAc7N,QAKpB,mBAAC,GAAA8N,sBAAD,CACC3F,KAAOuE,GACPjH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAsD,EAAc7N,QAEf6N,EAAc7N,QAEf+N,aAAc,IAEd,wBAAGtE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAsD,EAAc7N,UAGhB,mBAAC2N,GAAD,CAAa1B,MAAQ4B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc5L,EAAd,SAAqB6L,GAAa,EACxE,MAAMC,GAAoB/G,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEkH,IAAiBnH,EAAAA,EAAAA,aAAatG,EAAAA,OAEtC,OACC,mBAAC,EAAA0K,OAAD,CACCZ,QAAU,IACT7H,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYqL,EAAAA,EAAAA,cAAcvI,EAAM7C,OAC9B6O,IAAkB/J,EAAAA,EAAAA,OACzB2J,EAAWK,iBAEPD,GAAiB9O,GACrB6O,EACCF,GACAK,EAAAA,EAAAA,aACChP,EAAUC,KACV6O,EAAcJ,WACdI,EAAclO,kBAOpBsL,SAAW0C,EACX3C,OAAS2C,EACTK,QAAQ,YAENhJ,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMgJ,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBhG,GAAa,EAC1D,MAAM,aAAEqG,EAAF,2BAAgBC,GAA+BtG,EAAM4F,YACrD,aAAEG,IAAiBnH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCiO,IAAgBD,EAChBE,GAAejE,EAAAA,EAAAA,cAAc,aAEnC,IAAIkE,GAActJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDgJ,EAAc5I,OAASiJ,GAExB,MAAM9H,EAAU,EACf,mBAACoH,GAAD,CACCrQ,IAAI,UACJ0E,MAAQgM,EACRJ,WAAa5F,EAAM4F,WACnBC,SAAW7F,EAAM6F,YAmBnB,OAfKU,GAAcC,IAClBC,GAActJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDgJ,EAAc5I,OAASiJ,GAExB9H,EAAQmI,MACP,mBAAC,EAAA1D,OAAD,CAAQ1N,IAAI,UAAU8M,QArCF,KACrB2D,EACC/F,EAAM6F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDnJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU4J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAAStI,QAAUA,GAAYkI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACrI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC4G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAU/P,KACX,MAAc,iBAATA,IAGL+P,EAASC,MDZiBC,ECYSF,EAASC,KDZOnH,IACpD,MAAM,aAAEqG,GAAiBrG,EAAM4F,YAGzB,MAAE5L,EAAF,cAAS0K,IAAkB3F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWqO,GACVpP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBkP,IAAiBlP,KAC3C,MAAO,CACNuN,cAAetM,EAAQuM,EAAAA,OAAYC,QAClC,OACA,0BAED5K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE2O,IAIH,OAAO3B,GAAmB1K,GAInB,mBAACoM,GAAD,KAAsBpG,EAAtB,CAA8BgG,cAAgBhM,MAH7C,mBAACoN,EAAuBpH,MCbvBkH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\tconst { id, name } = block;\n\tlet success = false;\n\tdispatch.clearErrorNotice( id );\n\ttry {\n\t\tdispatch.setIsInstalling( id, true );\n\n\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\tconst url = getPluginUrl( block );\n\t\tlet links = {};\n\t\tif ( url ) {\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'active' },\n\t\t\t} );\n\t\t} else {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t} );\n\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\tlinks = response._links;\n\t\t}\n\n\t\tdispatch.addInstalledBlockType( {\n\t\t\t...block,\n\t\t\tlinks: { ...block.links, ...links },\n\t\t} );\n\n\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\tconst metadataFields = [\n\t\t\t'api_version',\n\t\t\t'title',\n\t\t\t'category',\n\t\t\t'parent',\n\t\t\t'icon',\n\t\t\t'description',\n\t\t\t'keywords',\n\t\t\t'attributes',\n\t\t\t'provides_context',\n\t\t\t'uses_context',\n\t\t\t'supports',\n\t\t\t'styles',\n\t\t\t'example',\n\t\t\t'variations',\n\t\t];\n\t\tawait apiFetch( {\n\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t_fields: metadataFields,\n\t\t\t} ),\n\t\t} )\n\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t.catch( () => {} )\n\t\t\t.then( ( response ) => {\n\t\t\t\tif ( ! response ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t} );\n\t\t\t} );\n\n\t\tawait loadAssets();\n\t\tconst registeredBlocks = registry.select( blocksStore ).getBlockTypes();\n\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\tsprintf(\n\t\t\t\t// translators: %s is the block title.\n\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\tblock.title\n\t\t\t),\n\t\t\t{\n\t\t\t\tspeak: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t\tsuccess = true;\n\t} catch ( error ) {\n\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t// Errors we throw are fatal.\n\t\tlet isFatal = error instanceof Error;\n\n\t\t// Specific API errors that are fatal.\n\t\tconst fatalAPIErrors = {\n\t\t\tfolder_exists: __(\n\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t),\n\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t),\n\t\t};\n\n\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\tisFatal = true;\n\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t}\n\n\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\tspeak: true,\n\t\t\tisDismissible: true,\n\t\t} );\n\t}\n\tdispatch.setIsInstalling( id, false );\n\treturn success;\n};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType = ( block ) => async ( {\n\tregistry,\n\tdispatch,\n} ) => {\n\ttry {\n\t\tconst url = getPluginUrl( block );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'PUT',\n\t\t\turl,\n\t\t\tdata: { status: 'inactive' },\n\t\t} );\n\t\tawait apiFetch( {\n\t\t\tmethod: 'DELETE',\n\t\t\turl,\n\t\t} );\n\t\tdispatch.removeInstalledBlockType( block );\n\t} catch ( error ) {\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createErrorNotice( error.message || __( 'An error occurred.' ) );\n\t}\n};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/**\n * External dependencies\n */\nimport { camelCase, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks = ( filterValue ) => async ( {\n\tdispatch,\n} ) => {\n\tif ( ! filterValue ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\tconst results = await apiFetch( {\n\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t} );\n\t\tconst blocks = results.map( ( result ) =>\n\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t);\n\n\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t} catch {}\n};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * External dependencies\n */\nimport { times } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ times( fullStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( halfStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( emptyStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetErrorNoticeForBlock,\n\t\t\t\tisInstalling: isBlockInstalling,\n\t\t\t} = select( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t__experimentalIsFocusable\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<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\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\ticon={ blockDefault }\n\t\t\t/>\n\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t</div>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst {\n\t\t\tgetDownloadableBlocks,\n\t\t\tisRequestingDownloadableBlocks,\n\t\t} = select( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","map","result","mapKeys","camelCase","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","assign","target","arguments","source","apply","this","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","times","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","__experimentalIsFocusable","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","items","onHover","noop","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
build/block-editor/index.js
CHANGED
@@ -2256,6 +2256,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2256 |
"__unstableEditorStyles": function() { return /* reexport */ EditorStyles; },
|
2257 |
"__unstableIframe": function() { return /* reexport */ iframe; },
|
2258 |
"__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; },
|
|
|
2259 |
"__unstableRichTextInputEvent": function() { return /* reexport */ __unstableRichTextInputEvent; },
|
2260 |
"__unstableUseBlockSelectionClearer": function() { return /* reexport */ useBlockSelectionClearer; },
|
2261 |
"__unstableUseClipboardHandler": function() { return /* reexport */ useClipboardHandler; },
|
@@ -2307,6 +2308,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2307 |
"__unstableGetSelectedBlocksWithPartialSelection": function() { return __unstableGetSelectedBlocksWithPartialSelection; },
|
2308 |
"__unstableIsFullySelected": function() { return __unstableIsFullySelected; },
|
2309 |
"__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
|
|
|
2310 |
"__unstableIsSelectionMergeable": function() { return __unstableIsSelectionMergeable; },
|
2311 |
"areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
|
2312 |
"canEditBlock": function() { return canEditBlock; },
|
@@ -2375,7 +2377,7 @@ __webpack_require__.d(selectors_namespaceObject, {
|
|
2375 |
"isBlockSelected": function() { return isBlockSelected; },
|
2376 |
"isBlockValid": function() { return isBlockValid; },
|
2377 |
"isBlockWithinSelection": function() { return isBlockWithinSelection; },
|
2378 |
-
"isCaretWithinFormattedText": function() { return
|
2379 |
"isDraggingBlocks": function() { return isDraggingBlocks; },
|
2380 |
"isFirstMultiSelectedBlock": function() { return isFirstMultiSelectedBlock; },
|
2381 |
"isLastBlockChangePersistent": function() { return isLastBlockChangePersistent; },
|
@@ -3797,29 +3799,6 @@ function draggedBlocks() {
|
|
3797 |
|
3798 |
return state;
|
3799 |
}
|
3800 |
-
/**
|
3801 |
-
* Reducer returning whether the caret is within formatted text.
|
3802 |
-
*
|
3803 |
-
* @param {boolean} state Current state.
|
3804 |
-
* @param {Object} action Dispatched action.
|
3805 |
-
*
|
3806 |
-
* @return {boolean} Updated state.
|
3807 |
-
*/
|
3808 |
-
|
3809 |
-
function isCaretWithinFormattedText() {
|
3810 |
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
3811 |
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
3812 |
-
|
3813 |
-
switch (action.type) {
|
3814 |
-
case 'ENTER_FORMATTED_TEXT':
|
3815 |
-
return true;
|
3816 |
-
|
3817 |
-
case 'EXIT_FORMATTED_TEXT':
|
3818 |
-
return false;
|
3819 |
-
}
|
3820 |
-
|
3821 |
-
return state;
|
3822 |
-
}
|
3823 |
/**
|
3824 |
* Internal helper reducer for selectionStart and selectionEnd. Can hold a block
|
3825 |
* selection, represented by an object with property clientId.
|
@@ -4442,7 +4421,6 @@ function lastBlockInserted() {
|
|
4442 |
blocks,
|
4443 |
isTyping,
|
4444 |
draggedBlocks,
|
4445 |
-
isCaretWithinFormattedText,
|
4446 |
selection,
|
4447 |
isMultiSelecting,
|
4448 |
isSelectionEnabled,
|
@@ -4756,6 +4734,9 @@ const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp
|
|
4756 |
|
4757 |
;// CONCATENATED MODULE: external ["wp","richText"]
|
4758 |
var external_wp_richText_namespaceObject = window["wp"]["richText"];
|
|
|
|
|
|
|
4759 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/utils.js
|
4760 |
/**
|
4761 |
* Helper function that maps attribute definition properties to the
|
@@ -4793,6 +4774,7 @@ function mapRichTextSettings(attributeDefinition) {
|
|
4793 |
|
4794 |
|
4795 |
|
|
|
4796 |
/**
|
4797 |
* Internal dependencies
|
4798 |
*/
|
@@ -5639,6 +5621,19 @@ function __unstableIsFullySelected(state) {
|
|
5639 |
const selectionFocus = getSelectionEnd(state);
|
5640 |
return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined';
|
5641 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5642 |
/**
|
5643 |
* Check whether the selection is mergeable.
|
5644 |
*
|
@@ -5972,13 +5967,17 @@ function isAncestorBeingDragged(state, clientId) {
|
|
5972 |
/**
|
5973 |
* Returns true if the caret is within formatted text, or false otherwise.
|
5974 |
*
|
5975 |
-
* @
|
5976 |
*
|
5977 |
* @return {boolean} Whether the caret is within formatted text.
|
5978 |
*/
|
5979 |
|
5980 |
-
function
|
5981 |
-
|
|
|
|
|
|
|
|
|
5982 |
}
|
5983 |
/**
|
5984 |
* Returns the insertion point, the index at which the new inserted block would
|
@@ -7186,9 +7185,6 @@ function wasBlockJustInserted(state, clientId, source) {
|
|
7186 |
|
7187 |
;// CONCATENATED MODULE: external ["wp","a11y"]
|
7188 |
var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
7189 |
-
;// CONCATENATED MODULE: external ["wp","deprecated"]
|
7190 |
-
var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
7191 |
-
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
7192 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/actions.js
|
7193 |
/**
|
7194 |
* External dependencies
|
@@ -8339,23 +8335,35 @@ function stopDraggingBlocks() {
|
|
8339 |
/**
|
8340 |
* Returns an action object used in signalling that the caret has entered formatted text.
|
8341 |
*
|
|
|
|
|
8342 |
* @return {Object} Action object.
|
8343 |
*/
|
8344 |
|
8345 |
function enterFormattedText() {
|
|
|
|
|
|
|
|
|
8346 |
return {
|
8347 |
-
type: '
|
8348 |
};
|
8349 |
}
|
8350 |
/**
|
8351 |
* Returns an action object used in signalling that the user caret has exited formatted text.
|
8352 |
*
|
|
|
|
|
8353 |
* @return {Object} Action object.
|
8354 |
*/
|
8355 |
|
8356 |
function exitFormattedText() {
|
|
|
|
|
|
|
|
|
8357 |
return {
|
8358 |
-
type: '
|
8359 |
};
|
8360 |
}
|
8361 |
/**
|
@@ -24676,7 +24684,7 @@ function BlockListAppender(_ref) {
|
|
24676 |
};
|
24677 |
})(BlockListAppender));
|
24678 |
|
24679 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-
|
24680 |
/**
|
24681 |
* WordPress dependencies
|
24682 |
*/
|
@@ -24715,7 +24723,10 @@ function usePopoverScroll(scrollableRef) {
|
|
24715 |
}, [scrollableRef]);
|
24716 |
}
|
24717 |
|
24718 |
-
|
|
|
|
|
|
|
24719 |
|
24720 |
|
24721 |
/**
|
@@ -24730,7 +24741,6 @@ function usePopoverScroll(scrollableRef) {
|
|
24730 |
|
24731 |
|
24732 |
|
24733 |
-
|
24734 |
/**
|
24735 |
* Internal dependencies
|
24736 |
*/
|
@@ -24738,63 +24748,35 @@ function usePopoverScroll(scrollableRef) {
|
|
24738 |
|
24739 |
|
24740 |
|
24741 |
-
|
24742 |
const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
|
24743 |
|
24744 |
-
function
|
24745 |
let {
|
|
|
|
|
|
|
24746 |
__unstablePopoverSlot,
|
24747 |
-
__unstableContentRef
|
|
|
24748 |
} = _ref;
|
24749 |
-
const {
|
24750 |
-
selectBlock,
|
24751 |
-
hideInsertionPoint
|
24752 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
24753 |
-
const openRef = (0,external_wp_element_namespaceObject.useContext)(InsertionPointOpenRef);
|
24754 |
-
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
24755 |
const {
|
24756 |
orientation,
|
24757 |
-
|
24758 |
-
nextClientId,
|
24759 |
-
rootClientId,
|
24760 |
-
isInserterShown
|
24761 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
24762 |
var _getBlockListSettings;
|
24763 |
|
24764 |
const {
|
24765 |
-
getBlockOrder,
|
24766 |
getBlockListSettings,
|
24767 |
-
|
24768 |
-
isBlockBeingDragged,
|
24769 |
-
getPreviousBlockClientId,
|
24770 |
-
getNextBlockClientId
|
24771 |
} = select(store);
|
24772 |
-
const insertionPoint = getBlockInsertionPoint();
|
24773 |
-
const order = getBlockOrder(insertionPoint.rootClientId);
|
24774 |
-
|
24775 |
-
if (!order.length) {
|
24776 |
-
return {};
|
24777 |
-
}
|
24778 |
|
24779 |
-
|
24780 |
-
let _nextClientId = order[insertionPoint.index];
|
24781 |
-
|
24782 |
-
while (isBlockBeingDragged(_previousClientId)) {
|
24783 |
-
_previousClientId = getPreviousBlockClientId(_previousClientId);
|
24784 |
-
}
|
24785 |
-
|
24786 |
-
while (isBlockBeingDragged(_nextClientId)) {
|
24787 |
-
_nextClientId = getNextBlockClientId(_nextClientId);
|
24788 |
-
}
|
24789 |
|
24790 |
return {
|
24791 |
-
|
24792 |
-
|
24793 |
-
orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
24794 |
-
rootClientId: insertionPoint.rootClientId,
|
24795 |
-
isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
|
24796 |
};
|
24797 |
-
}, []);
|
24798 |
const previousElement = useBlockElement(previousClientId);
|
24799 |
const nextElement = useBlockElement(nextClientId);
|
24800 |
const isVertical = orientation === 'vertical';
|
@@ -24823,7 +24805,7 @@ function InsertionPointPopover(_ref) {
|
|
24823 |
width,
|
24824 |
height: previousElement ? previousElement.offsetHeight : nextElement.offsetHeight
|
24825 |
};
|
24826 |
-
}, [previousElement, nextElement]);
|
24827 |
const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
24828 |
if (!previousElement && !nextElement) {
|
24829 |
return {};
|
@@ -24873,9 +24855,122 @@ function InsertionPointPopover(_ref) {
|
|
24873 |
ownerDocument
|
24874 |
};
|
24875 |
}, [previousElement, nextElement]);
|
24876 |
-
const popoverScrollRef =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24877 |
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
|
24878 |
-
const className = classnames_default()('block-editor-block-list__insertion-point', 'is-' + orientation);
|
24879 |
|
24880 |
function onClick(event) {
|
24881 |
if (event.target === ref.current && nextClientId) {
|
@@ -24897,12 +24992,9 @@ function InsertionPointPopover(_ref) {
|
|
24897 |
if (event.target === ref.current && !openRef.current) {
|
24898 |
hideInsertionPoint();
|
24899 |
}
|
24900 |
-
} //
|
24901 |
-
// previous and a next element.
|
24902 |
|
24903 |
|
24904 |
-
const showInsertionPointInserter = previousElement && nextElement && isInserterShown; // Define animation variants for the line element.
|
24905 |
-
|
24906 |
const horizontalLine = {
|
24907 |
start: {
|
24908 |
width: 0,
|
@@ -24954,7 +25046,7 @@ function InsertionPointPopover(_ref) {
|
|
24954 |
opacity: 1,
|
24955 |
borderRadius: '2px',
|
24956 |
transition: {
|
24957 |
-
delay:
|
24958 |
}
|
24959 |
},
|
24960 |
hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover),
|
@@ -24976,27 +25068,12 @@ function InsertionPointPopover(_ref) {
|
|
24976 |
}
|
24977 |
}
|
24978 |
};
|
24979 |
-
|
24980 |
-
|
24981 |
-
|
24982 |
-
|
24983 |
-
|
24984 |
-
|
24985 |
-
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
24986 |
-
|
24987 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
24988 |
-
ref: popoverScrollRef,
|
24989 |
-
noArrow: true,
|
24990 |
-
animate: false,
|
24991 |
-
getAnchorRect: getAnchorRect,
|
24992 |
-
focusOnMount: false,
|
24993 |
-
className: "block-editor-block-list__insertion-point-popover" // Render in the old slot if needed for backward compatibility,
|
24994 |
-
// otherwise render in place (not in the the default popover slot).
|
24995 |
-
,
|
24996 |
-
__unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
|
24997 |
-
// This makes sure the popover doesn't animate from its previous position.
|
24998 |
-
,
|
24999 |
-
key: nextClientId + '--' + rootClientId
|
25000 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
25001 |
layout: !disableMotion,
|
25002 |
initial: disableMotion ? 'rest' : 'start',
|
@@ -25009,14 +25086,13 @@ function InsertionPointPopover(_ref) {
|
|
25009 |
onClick: onClick,
|
25010 |
onFocus: onFocus,
|
25011 |
className: classnames_default()(className, {
|
25012 |
-
'is-with-inserter':
|
25013 |
}),
|
25014 |
-
onHoverEnd: maybeHideInserterPoint
|
25015 |
-
style: style
|
25016 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
25017 |
variants: lineVariants,
|
25018 |
className: "block-editor-block-list__insertion-point-indicator"
|
25019 |
-
}),
|
25020 |
variants: inserterVariants,
|
25021 |
className: classnames_default()('block-editor-block-list__insertion-point-inserter')
|
25022 |
}, (0,external_wp_element_namespaceObject.createElement)(inserter, {
|
@@ -25031,24 +25107,19 @@ function InsertionPointPopover(_ref) {
|
|
25031 |
openRef.current = false;
|
25032 |
}
|
25033 |
}))));
|
25034 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
25035 |
}
|
25036 |
|
25037 |
function InsertionPoint(_ref2) {
|
25038 |
let {
|
25039 |
children,
|
25040 |
-
|
25041 |
-
__unstableContentRef
|
25042 |
} = _ref2;
|
25043 |
const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
25044 |
return select(store).isBlockInsertionPointVisible();
|
25045 |
}, []);
|
25046 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
25047 |
value: (0,external_wp_element_namespaceObject.useRef)(false)
|
25048 |
-
}, isVisible && (0,external_wp_element_namespaceObject.createElement)(InsertionPointPopover,
|
25049 |
-
__unstablePopoverSlot: __unstablePopoverSlot,
|
25050 |
-
__unstableContentRef: __unstableContentRef
|
25051 |
-
}), children);
|
25052 |
}
|
25053 |
|
25054 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-in-between-inserter.js
|
@@ -25065,7 +25136,7 @@ function InsertionPoint(_ref2) {
|
|
25065 |
|
25066 |
|
25067 |
function useInBetweenInserter() {
|
25068 |
-
const openRef = (0,external_wp_element_namespaceObject.useContext)(
|
25069 |
const hasReducedUI = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasReducedUI, []);
|
25070 |
const {
|
25071 |
getBlockListSettings,
|
@@ -25271,6 +25342,7 @@ function usePreParsePatterns() {
|
|
25271 |
* @property {string} title Human-readable block type label.
|
25272 |
* @property {WPIcon} icon Block type icon.
|
25273 |
* @property {string} description A detailed block type description.
|
|
|
25274 |
*/
|
25275 |
|
25276 |
/**
|
@@ -25314,7 +25386,8 @@ function useBlockDisplayInformation(clientId) {
|
|
25314 |
return {
|
25315 |
title: match.title || blockType.title,
|
25316 |
icon: match.icon || blockType.icon,
|
25317 |
-
description: match.description || blockType.description
|
|
|
25318 |
};
|
25319 |
}, [clientId]);
|
25320 |
}
|
@@ -25660,6 +25733,7 @@ const BlockDraggable = _ref => {
|
|
25660 |
|
25661 |
|
25662 |
|
|
|
25663 |
/**
|
25664 |
* Block selection button component, displaying the label of the block. If the block
|
25665 |
* descends from a root block, a button is displayed enabling the user to select
|
@@ -25674,8 +25748,7 @@ const BlockDraggable = _ref => {
|
|
25674 |
function BlockSelectionButton(_ref) {
|
25675 |
let {
|
25676 |
clientId,
|
25677 |
-
rootClientId
|
25678 |
-
blockElement
|
25679 |
} = _ref;
|
25680 |
const blockInformation = useBlockDisplayInformation(clientId);
|
25681 |
const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -25720,6 +25793,7 @@ function BlockSelectionButton(_ref) {
|
|
25720 |
ref.current.focus();
|
25721 |
(0,external_wp_a11y_namespaceObject.speak)(label);
|
25722 |
}, [label]);
|
|
|
25723 |
const {
|
25724 |
hasBlockMovingClientId,
|
25725 |
getBlockIndex,
|
@@ -26392,10 +26466,10 @@ const BlockMoverButton = (0,external_wp_element_namespaceObject.forwardRef)((_re
|
|
26392 |
"aria-describedby": descriptionId
|
26393 |
}, props, {
|
26394 |
onClick: isDisabled ? null : onClick,
|
26395 |
-
|
26396 |
-
|
26397 |
-
|
26398 |
-
|
26399 |
}, getBlockMoverDescription(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, direction === 'up' ? -1 : 1, orientation)));
|
26400 |
});
|
26401 |
const BlockMoverUpButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
|
@@ -26428,8 +26502,6 @@ const BlockMoverDownButton = (0,external_wp_element_namespaceObject.forwardRef)(
|
|
26428 |
|
26429 |
|
26430 |
|
26431 |
-
|
26432 |
-
|
26433 |
/**
|
26434 |
* Internal dependencies
|
26435 |
*/
|
@@ -26440,39 +26512,54 @@ const BlockMoverDownButton = (0,external_wp_element_namespaceObject.forwardRef)(
|
|
26440 |
|
26441 |
function BlockMover(_ref) {
|
26442 |
let {
|
26443 |
-
isFirst,
|
26444 |
-
isLast,
|
26445 |
clientIds,
|
26446 |
-
canMove,
|
26447 |
-
isHidden,
|
26448 |
-
rootClientId,
|
26449 |
-
orientation,
|
26450 |
hideDragHandle
|
26451 |
} = _ref;
|
26452 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26453 |
|
26454 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26455 |
|
26456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26457 |
|
26458 |
if (!canMove || isFirst && isLast && !rootClientId) {
|
26459 |
return null;
|
26460 |
}
|
26461 |
|
26462 |
-
const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag');
|
26463 |
-
// attribute on the buttons while it has focus causes the screen to change
|
26464 |
-
// to an unfocused state (body as active element) without firing blur on,
|
26465 |
-
// the rendering parent, leaving it unable to react to focus out.
|
26466 |
-
|
26467 |
|
26468 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
26469 |
className: classnames_default()('block-editor-block-mover', {
|
26470 |
-
'is-visible': isFocused || !isHidden,
|
26471 |
'is-horizontal': orientation === 'horizontal'
|
26472 |
})
|
26473 |
}, !hideDragHandle && (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
|
26474 |
-
clientIds: clientIds
|
26475 |
-
cloneClassname: "block-editor-block-mover__drag-clone"
|
26476 |
}, draggableProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({
|
26477 |
icon: drag_handle,
|
26478 |
className: "block-editor-block-mover__drag-handle",
|
@@ -26481,17 +26568,11 @@ function BlockMover(_ref) {
|
|
26481 |
// button can only be used with a pointer device.
|
26482 |
,
|
26483 |
tabIndex: "-1"
|
26484 |
-
}, draggableProps))), (0,external_wp_element_namespaceObject.createElement)(
|
26485 |
className: "block-editor-block-mover__move-button-container"
|
26486 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
|
26487 |
-
onFocus: onFocus,
|
26488 |
-
onBlur: onBlur
|
26489 |
-
}, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverUpButton, _extends({
|
26490 |
clientIds: clientIds
|
26491 |
-
}, itemProps))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
|
26492 |
-
onFocus: onFocus,
|
26493 |
-
onBlur: onBlur
|
26494 |
-
}, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverDownButton, _extends({
|
26495 |
clientIds: clientIds
|
26496 |
}, itemProps)))));
|
26497 |
}
|
@@ -26500,39 +26581,7 @@ function BlockMover(_ref) {
|
|
26500 |
*/
|
26501 |
|
26502 |
|
26503 |
-
/* harmony default export */ var block_mover = (
|
26504 |
-
var _getBlockListSettings;
|
26505 |
-
|
26506 |
-
let {
|
26507 |
-
clientIds
|
26508 |
-
} = _ref2;
|
26509 |
-
const {
|
26510 |
-
getBlock,
|
26511 |
-
getBlockIndex,
|
26512 |
-
getBlockListSettings,
|
26513 |
-
canMoveBlocks,
|
26514 |
-
getBlockOrder,
|
26515 |
-
getBlockRootClientId
|
26516 |
-
} = select(store);
|
26517 |
-
const normalizedClientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
|
26518 |
-
const firstClientId = (0,external_lodash_namespaceObject.first)(normalizedClientIds);
|
26519 |
-
const block = getBlock(firstClientId);
|
26520 |
-
const rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.first)(normalizedClientIds));
|
26521 |
-
const firstIndex = getBlockIndex(firstClientId);
|
26522 |
-
const lastIndex = getBlockIndex((0,external_lodash_namespaceObject.last)(normalizedClientIds));
|
26523 |
-
const blockOrder = getBlockOrder(rootClientId);
|
26524 |
-
const isFirst = firstIndex === 0;
|
26525 |
-
const isLast = lastIndex === blockOrder.length - 1;
|
26526 |
-
return {
|
26527 |
-
blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null,
|
26528 |
-
canMove: canMoveBlocks(clientIds, rootClientId),
|
26529 |
-
rootClientId,
|
26530 |
-
firstIndex,
|
26531 |
-
isFirst,
|
26532 |
-
isLast,
|
26533 |
-
orientation: (_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation
|
26534 |
-
};
|
26535 |
-
})(BlockMover));
|
26536 |
|
26537 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/utils.js
|
26538 |
/**
|
@@ -27853,6 +27902,7 @@ function useClipboardHandler() {
|
|
27853 |
hasMultiSelection,
|
27854 |
getSettings,
|
27855 |
__unstableIsFullySelected,
|
|
|
27856 |
__unstableIsSelectionMergeable,
|
27857 |
__unstableGetSelectedBlocksWithPartialSelection
|
27858 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
@@ -27896,11 +27946,11 @@ function useClipboardHandler() {
|
|
27896 |
const eventDefaultPrevented = event.defaultPrevented;
|
27897 |
event.preventDefault();
|
27898 |
|
27899 |
-
const isFullySelected = __unstableIsFullySelected();
|
27900 |
-
|
27901 |
const isSelectionMergeable = __unstableIsSelectionMergeable();
|
27902 |
|
27903 |
-
const
|
|
|
|
|
27904 |
|
27905 |
if (event.type === 'copy' || event.type === 'cut') {
|
27906 |
if (selectedBlockClientIds.length === 1) {
|
@@ -27915,7 +27965,7 @@ function useClipboardHandler() {
|
|
27915 |
notifyCopy(event.type, selectedBlockClientIds);
|
27916 |
let blocks; // Check if we have partial selection.
|
27917 |
|
27918 |
-
if (
|
27919 |
blocks = getBlocksByClientId(selectedBlockClientIds);
|
27920 |
} else {
|
27921 |
const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection();
|
@@ -27934,7 +27984,7 @@ function useClipboardHandler() {
|
|
27934 |
// We need to also check if at the start we needed to
|
27935 |
// expand the selection, as in this point we might have
|
27936 |
// programmatically fully selected the blocks above.
|
27937 |
-
if (
|
27938 |
removeBlocks(selectedBlockClientIds);
|
27939 |
} else {
|
27940 |
__unstableDeleteSelection();
|
@@ -28457,15 +28507,12 @@ const lock = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
|
|
28457 |
/**
|
28458 |
* Return details about the block lock status.
|
28459 |
*
|
28460 |
-
* @param {string}
|
28461 |
-
* @param {boolean} checkParent Optional. The status is derived from the parent `templateLock`
|
28462 |
-
* when the current block's lock state isn't defined.
|
28463 |
*
|
28464 |
* @return {Object} Block lock status
|
28465 |
*/
|
28466 |
|
28467 |
function useBlockLock(clientId) {
|
28468 |
-
let checkParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
28469 |
return (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28470 |
const {
|
28471 |
canEditBlock,
|
@@ -28475,7 +28522,7 @@ function useBlockLock(clientId) {
|
|
28475 |
getBlockName,
|
28476 |
getBlockRootClientId
|
28477 |
} = select(store);
|
28478 |
-
const rootClientId =
|
28479 |
const canEdit = canEditBlock(clientId);
|
28480 |
const canMove = canMoveBlock(clientId, rootClientId);
|
28481 |
const canRemove = canRemoveBlock(clientId, rootClientId);
|
@@ -28486,7 +28533,7 @@ function useBlockLock(clientId) {
|
|
28486 |
canLock: canLockBlockType(getBlockName(clientId)),
|
28487 |
isLocked: !canEdit || !canMove || !canRemove
|
28488 |
};
|
28489 |
-
}, [clientId
|
28490 |
}
|
28491 |
|
28492 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/modal.js
|
@@ -28522,7 +28569,7 @@ function BlockLockModal(_ref) {
|
|
28522 |
canEdit,
|
28523 |
canMove,
|
28524 |
canRemove
|
28525 |
-
} = useBlockLock(clientId
|
28526 |
const {
|
28527 |
isReusable
|
28528 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
@@ -28651,7 +28698,7 @@ function BlockLockMenuItem(_ref) {
|
|
28651 |
const {
|
28652 |
canLock,
|
28653 |
isLocked
|
28654 |
-
} = useBlockLock(clientId
|
28655 |
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
|
28656 |
|
28657 |
if (!canLock) {
|
@@ -29436,20 +29483,86 @@ function BlockContextualToolbar(_ref) {
|
|
29436 |
|
29437 |
/* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar);
|
29438 |
|
29439 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-
|
|
|
29440 |
|
29441 |
|
29442 |
/**
|
29443 |
* External dependencies
|
29444 |
*/
|
29445 |
|
29446 |
-
|
29447 |
/**
|
29448 |
* WordPress dependencies
|
29449 |
*/
|
29450 |
|
29451 |
|
29452 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29453 |
|
29454 |
|
29455 |
|
@@ -29465,14 +29578,12 @@ function BlockContextualToolbar(_ref) {
|
|
29465 |
|
29466 |
|
29467 |
|
29468 |
-
|
29469 |
-
function block_popover_selector(select) {
|
29470 |
const {
|
29471 |
isNavigationMode,
|
29472 |
isMultiSelecting,
|
29473 |
hasMultiSelection,
|
29474 |
isTyping,
|
29475 |
-
isCaretWithinFormattedText,
|
29476 |
getSettings,
|
29477 |
getLastMultiSelectedBlockClientId
|
29478 |
} = select(store);
|
@@ -29480,18 +29591,15 @@ function block_popover_selector(select) {
|
|
29480 |
isNavigationMode: isNavigationMode(),
|
29481 |
isMultiSelecting: isMultiSelecting(),
|
29482 |
isTyping: isTyping(),
|
29483 |
-
isCaretWithinFormattedText: isCaretWithinFormattedText(),
|
29484 |
-
hasMultiSelection: hasMultiSelection(),
|
29485 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
29486 |
-
lastClientId: getLastMultiSelectedBlockClientId()
|
29487 |
};
|
29488 |
}
|
29489 |
|
29490 |
-
function
|
29491 |
let {
|
29492 |
clientId,
|
29493 |
rootClientId,
|
29494 |
-
isValid,
|
29495 |
isEmptyDefaultBlock,
|
29496 |
capturingClientId,
|
29497 |
__unstablePopoverSlot,
|
@@ -29501,11 +29609,9 @@ function BlockPopover(_ref) {
|
|
29501 |
isNavigationMode,
|
29502 |
isMultiSelecting,
|
29503 |
isTyping,
|
29504 |
-
isCaretWithinFormattedText,
|
29505 |
-
hasMultiSelection,
|
29506 |
hasFixedToolbar,
|
29507 |
lastClientId
|
29508 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(
|
29509 |
const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
29510 |
const {
|
29511 |
isBlockInsertionPointVisible,
|
@@ -29522,108 +29628,49 @@ function BlockPopover(_ref) {
|
|
29522 |
return order[insertionPoint.index] === clientId;
|
29523 |
}, [clientId]);
|
29524 |
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
|
29525 |
-
const
|
29526 |
const [isInserterShown, setIsInserterShown] = (0,external_wp_element_namespaceObject.useState)(false);
|
29527 |
const {
|
29528 |
stopTyping
|
29529 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
29530 |
-
|
29531 |
-
|
29532 |
-
const showEmptyBlockSideInserter = !isTyping && !isNavigationMode && isEmptyDefaultBlock && isValid;
|
29533 |
const shouldShowBreadcrumb = isNavigationMode;
|
29534 |
-
const shouldShowContextualToolbar = !isNavigationMode && !hasFixedToolbar && isLargeViewport && !
|
29535 |
const canFocusHiddenToolbar = !isNavigationMode && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock;
|
29536 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
29537 |
-
|
29538 |
stopTyping(true);
|
29539 |
}, {
|
29540 |
isDisabled: !canFocusHiddenToolbar
|
29541 |
});
|
29542 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
29543 |
-
|
29544 |
-
|
29545 |
-
}
|
29546 |
-
}, [shouldShowContextualToolbar]); // Stores the active toolbar item index so the block toolbar can return focus
|
29547 |
// to it when re-mounting.
|
29548 |
|
29549 |
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
|
29550 |
-
const selectedElement = useBlockElement(clientId);
|
29551 |
-
const lastSelectedElement = useBlockElement(lastClientId);
|
29552 |
-
const capturingElement = useBlockElement(capturingClientId);
|
29553 |
-
const popoverScrollRef = usePopoverScroll(__unstableContentRef);
|
29554 |
-
|
29555 |
-
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !isToolbarForced && !showEmptyBlockSideInserter) {
|
29556 |
-
return null;
|
29557 |
-
}
|
29558 |
|
29559 |
-
|
29560 |
-
|
29561 |
-
if (!node) {
|
29562 |
return null;
|
29563 |
}
|
29564 |
|
29565 |
-
if (capturingClientId) {
|
29566 |
-
node = capturingElement;
|
29567 |
-
}
|
29568 |
-
|
29569 |
-
let anchorRef = node;
|
29570 |
-
|
29571 |
-
if (hasMultiSelection) {
|
29572 |
-
// Wait to render the popover until the bottom reference is available
|
29573 |
-
// as well.
|
29574 |
-
if (!lastSelectedElement) {
|
29575 |
-
return null;
|
29576 |
-
}
|
29577 |
-
|
29578 |
-
anchorRef = {
|
29579 |
-
top: node,
|
29580 |
-
bottom: lastSelectedElement
|
29581 |
-
};
|
29582 |
-
}
|
29583 |
-
|
29584 |
function onFocus() {
|
29585 |
setIsInserterShown(true);
|
29586 |
}
|
29587 |
|
29588 |
function onBlur() {
|
29589 |
setIsInserterShown(false);
|
29590 |
-
}
|
29591 |
-
// left corner. For the side inserter, pop out towards the left, and
|
29592 |
-
// position in the right corner.
|
29593 |
-
// To do: refactor `Popover` to make this prop clearer.
|
29594 |
-
|
29595 |
|
29596 |
-
|
29597 |
-
|
29598 |
-
|
29599 |
-
} = node;
|
29600 |
-
const stickyBoundaryElement = showEmptyBlockSideInserter ? undefined : // The sticky boundary element should be the boundary at which the
|
29601 |
-
// the block toolbar becomes sticky when the block scolls out of view.
|
29602 |
-
// In case of an iframe, this should be the iframe boundary, otherwise
|
29603 |
-
// the scroll container.
|
29604 |
-
ownerDocument.defaultView.frameElement || (0,external_wp_dom_namespaceObject.getScrollContainer)(node) || ownerDocument.body;
|
29605 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
|
29606 |
-
ref: popoverScrollRef,
|
29607 |
-
noArrow: true,
|
29608 |
-
animate: false,
|
29609 |
-
position: popoverPosition,
|
29610 |
-
focusOnMount: false,
|
29611 |
-
anchorRef: anchorRef,
|
29612 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
29613 |
'is-insertion-point-visible': isInsertionPointVisible
|
29614 |
}),
|
29615 |
-
|
29616 |
-
|
29617 |
-
|
29618 |
-
__unstableSlotName: __unstablePopoverSlot || null,
|
29619 |
-
__unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
|
29620 |
-
,
|
29621 |
-
__unstableObserveElement: node,
|
29622 |
-
shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
|
29623 |
-
// obscure specific sections of a block.
|
29624 |
-
,
|
29625 |
-
__unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
|
29626 |
-
}, (shouldShowContextualToolbar || isToolbarForced) && (0,external_wp_element_namespaceObject.createElement)("div", {
|
29627 |
onFocus: onFocus,
|
29628 |
onBlur: onBlur // While ideally it would be enough to capture the
|
29629 |
// bubbling focus event from the Inserter, due to the
|
@@ -29640,10 +29687,10 @@ function BlockPopover(_ref) {
|
|
29640 |
clientId: clientId,
|
29641 |
rootClientId: rootClientId,
|
29642 |
__experimentalIsQuick: true
|
29643 |
-
})),
|
29644 |
// it should focus the toolbar right after the mount.
|
29645 |
, {
|
29646 |
-
focusOnMount: isToolbarForced,
|
29647 |
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
|
29648 |
__experimentalOnIndexChange: index => {
|
29649 |
initialToolbarItemIndexRef.current = index;
|
@@ -29653,16 +29700,8 @@ function BlockPopover(_ref) {
|
|
29653 |
key: clientId
|
29654 |
}), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, {
|
29655 |
clientId: clientId,
|
29656 |
-
rootClientId: rootClientId
|
29657 |
-
|
29658 |
-
}), showEmptyBlockSideInserter && (0,external_wp_element_namespaceObject.createElement)("div", {
|
29659 |
-
className: "block-editor-block-list__empty-block-inserter"
|
29660 |
-
}, (0,external_wp_element_namespaceObject.createElement)(inserter, {
|
29661 |
-
position: "bottom right",
|
29662 |
-
rootClientId: rootClientId,
|
29663 |
-
clientId: clientId,
|
29664 |
-
__experimentalIsQuick: true
|
29665 |
-
})));
|
29666 |
}
|
29667 |
|
29668 |
function wrapperSelector(select) {
|
@@ -29682,8 +29721,7 @@ function wrapperSelector(select) {
|
|
29682 |
|
29683 |
const {
|
29684 |
name,
|
29685 |
-
attributes = {}
|
29686 |
-
isValid
|
29687 |
} = getBlock(clientId) || {};
|
29688 |
const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId.
|
29689 |
|
@@ -29699,7 +29737,6 @@ function wrapperSelector(select) {
|
|
29699 |
clientId,
|
29700 |
rootClientId: getBlockRootClientId(clientId),
|
29701 |
name,
|
29702 |
-
isValid,
|
29703 |
isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({
|
29704 |
name,
|
29705 |
attributes
|
@@ -29723,7 +29760,6 @@ function WrappedBlockPopover(_ref2) {
|
|
29723 |
clientId,
|
29724 |
rootClientId,
|
29725 |
name,
|
29726 |
-
isValid,
|
29727 |
isEmptyDefaultBlock,
|
29728 |
capturingClientId
|
29729 |
} = selected;
|
@@ -29732,10 +29768,9 @@ function WrappedBlockPopover(_ref2) {
|
|
29732 |
return null;
|
29733 |
}
|
29734 |
|
29735 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
29736 |
clientId: clientId,
|
29737 |
rootClientId: rootClientId,
|
29738 |
-
isValid: isValid,
|
29739 |
isEmptyDefaultBlock: isEmptyDefaultBlock,
|
29740 |
capturingClientId: capturingClientId,
|
29741 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
@@ -29762,7 +29797,7 @@ function BlockToolsBackCompat(_ref) {
|
|
29762 |
let {
|
29763 |
children
|
29764 |
} = _ref;
|
29765 |
-
const openRef = (0,external_wp_element_namespaceObject.useContext)(
|
29766 |
const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // If context is set, `BlockTools` is a parent component.
|
29767 |
|
29768 |
if (openRef || isDisabled) {
|
@@ -30817,127 +30852,123 @@ function BlockListItems(props) {
|
|
30817 |
}, (0,external_wp_element_namespaceObject.createElement)(Items, props));
|
30818 |
}
|
30819 |
|
30820 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/
|
30821 |
-
|
30822 |
-
|
30823 |
-
|
30824 |
/**
|
30825 |
-
*
|
30826 |
*/
|
30827 |
|
30828 |
-
|
30829 |
/**
|
30830 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30831 |
*/
|
30832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30833 |
|
|
|
|
|
30834 |
|
|
|
|
|
|
|
|
|
30835 |
|
|
|
|
|
|
|
|
|
|
|
|
|
30836 |
/**
|
30837 |
-
*
|
|
|
|
|
|
|
30838 |
*/
|
30839 |
|
|
|
|
|
30840 |
|
30841 |
-
|
30842 |
-
|
30843 |
-
|
30844 |
-
|
30845 |
-
|
30846 |
-
|
30847 |
-
|
30848 |
-
disableCustomGradients,
|
30849 |
-
__experimentalHasMultipleOrigins,
|
30850 |
-
__experimentalIsRenderedInSidebar,
|
30851 |
-
className,
|
30852 |
-
label,
|
30853 |
-
onColorChange,
|
30854 |
-
onGradientChange,
|
30855 |
-
colorValue,
|
30856 |
-
gradientValue,
|
30857 |
-
clearable,
|
30858 |
-
showTitle = true,
|
30859 |
-
enableAlpha
|
30860 |
-
} = _ref;
|
30861 |
-
const canChooseAColor = onColorChange && (!(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors);
|
30862 |
-
const canChooseAGradient = onGradientChange && (!(0,external_lodash_namespaceObject.isEmpty)(gradients) || !disableCustomGradients);
|
30863 |
-
const [currentTab, setCurrentTab] = (0,external_wp_element_namespaceObject.useState)(gradientValue ? 'gradient' : !!canChooseAColor && 'color');
|
30864 |
-
|
30865 |
-
if (!canChooseAColor && !canChooseAGradient) {
|
30866 |
-
return null;
|
30867 |
}
|
30868 |
|
30869 |
-
|
30870 |
-
|
30871 |
-
|
30872 |
-
|
30873 |
-
|
30874 |
-
|
30875 |
-
|
30876 |
-
|
30877 |
-
|
30878 |
-
|
30879 |
-
|
30880 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Select color type'),
|
30881 |
-
hideLabelFromVision: true,
|
30882 |
-
isBlock: true
|
30883 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
|
30884 |
-
value: "color",
|
30885 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Solid')
|
30886 |
-
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
|
30887 |
-
value: "gradient",
|
30888 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Gradient')
|
30889 |
-
})), (currentTab === 'color' || !canChooseAGradient) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorPalette, {
|
30890 |
-
value: colorValue,
|
30891 |
-
onChange: canChooseAGradient ? newColor => {
|
30892 |
-
onColorChange(newColor);
|
30893 |
-
onGradientChange();
|
30894 |
-
} : onColorChange,
|
30895 |
-
colors,
|
30896 |
-
disableCustomColors,
|
30897 |
-
__experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
|
30898 |
-
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
30899 |
-
clearable: clearable,
|
30900 |
-
enableAlpha: enableAlpha
|
30901 |
-
}), (currentTab === 'gradient' || !canChooseAColor) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.GradientPicker, {
|
30902 |
-
value: gradientValue,
|
30903 |
-
onChange: canChooseAColor ? newGradient => {
|
30904 |
-
onGradientChange(newGradient);
|
30905 |
-
onColorChange();
|
30906 |
-
} : onGradientChange,
|
30907 |
-
gradients,
|
30908 |
-
disableCustomGradients,
|
30909 |
-
__experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
|
30910 |
-
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
30911 |
-
clearable: clearable
|
30912 |
-
}))));
|
30913 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
30914 |
|
30915 |
-
function
|
30916 |
-
|
30917 |
-
|
30918 |
-
|
30919 |
-
|
30920 |
-
colorGradientSettings.disableCustomGradients = !useSetting('color.customGradient');
|
30921 |
-
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, _extends({}, colorGradientSettings, props));
|
30922 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
30923 |
|
30924 |
-
function
|
30925 |
-
if (
|
30926 |
-
return
|
30927 |
-
}
|
30928 |
|
30929 |
-
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlSelect, props);
|
30930 |
-
}
|
30931 |
|
30932 |
-
|
|
|
|
|
|
|
30933 |
|
30934 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/dropdown.js
|
30935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30936 |
|
30937 |
|
30938 |
-
/**
|
30939 |
-
* External dependencies
|
30940 |
-
*/
|
30941 |
|
30942 |
/**
|
30943 |
* WordPress dependencies
|
@@ -30949,765 +30980,116 @@ function ColorGradientControl(props) {
|
|
30949 |
*/
|
30950 |
|
30951 |
|
30952 |
-
function
|
30953 |
let {
|
30954 |
-
|
30955 |
-
|
30956 |
-
|
30957 |
-
disableCustomGradients,
|
30958 |
-
__experimentalHasMultipleOrigins,
|
30959 |
-
__experimentalIsRenderedInSidebar,
|
30960 |
-
enableAlpha,
|
30961 |
-
settings
|
30962 |
} = _ref;
|
30963 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30964 |
|
30965 |
-
|
30966 |
-
dropdownPosition = 'bottom left';
|
30967 |
-
}
|
30968 |
|
30969 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
|
30970 |
-
isBordered: true,
|
30971 |
-
isSeparated: true,
|
30972 |
-
className: "block-editor-panel-color-gradient-settings__item-group"
|
30973 |
-
}, settings.map((setting, index) => setting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
30974 |
-
key: index,
|
30975 |
-
position: dropdownPosition,
|
30976 |
-
className: "block-editor-panel-color-gradient-settings__dropdown",
|
30977 |
-
contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content",
|
30978 |
-
renderToggle: _ref2 => {
|
30979 |
-
var _setting$gradientValu;
|
30980 |
|
30981 |
-
let {
|
30982 |
-
isOpen,
|
30983 |
-
onToggle
|
30984 |
-
} = _ref2;
|
30985 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, {
|
30986 |
-
onClick: onToggle,
|
30987 |
-
className: classnames_default()('block-editor-panel-color-gradient-settings__item', {
|
30988 |
-
'is-open': isOpen
|
30989 |
-
})
|
30990 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
30991 |
-
justify: "flex-start"
|
30992 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
30993 |
-
className: "block-editor-panel-color-gradient-settings__color-indicator",
|
30994 |
-
colorValue: (_setting$gradientValu = setting.gradientValue) !== null && _setting$gradientValu !== void 0 ? _setting$gradientValu : setting.colorValue
|
30995 |
-
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, setting.label)));
|
30996 |
-
},
|
30997 |
-
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(control, _extends({
|
30998 |
-
showTitle: false,
|
30999 |
-
colors,
|
31000 |
-
gradients,
|
31001 |
-
disableCustomColors,
|
31002 |
-
disableCustomGradients,
|
31003 |
-
__experimentalHasMultipleOrigins,
|
31004 |
-
__experimentalIsRenderedInSidebar,
|
31005 |
-
enableAlpha
|
31006 |
-
}, setting))
|
31007 |
-
})));
|
31008 |
-
}
|
31009 |
|
31010 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js
|
31011 |
/**
|
31012 |
-
*
|
31013 |
*/
|
31014 |
|
31015 |
-
|
31016 |
-
|
31017 |
-
|
31018 |
-
|
31019 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31020 |
}
|
31021 |
|
31022 |
-
;// CONCATENATED MODULE: ./packages/
|
31023 |
-
/**
|
31024 |
-
* WordPress dependencies
|
31025 |
-
*/
|
31026 |
|
31027 |
|
31028 |
/**
|
31029 |
-
*
|
31030 |
*/
|
31031 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31032 |
|
31033 |
|
31034 |
/**
|
31035 |
-
*
|
31036 |
-
*
|
31037 |
-
* The arrays for colors and gradients are made up of color palettes from each
|
31038 |
-
* origin i.e. "Core", "Theme", and "User".
|
31039 |
-
*
|
31040 |
-
* @return {Object} Color and gradient related settings.
|
31041 |
*/
|
31042 |
|
31043 |
-
|
31044 |
-
|
31045 |
-
|
31046 |
-
|
31047 |
-
|
31048 |
-
|
31049 |
-
|
31050 |
-
const result = [];
|
31051 |
|
31052 |
-
|
31053 |
-
result.push({
|
31054 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
|
31055 |
-
colors: themeColors
|
31056 |
-
});
|
31057 |
-
}
|
31058 |
|
31059 |
-
if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
|
31060 |
-
result.push({
|
31061 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
|
31062 |
-
colors: defaultColors
|
31063 |
-
});
|
31064 |
-
}
|
31065 |
|
31066 |
-
if (customColors && customColors.length) {
|
31067 |
-
result.push({
|
31068 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette comes from the theme.'),
|
31069 |
-
colors: customColors
|
31070 |
-
});
|
31071 |
-
}
|
31072 |
|
31073 |
-
|
31074 |
-
|
31075 |
-
|
31076 |
-
const themeGradients = useSetting('color.gradients.theme');
|
31077 |
-
const defaultGradients = useSetting('color.gradients.default');
|
31078 |
-
const shouldDisplayDefaultGradients = useSetting('color.defaultGradients');
|
31079 |
-
colorGradientSettings.gradients = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
31080 |
-
const result = [];
|
31081 |
-
|
31082 |
-
if (themeGradients && themeGradients.length) {
|
31083 |
-
result.push({
|
31084 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
|
31085 |
-
gradients: themeGradients
|
31086 |
-
});
|
31087 |
-
}
|
31088 |
-
|
31089 |
-
if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) {
|
31090 |
-
result.push({
|
31091 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
|
31092 |
-
gradients: defaultGradients
|
31093 |
-
});
|
31094 |
-
}
|
31095 |
-
|
31096 |
-
if (customGradients && customGradients.length) {
|
31097 |
-
result.push({
|
31098 |
-
name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'),
|
31099 |
-
gradients: customGradients
|
31100 |
-
});
|
31101 |
-
}
|
31102 |
-
|
31103 |
-
return result;
|
31104 |
-
}, [customGradients, themeGradients, defaultGradients]);
|
31105 |
-
return colorGradientSettings;
|
31106 |
-
}
|
31107 |
-
|
31108 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/utils.js
|
31109 |
-
/**
|
31110 |
-
* External dependencies
|
31111 |
-
*/
|
31112 |
-
|
31113 |
-
|
31114 |
-
|
31115 |
-
|
31116 |
-
k([names, a11y]);
|
31117 |
-
/**
|
31118 |
-
* Provided an array of color objects as set by the theme or by the editor defaults,
|
31119 |
-
* and the values of the defined color or custom color returns a color object describing the color.
|
31120 |
-
*
|
31121 |
-
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31122 |
-
* @param {?string} definedColor A string containing the color slug.
|
31123 |
-
* @param {?string} customColor A string containing the customColor value.
|
31124 |
-
*
|
31125 |
-
* @return {?Object} If definedColor is passed and the name is found in colors,
|
31126 |
-
* the color object exactly as set by the theme or editor defaults is returned.
|
31127 |
-
* Otherwise, an object that just sets the color is defined.
|
31128 |
-
*/
|
31129 |
-
|
31130 |
-
const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
|
31131 |
-
if (definedColor) {
|
31132 |
-
const colorObj = (0,external_lodash_namespaceObject.find)(colors, {
|
31133 |
-
slug: definedColor
|
31134 |
-
});
|
31135 |
-
|
31136 |
-
if (colorObj) {
|
31137 |
-
return colorObj;
|
31138 |
-
}
|
31139 |
-
}
|
31140 |
-
|
31141 |
-
return {
|
31142 |
-
color: customColor
|
31143 |
-
};
|
31144 |
-
};
|
31145 |
-
/**
|
31146 |
-
* Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.
|
31147 |
-
*
|
31148 |
-
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31149 |
-
* @param {?string} colorValue A string containing the color value.
|
31150 |
-
*
|
31151 |
-
* @return {?Object} Color object included in the colors array whose color property equals colorValue.
|
31152 |
-
* Returns undefined if no color object matches this requirement.
|
31153 |
-
*/
|
31154 |
-
|
31155 |
-
const getColorObjectByColorValue = (colors, colorValue) => {
|
31156 |
-
return (0,external_lodash_namespaceObject.find)(colors, {
|
31157 |
-
color: colorValue
|
31158 |
-
});
|
31159 |
-
};
|
31160 |
-
/**
|
31161 |
-
* Returns a class based on the context a color is being used and its slug.
|
31162 |
-
*
|
31163 |
-
* @param {string} colorContextName Context/place where color is being used e.g: background, text etc...
|
31164 |
-
* @param {string} colorSlug Slug of the color.
|
31165 |
-
*
|
31166 |
-
* @return {?string} String with the class corresponding to the color in the provided context.
|
31167 |
-
* Returns undefined if either colorContextName or colorSlug are not provided.
|
31168 |
-
*/
|
31169 |
-
|
31170 |
-
function getColorClassName(colorContextName, colorSlug) {
|
31171 |
-
if (!colorContextName || !colorSlug) {
|
31172 |
-
return undefined;
|
31173 |
-
}
|
31174 |
-
|
31175 |
-
return `has-${(0,external_lodash_namespaceObject.kebabCase)(colorSlug)}-${colorContextName}`;
|
31176 |
-
}
|
31177 |
-
/**
|
31178 |
-
* Given an array of color objects and a color value returns the color value of the most readable color in the array.
|
31179 |
-
*
|
31180 |
-
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31181 |
-
* @param {?string} colorValue A string containing the color value.
|
31182 |
-
*
|
31183 |
-
* @return {string} String with the color value of the most readable color.
|
31184 |
-
*/
|
31185 |
-
|
31186 |
-
function getMostReadableColor(colors, colorValue) {
|
31187 |
-
const colordColor = w(colorValue);
|
31188 |
-
return (0,external_lodash_namespaceObject.maxBy)(colors, _ref => {
|
31189 |
-
let {
|
31190 |
-
color
|
31191 |
-
} = _ref;
|
31192 |
-
return colordColor.contrast(color);
|
31193 |
-
}).color;
|
31194 |
-
}
|
31195 |
-
|
31196 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/border-color.js
|
31197 |
-
|
31198 |
-
|
31199 |
-
|
31200 |
-
/**
|
31201 |
-
* External dependencies
|
31202 |
-
*/
|
31203 |
-
|
31204 |
-
/**
|
31205 |
-
* WordPress dependencies
|
31206 |
-
*/
|
31207 |
-
|
31208 |
-
|
31209 |
-
|
31210 |
-
|
31211 |
-
|
31212 |
-
/**
|
31213 |
-
* Internal dependencies
|
31214 |
-
*/
|
31215 |
-
|
31216 |
-
|
31217 |
-
|
31218 |
-
|
31219 |
-
|
31220 |
-
|
31221 |
-
// Defining empty array here instead of inline avoids unnecessary re-renders of
|
31222 |
-
// color control.
|
31223 |
-
|
31224 |
-
const border_color_EMPTY_ARRAY = [];
|
31225 |
-
/**
|
31226 |
-
* Inspector control panel containing the border color related configuration.
|
31227 |
-
*
|
31228 |
-
* There is deliberate overlap between the colors and borders block supports
|
31229 |
-
* relating to border color. It can be argued the border color controls could
|
31230 |
-
* be included within either, or both, the colors and borders panels in the
|
31231 |
-
* inspector controls. If they share the same block attributes it should not
|
31232 |
-
* matter.
|
31233 |
-
*
|
31234 |
-
* @param {Object} props Block properties.
|
31235 |
-
*
|
31236 |
-
* @return {WPElement} Border color edit element.
|
31237 |
-
*/
|
31238 |
-
|
31239 |
-
function BorderColorEdit(props) {
|
31240 |
-
const {
|
31241 |
-
attributes: {
|
31242 |
-
borderColor,
|
31243 |
-
style
|
31244 |
-
},
|
31245 |
-
setAttributes
|
31246 |
-
} = props;
|
31247 |
-
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
31248 |
-
const availableColors = colorGradientSettings.colors.reduce((colors, origin) => colors.concat(origin.colors), []);
|
31249 |
-
const {
|
31250 |
-
color: customBorderColor
|
31251 |
-
} = (style === null || style === void 0 ? void 0 : style.border) || {};
|
31252 |
-
const [colorValue, setColorValue] = (0,external_wp_element_namespaceObject.useState)(() => {
|
31253 |
-
var _getColorObjectByAttr;
|
31254 |
-
|
31255 |
-
return (_getColorObjectByAttr = getColorObjectByAttributeValues(availableColors, borderColor, customBorderColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
|
31256 |
-
}); // Detect changes in the color attributes and update the colorValue to keep the
|
31257 |
-
// UI in sync. This is necessary for situations when border controls interact with
|
31258 |
-
// each other: eg, setting the border width to zero causes the color and style
|
31259 |
-
// selections to be cleared.
|
31260 |
-
|
31261 |
-
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
31262 |
-
var _getColorObjectByAttr2;
|
31263 |
-
|
31264 |
-
setColorValue((_getColorObjectByAttr2 = getColorObjectByAttributeValues(availableColors, borderColor, customBorderColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color);
|
31265 |
-
}, [borderColor, customBorderColor, availableColors]);
|
31266 |
-
|
31267 |
-
const onChangeColor = value => {
|
31268 |
-
setColorValue(value);
|
31269 |
-
const colorObject = getColorObjectByColorValue(availableColors, value);
|
31270 |
-
const newStyle = { ...style,
|
31271 |
-
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
31272 |
-
color: colorObject !== null && colorObject !== void 0 && colorObject.slug ? undefined : value
|
31273 |
-
}
|
31274 |
-
}; // If empty slug, ensure undefined to remove attribute.
|
31275 |
-
|
31276 |
-
const newNamedColor = colorObject !== null && colorObject !== void 0 && colorObject.slug ? colorObject.slug : undefined;
|
31277 |
-
setAttributes({
|
31278 |
-
style: cleanEmptyObject(newStyle),
|
31279 |
-
borderColor: newNamedColor
|
31280 |
-
});
|
31281 |
-
};
|
31282 |
-
|
31283 |
-
const settings = [{
|
31284 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Color'),
|
31285 |
-
onColorChange: onChangeColor,
|
31286 |
-
colorValue,
|
31287 |
-
clearable: false
|
31288 |
-
}];
|
31289 |
-
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, _extends({
|
31290 |
-
settings: settings,
|
31291 |
-
disableCustomColors: true,
|
31292 |
-
disableCustomGradients: true,
|
31293 |
-
__experimentalHasMultipleOrigins: true,
|
31294 |
-
__experimentalIsRenderedInSidebar: true,
|
31295 |
-
enableAlpha: true
|
31296 |
-
}, colorGradientSettings));
|
31297 |
-
}
|
31298 |
-
/**
|
31299 |
-
* Checks if there is a current value in the border color block support
|
31300 |
-
* attributes.
|
31301 |
-
*
|
31302 |
-
* @param {Object} props Block props.
|
31303 |
-
* @return {boolean} Whether or not the block has a border color value set.
|
31304 |
-
*/
|
31305 |
-
|
31306 |
-
function hasBorderColorValue(props) {
|
31307 |
-
var _style$border;
|
31308 |
-
|
31309 |
-
const {
|
31310 |
-
attributes: {
|
31311 |
-
borderColor,
|
31312 |
-
style
|
31313 |
-
}
|
31314 |
-
} = props;
|
31315 |
-
return !!borderColor || !!(style !== null && style !== void 0 && (_style$border = style.border) !== null && _style$border !== void 0 && _style$border.color);
|
31316 |
-
}
|
31317 |
-
/**
|
31318 |
-
* Resets the border color block support attributes. This can be used when
|
31319 |
-
* disabling the border color support controls for a block via a progressive
|
31320 |
-
* discovery panel.
|
31321 |
-
*
|
31322 |
-
* @param {Object} props Block props.
|
31323 |
-
* @param {Object} props.attributes Block's attributes.
|
31324 |
-
* @param {Object} props.setAttributes Function to set block's attributes.
|
31325 |
-
*/
|
31326 |
-
|
31327 |
-
function resetBorderColor(_ref) {
|
31328 |
-
let {
|
31329 |
-
attributes = {},
|
31330 |
-
setAttributes
|
31331 |
-
} = _ref;
|
31332 |
-
const {
|
31333 |
-
style
|
31334 |
-
} = attributes;
|
31335 |
-
setAttributes({
|
31336 |
-
borderColor: undefined,
|
31337 |
-
style: removeBorderAttribute(style, 'color')
|
31338 |
-
});
|
31339 |
-
}
|
31340 |
-
/**
|
31341 |
-
* Filters registered block settings, extending attributes to include
|
31342 |
-
* `borderColor` if needed.
|
31343 |
-
*
|
31344 |
-
* @param {Object} settings Original block settings.
|
31345 |
-
*
|
31346 |
-
* @return {Object} Updated block settings.
|
31347 |
-
*/
|
31348 |
-
|
31349 |
-
function addAttributes(settings) {
|
31350 |
-
if (!hasBorderSupport(settings, 'color')) {
|
31351 |
-
return settings;
|
31352 |
-
} // Allow blocks to specify default value if needed.
|
31353 |
-
|
31354 |
-
|
31355 |
-
if (settings.attributes.borderColor) {
|
31356 |
-
return settings;
|
31357 |
-
} // Add new borderColor attribute to block settings.
|
31358 |
-
|
31359 |
-
|
31360 |
-
return { ...settings,
|
31361 |
-
attributes: { ...settings.attributes,
|
31362 |
-
borderColor: {
|
31363 |
-
type: 'string'
|
31364 |
-
}
|
31365 |
-
}
|
31366 |
-
};
|
31367 |
-
}
|
31368 |
-
/**
|
31369 |
-
* Override props assigned to save component to inject border color.
|
31370 |
-
*
|
31371 |
-
* @param {Object} props Additional props applied to save element.
|
31372 |
-
* @param {Object} blockType Block type definition.
|
31373 |
-
* @param {Object} attributes Block's attributes.
|
31374 |
-
*
|
31375 |
-
* @return {Object} Filtered props to apply to save element.
|
31376 |
-
*/
|
31377 |
-
|
31378 |
-
|
31379 |
-
function border_color_addSaveProps(props, blockType, attributes) {
|
31380 |
-
var _style$border2;
|
31381 |
-
|
31382 |
-
if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType, BORDER_SUPPORT_KEY, 'color')) {
|
31383 |
-
return props;
|
31384 |
-
}
|
31385 |
-
|
31386 |
-
const {
|
31387 |
-
borderColor,
|
31388 |
-
style
|
31389 |
-
} = attributes;
|
31390 |
-
const borderColorClass = getColorClassName('border-color', borderColor);
|
31391 |
-
const newClassName = classnames_default()(props.className, {
|
31392 |
-
'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color),
|
31393 |
-
[borderColorClass]: !!borderColorClass
|
31394 |
-
}); // If we are clearing the last of the previous classes in `className`
|
31395 |
-
// set it to `undefined` to avoid rendering empty DOM attributes.
|
31396 |
-
|
31397 |
-
props.className = newClassName ? newClassName : undefined;
|
31398 |
-
return props;
|
31399 |
-
}
|
31400 |
-
/**
|
31401 |
-
* Filters the registered block settings to apply border color styles and
|
31402 |
-
* classnames to the block edit wrapper.
|
31403 |
-
*
|
31404 |
-
* @param {Object} settings Original block settings.
|
31405 |
-
*
|
31406 |
-
* @return {Object} Filtered block settings.
|
31407 |
-
*/
|
31408 |
-
|
31409 |
-
|
31410 |
-
function addEditProps(settings) {
|
31411 |
-
if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings, BORDER_SUPPORT_KEY, 'color')) {
|
31412 |
-
return settings;
|
31413 |
-
}
|
31414 |
-
|
31415 |
-
const existingGetEditWrapperProps = settings.getEditWrapperProps;
|
31416 |
-
|
31417 |
-
settings.getEditWrapperProps = attributes => {
|
31418 |
-
let props = {};
|
31419 |
-
|
31420 |
-
if (existingGetEditWrapperProps) {
|
31421 |
-
props = existingGetEditWrapperProps(attributes);
|
31422 |
-
}
|
31423 |
-
|
31424 |
-
return border_color_addSaveProps(props, settings, attributes);
|
31425 |
-
};
|
31426 |
-
|
31427 |
-
return settings;
|
31428 |
-
}
|
31429 |
-
/**
|
31430 |
-
* This adds inline styles for color palette colors.
|
31431 |
-
* Ideally, this is not needed and themes should load their palettes on the editor.
|
31432 |
-
*
|
31433 |
-
* @param {Function} BlockListBlock Original component.
|
31434 |
-
*
|
31435 |
-
* @return {Function} Wrapped component.
|
31436 |
-
*/
|
31437 |
-
|
31438 |
-
|
31439 |
-
const withBorderColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
|
31440 |
-
var _getColorObjectByAttr3, _props$wrapperProps;
|
31441 |
-
|
31442 |
-
const {
|
31443 |
-
name,
|
31444 |
-
attributes
|
31445 |
-
} = props;
|
31446 |
-
const {
|
31447 |
-
borderColor
|
31448 |
-
} = attributes;
|
31449 |
-
const colors = useSetting('color.palette') || border_color_EMPTY_ARRAY;
|
31450 |
-
|
31451 |
-
if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name, BORDER_SUPPORT_KEY, 'color')) {
|
31452 |
-
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
|
31453 |
-
}
|
31454 |
-
|
31455 |
-
const extraStyles = {
|
31456 |
-
borderColor: borderColor ? (_getColorObjectByAttr3 = getColorObjectByAttributeValues(colors, borderColor)) === null || _getColorObjectByAttr3 === void 0 ? void 0 : _getColorObjectByAttr3.color : undefined
|
31457 |
-
};
|
31458 |
-
let wrapperProps = props.wrapperProps;
|
31459 |
-
wrapperProps = { ...props.wrapperProps,
|
31460 |
-
style: { ...extraStyles,
|
31461 |
-
...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style)
|
31462 |
-
}
|
31463 |
-
};
|
31464 |
-
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
|
31465 |
-
wrapperProps: wrapperProps
|
31466 |
-
}));
|
31467 |
-
});
|
31468 |
-
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addAttributes', addAttributes);
|
31469 |
-
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/border/addSaveProps', border_color_addSaveProps);
|
31470 |
-
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addEditProps', addEditProps);
|
31471 |
-
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/border/with-border-color-palette-styles', withBorderColorPaletteStyles);
|
31472 |
-
|
31473 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/utils.js
|
31474 |
-
/**
|
31475 |
-
* WordPress dependencies
|
31476 |
-
*/
|
31477 |
-
|
31478 |
-
/**
|
31479 |
-
* Gets the (non-undefined) item with the highest occurrence within an array
|
31480 |
-
* Based in part on: https://stackoverflow.com/a/20762713
|
31481 |
-
*
|
31482 |
-
* Undefined values are always sorted to the end by `sort`, so this function
|
31483 |
-
* returns the first element, to always prioritize real values over undefined
|
31484 |
-
* values.
|
31485 |
-
*
|
31486 |
-
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description
|
31487 |
-
*
|
31488 |
-
* @param {Array<any>} inputArray Array of items to check.
|
31489 |
-
* @return {any} The item with the most occurrences.
|
31490 |
-
*/
|
31491 |
-
|
31492 |
-
function mode(inputArray) {
|
31493 |
-
const arr = [...inputArray];
|
31494 |
-
return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift();
|
31495 |
-
}
|
31496 |
-
/**
|
31497 |
-
* Returns the most common CSS unit in the radius values.
|
31498 |
-
* Falls back to `px` as a default unit.
|
31499 |
-
*
|
31500 |
-
* @param {Object|string} values Radius values.
|
31501 |
-
* @return {string} Most common CSS unit in values. Default: `px`.
|
31502 |
-
*/
|
31503 |
-
|
31504 |
-
function getAllUnit() {
|
31505 |
-
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
31506 |
-
|
31507 |
-
if (typeof values === 'string') {
|
31508 |
-
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values);
|
31509 |
-
return unit || 'px';
|
31510 |
-
}
|
31511 |
-
|
31512 |
-
const allUnits = Object.values(values).map(value => {
|
31513 |
-
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
|
31514 |
-
return unit;
|
31515 |
-
});
|
31516 |
-
return mode(allUnits) || 'px';
|
31517 |
-
}
|
31518 |
-
/**
|
31519 |
-
* Gets the 'all' input value and unit from values data.
|
31520 |
-
*
|
31521 |
-
* @param {Object|string} values Radius values.
|
31522 |
-
* @return {string} A value + unit for the 'all' input.
|
31523 |
-
*/
|
31524 |
-
|
31525 |
-
function getAllValue() {
|
31526 |
-
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
31527 |
-
|
31528 |
-
/**
|
31529 |
-
* Border radius support was originally a single pixel value.
|
31530 |
-
*
|
31531 |
-
* To maintain backwards compatibility treat this case as the all value.
|
31532 |
-
*/
|
31533 |
-
if (typeof values === 'string') {
|
31534 |
-
return values;
|
31535 |
-
}
|
31536 |
-
|
31537 |
-
const parsedQuantitiesAndUnits = Object.values(values).map(value => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value));
|
31538 |
-
const allValues = parsedQuantitiesAndUnits.map(value => {
|
31539 |
-
var _value$;
|
31540 |
-
|
31541 |
-
return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : '';
|
31542 |
-
});
|
31543 |
-
const allUnits = parsedQuantitiesAndUnits.map(value => value[1]);
|
31544 |
-
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
31545 |
-
const unit = mode(allUnits);
|
31546 |
-
const allValue = value === 0 || value ? `${value}${unit}` : undefined;
|
31547 |
-
return allValue;
|
31548 |
-
}
|
31549 |
-
/**
|
31550 |
-
* Checks to determine if values are mixed.
|
31551 |
-
*
|
31552 |
-
* @param {Object} values Radius values.
|
31553 |
-
* @return {boolean} Whether values are mixed.
|
31554 |
-
*/
|
31555 |
-
|
31556 |
-
function hasMixedValues() {
|
31557 |
-
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
31558 |
-
const allValue = getAllValue(values);
|
31559 |
-
const isMixed = typeof values === 'string' ? false : isNaN(parseFloat(allValue));
|
31560 |
-
return isMixed;
|
31561 |
-
}
|
31562 |
-
/**
|
31563 |
-
* Checks to determine if values are defined.
|
31564 |
-
*
|
31565 |
-
* @param {Object} values Radius values.
|
31566 |
-
* @return {boolean} Whether values are mixed.
|
31567 |
-
*/
|
31568 |
-
|
31569 |
-
function hasDefinedValues(values) {
|
31570 |
-
if (!values) {
|
31571 |
-
return false;
|
31572 |
-
} // A string value represents a shorthand value.
|
31573 |
-
|
31574 |
-
|
31575 |
-
if (typeof values === 'string') {
|
31576 |
-
return true;
|
31577 |
-
} // An object represents longhand border radius values, if any are set
|
31578 |
-
// flag values as being defined.
|
31579 |
-
|
31580 |
-
|
31581 |
-
const filteredValues = Object.values(values).filter(value => {
|
31582 |
-
return !!value || value === 0;
|
31583 |
-
});
|
31584 |
-
return !!filteredValues.length;
|
31585 |
-
}
|
31586 |
-
|
31587 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/all-input-control.js
|
31588 |
-
|
31589 |
-
|
31590 |
-
|
31591 |
-
/**
|
31592 |
-
* WordPress dependencies
|
31593 |
-
*/
|
31594 |
-
|
31595 |
-
|
31596 |
-
/**
|
31597 |
-
* Internal dependencies
|
31598 |
-
*/
|
31599 |
-
|
31600 |
-
|
31601 |
-
function AllInputControl(_ref) {
|
31602 |
-
let {
|
31603 |
-
onChange,
|
31604 |
-
values,
|
31605 |
-
...props
|
31606 |
-
} = _ref;
|
31607 |
-
const allValue = getAllValue(values);
|
31608 |
-
const hasValues = hasDefinedValues(values);
|
31609 |
-
const isMixed = hasValues && hasMixedValues(values);
|
31610 |
-
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null;
|
31611 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
31612 |
-
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
31613 |
-
disableUnits: isMixed,
|
31614 |
-
isOnly: true,
|
31615 |
-
value: allValue,
|
31616 |
-
onChange: onChange,
|
31617 |
-
placeholder: allPlaceholder
|
31618 |
-
}));
|
31619 |
-
}
|
31620 |
-
|
31621 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/input-controls.js
|
31622 |
-
|
31623 |
-
|
31624 |
-
|
31625 |
-
/**
|
31626 |
-
* WordPress dependencies
|
31627 |
-
*/
|
31628 |
-
|
31629 |
-
|
31630 |
-
const CORNERS = {
|
31631 |
-
topLeft: (0,external_wp_i18n_namespaceObject.__)('Top left'),
|
31632 |
-
topRight: (0,external_wp_i18n_namespaceObject.__)('Top right'),
|
31633 |
-
bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'),
|
31634 |
-
bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right')
|
31635 |
-
};
|
31636 |
-
function BoxInputControls(_ref) {
|
31637 |
-
let {
|
31638 |
-
onChange,
|
31639 |
-
values: valuesProp,
|
31640 |
-
...props
|
31641 |
-
} = _ref;
|
31642 |
-
|
31643 |
-
const createHandleOnChange = corner => next => {
|
31644 |
-
if (!onChange) {
|
31645 |
-
return;
|
31646 |
-
}
|
31647 |
-
|
31648 |
-
onChange({ ...values,
|
31649 |
-
[corner]: next ? next : undefined
|
31650 |
-
});
|
31651 |
-
}; // For shorthand style & backwards compatibility, handle flat string value.
|
31652 |
-
|
31653 |
-
|
31654 |
-
const values = typeof valuesProp !== 'string' ? valuesProp : {
|
31655 |
-
topLeft: valuesProp,
|
31656 |
-
topRight: valuesProp,
|
31657 |
-
bottomLeft: valuesProp,
|
31658 |
-
bottomRight: valuesProp
|
31659 |
-
}; // Controls are wrapped in tooltips as visible labels aren't desired here.
|
31660 |
-
|
31661 |
-
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
31662 |
-
className: "components-border-radius-control__input-controls-wrapper"
|
31663 |
-
}, Object.entries(CORNERS).map(_ref2 => {
|
31664 |
-
let [key, label] = _ref2;
|
31665 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
31666 |
-
key: key,
|
31667 |
-
"aria-label": label,
|
31668 |
-
value: values[key],
|
31669 |
-
onChange: createHandleOnChange(key)
|
31670 |
-
}));
|
31671 |
-
}));
|
31672 |
-
}
|
31673 |
-
|
31674 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link.js
|
31675 |
-
|
31676 |
-
|
31677 |
-
/**
|
31678 |
-
* WordPress dependencies
|
31679 |
-
*/
|
31680 |
-
|
31681 |
-
const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
31682 |
-
xmlns: "http://www.w3.org/2000/svg",
|
31683 |
-
viewBox: "0 0 24 24"
|
31684 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31685 |
-
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"
|
31686 |
-
}));
|
31687 |
-
/* harmony default export */ var library_link = (link_link);
|
31688 |
-
|
31689 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link-off.js
|
31690 |
-
|
31691 |
-
|
31692 |
-
/**
|
31693 |
-
* WordPress dependencies
|
31694 |
-
*/
|
31695 |
-
|
31696 |
-
const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
31697 |
-
xmlns: "http://www.w3.org/2000/svg",
|
31698 |
-
viewBox: "0 0 24 24"
|
31699 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31700 |
-
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"
|
31701 |
-
}));
|
31702 |
-
/* harmony default export */ var link_off = (linkOff);
|
31703 |
-
|
31704 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/linked-button.js
|
31705 |
-
|
31706 |
-
|
31707 |
-
|
31708 |
-
/**
|
31709 |
-
* WordPress dependencies
|
31710 |
-
*/
|
31711 |
|
31712 |
|
31713 |
|
@@ -31910,113 +31292,110 @@ function resetBorderRadius(_ref) {
|
|
31910 |
});
|
31911 |
}
|
31912 |
|
31913 |
-
;// CONCATENATED MODULE: ./packages/
|
31914 |
-
|
31915 |
-
|
31916 |
/**
|
31917 |
-
*
|
31918 |
*/
|
31919 |
|
31920 |
-
const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
31921 |
-
xmlns: "http://www.w3.org/2000/svg",
|
31922 |
-
width: "24",
|
31923 |
-
height: "24",
|
31924 |
-
fill: "none"
|
31925 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31926 |
-
d: "M5 11.25h14v1.5H5z"
|
31927 |
-
}));
|
31928 |
-
/* harmony default export */ var line_solid = (lineSolid);
|
31929 |
|
31930 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dashed.js
|
31931 |
|
31932 |
|
|
|
31933 |
/**
|
31934 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31935 |
*/
|
31936 |
|
31937 |
-
const
|
31938 |
-
|
31939 |
-
|
31940 |
-
|
31941 |
-
|
31942 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31943 |
-
fillRule: "evenodd",
|
31944 |
-
d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",
|
31945 |
-
clipRule: "evenodd"
|
31946 |
-
}));
|
31947 |
-
/* harmony default export */ var line_dashed = (lineDashed);
|
31948 |
-
|
31949 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dotted.js
|
31950 |
|
|
|
|
|
|
|
|
|
31951 |
|
|
|
|
|
|
|
|
|
31952 |
/**
|
31953 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
31954 |
*/
|
31955 |
|
31956 |
-
const
|
31957 |
-
|
31958 |
-
|
31959 |
-
|
31960 |
-
|
31961 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31962 |
-
fillRule: "evenodd",
|
31963 |
-
d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",
|
31964 |
-
clipRule: "evenodd"
|
31965 |
-
}));
|
31966 |
-
/* harmony default export */ var line_dotted = (lineDotted);
|
31967 |
-
|
31968 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-style-control/index.js
|
31969 |
-
|
31970 |
-
|
31971 |
/**
|
31972 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
31973 |
*/
|
31974 |
|
|
|
|
|
|
|
|
|
31975 |
|
31976 |
-
|
31977 |
-
|
31978 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Solid'),
|
31979 |
-
icon: line_solid,
|
31980 |
-
value: 'solid'
|
31981 |
-
}, {
|
31982 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Dashed'),
|
31983 |
-
icon: line_dashed,
|
31984 |
-
value: 'dashed'
|
31985 |
-
}, {
|
31986 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Dotted'),
|
31987 |
-
icon: line_dotted,
|
31988 |
-
value: 'dotted'
|
31989 |
-
}];
|
31990 |
/**
|
31991 |
-
*
|
31992 |
*
|
31993 |
-
* @param {
|
31994 |
-
* @param {
|
31995 |
-
* @param {string} props.value Currently selected border style value.
|
31996 |
*
|
31997 |
-
* @return {
|
31998 |
*/
|
31999 |
|
32000 |
-
function
|
32001 |
-
|
32002 |
-
|
32003 |
-
|
32004 |
-
|
32005 |
-
|
32006 |
-
|
32007 |
-
}
|
32008 |
-
className: "components-border-style-control__buttons"
|
32009 |
-
}, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
32010 |
-
key: borderStyle.value,
|
32011 |
-
icon: borderStyle.icon,
|
32012 |
-
isSmall: true,
|
32013 |
-
isPressed: borderStyle.value === value,
|
32014 |
-
onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value),
|
32015 |
-
"aria-label": borderStyle.label
|
32016 |
-
}))));
|
32017 |
}
|
32018 |
|
32019 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32020 |
|
32021 |
|
32022 |
/**
|
@@ -32026,207 +31405,123 @@ function BorderStyleControl(_ref) {
|
|
32026 |
|
32027 |
|
32028 |
/**
|
32029 |
-
*
|
32030 |
*
|
32031 |
-
*
|
|
|
32032 |
*
|
32033 |
-
* @return {
|
32034 |
*/
|
32035 |
|
32036 |
-
|
32037 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32038 |
|
32039 |
-
|
32040 |
-
|
32041 |
-
|
32042 |
-
|
32043 |
-
|
32044 |
-
|
32045 |
|
32046 |
-
|
32047 |
-
|
32048 |
-
|
32049 |
-
|
32050 |
-
}
|
32051 |
-
}
|
32052 |
-
setAttributes({
|
32053 |
-
style: cleanEmptyObject(newStyleAttributes)
|
32054 |
-
});
|
32055 |
-
};
|
32056 |
|
32057 |
-
|
32058 |
-
|
32059 |
-
|
32060 |
-
|
32061 |
-
};
|
32062 |
-
|
32063 |
-
* Checks if there is a current value in the border style block support
|
32064 |
-
* attributes.
|
32065 |
-
*
|
32066 |
-
* @param {Object} props Block props.
|
32067 |
-
* @return {boolean} Whether or not the block has a border style value set.
|
32068 |
-
*/
|
32069 |
|
32070 |
-
|
32071 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32072 |
|
32073 |
-
|
32074 |
-
|
32075 |
-
|
32076 |
-
|
32077 |
-
|
32078 |
-
|
32079 |
-
*
|
32080 |
-
* @param {Object} props Block props.
|
32081 |
-
* @param {Object} props.attributes Block's attributes.
|
32082 |
-
* @param {Object} props.setAttributes Function to set block's attributes.
|
32083 |
-
*/
|
32084 |
|
32085 |
-
|
32086 |
-
|
32087 |
-
|
32088 |
-
|
32089 |
-
|
32090 |
-
|
32091 |
-
style
|
32092 |
-
} = attributes;
|
32093 |
-
setAttributes({
|
32094 |
-
style: removeBorderAttribute(style, 'style')
|
32095 |
-
});
|
32096 |
-
}
|
32097 |
|
32098 |
-
|
|
|
|
|
|
|
|
|
|
|
32099 |
|
|
|
|
|
|
|
|
|
32100 |
|
32101 |
-
|
32102 |
-
* WordPress dependencies
|
32103 |
-
*/
|
32104 |
|
32105 |
|
32106 |
|
32107 |
/**
|
32108 |
-
*
|
32109 |
*/
|
32110 |
|
32111 |
-
|
32112 |
-
|
32113 |
-
|
32114 |
-
const MIN_BORDER_WIDTH = 0;
|
32115 |
/**
|
32116 |
-
*
|
32117 |
-
*
|
32118 |
-
* @param {Object} props Block properties.
|
32119 |
-
*
|
32120 |
-
* @return {WPElement} Border width edit element.
|
32121 |
*/
|
32122 |
|
32123 |
-
const BorderWidthEdit = props => {
|
32124 |
-
const {
|
32125 |
-
attributes: {
|
32126 |
-
borderColor,
|
32127 |
-
style
|
32128 |
-
},
|
32129 |
-
setAttributes
|
32130 |
-
} = props;
|
32131 |
-
const {
|
32132 |
-
width,
|
32133 |
-
color: customBorderColor,
|
32134 |
-
style: borderStyle
|
32135 |
-
} = (style === null || style === void 0 ? void 0 : style.border) || {}; // Used to temporarily track previous border color & style selections to be
|
32136 |
-
// able to restore them when border width changes from zero value.
|
32137 |
|
32138 |
-
const [styleSelection, setStyleSelection] = (0,external_wp_element_namespaceObject.useState)();
|
32139 |
-
const [colorSelection, setColorSelection] = (0,external_wp_element_namespaceObject.useState)();
|
32140 |
-
const [customColorSelection, setCustomColorSelection] = (0,external_wp_element_namespaceObject.useState)();
|
32141 |
|
32142 |
-
const onChange = newWidth => {
|
32143 |
-
let newStyle = { ...style,
|
32144 |
-
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
32145 |
-
width: newWidth
|
32146 |
-
}
|
32147 |
-
}; // Used to clear named border color attribute.
|
32148 |
|
32149 |
-
let borderPaletteColor = borderColor;
|
32150 |
-
const hasZeroWidth = parseFloat(newWidth) === 0;
|
32151 |
-
const hadPreviousZeroWidth = parseFloat(width) === 0; // Setting the border width explicitly to zero will also set the
|
32152 |
-
// border style to `none` and clear border color attributes.
|
32153 |
|
32154 |
-
if (hasZeroWidth && !hadPreviousZeroWidth) {
|
32155 |
-
// Before clearing color and style selections, keep track of
|
32156 |
-
// the current selections so they can be restored when the width
|
32157 |
-
// changes to a non-zero value.
|
32158 |
-
setColorSelection(borderColor);
|
32159 |
-
setCustomColorSelection(customBorderColor);
|
32160 |
-
setStyleSelection(borderStyle); // Clear style and color attributes.
|
32161 |
|
32162 |
-
borderPaletteColor = undefined;
|
32163 |
-
newStyle.border.color = undefined;
|
32164 |
-
newStyle.border.style = 'none';
|
32165 |
-
}
|
32166 |
|
32167 |
-
|
32168 |
-
|
32169 |
-
|
32170 |
-
// change the border style UI to a segmented control without a "none"
|
32171 |
-
// option.
|
32172 |
-
if (borderStyle === 'none') {
|
32173 |
-
newStyle.border.style = styleSelection;
|
32174 |
-
} // Restore previous border color selection if width is no longer zero
|
32175 |
-
// and current border color is undefined.
|
32176 |
|
32177 |
|
32178 |
-
if (borderColor === undefined) {
|
32179 |
-
borderPaletteColor = colorSelection;
|
32180 |
-
newStyle.border.color = customColorSelection;
|
32181 |
-
}
|
32182 |
-
} // If width was reset, clean out undefined styles.
|
32183 |
|
32184 |
|
32185 |
-
if (newWidth === undefined || newWidth === '') {
|
32186 |
-
newStyle = cleanEmptyObject(newStyle);
|
32187 |
-
}
|
32188 |
|
32189 |
-
setAttributes({
|
32190 |
-
borderColor: borderPaletteColor,
|
32191 |
-
style: newStyle
|
32192 |
-
});
|
32193 |
-
};
|
32194 |
|
32195 |
-
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
32196 |
-
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem']
|
32197 |
-
});
|
32198 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
32199 |
-
value: width,
|
32200 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Width'),
|
32201 |
-
min: MIN_BORDER_WIDTH,
|
32202 |
-
onChange: onChange,
|
32203 |
-
units: units
|
32204 |
-
});
|
32205 |
-
};
|
32206 |
-
/**
|
32207 |
-
* Checks if there is a current value in the border width block support
|
32208 |
-
* attributes.
|
32209 |
-
*
|
32210 |
-
* @param {Object} props Block props.
|
32211 |
-
* @return {boolean} Whether or not the block has a border width value set.
|
32212 |
-
*/
|
32213 |
|
32214 |
-
|
32215 |
-
|
32216 |
|
32217 |
-
|
32218 |
-
|
32219 |
-
|
32220 |
-
|
32221 |
-
|
32222 |
-
|
32223 |
-
|
32224 |
-
|
32225 |
-
|
32226 |
-
|
32227 |
-
|
|
|
32228 |
|
32229 |
-
function resetBorderWidth(_ref) {
|
32230 |
let {
|
32231 |
attributes = {},
|
32232 |
setAttributes
|
@@ -32235,97 +31530,274 @@ function resetBorderWidth(_ref) {
|
|
32235 |
style
|
32236 |
} = attributes;
|
32237 |
setAttributes({
|
32238 |
-
|
|
|
|
|
|
|
|
|
|
|
32239 |
});
|
32240 |
-
}
|
32241 |
|
32242 |
-
|
|
|
32243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32244 |
|
32245 |
-
|
32246 |
-
|
32247 |
-
|
|
|
|
|
|
|
|
|
32248 |
|
|
|
|
|
|
|
|
|
32249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32250 |
|
|
|
|
|
|
|
32251 |
|
32252 |
-
|
32253 |
-
|
32254 |
-
|
|
|
32255 |
|
32256 |
|
|
|
|
|
|
|
|
|
|
|
32257 |
|
32258 |
|
|
|
|
|
|
|
|
|
|
|
32259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32261 |
|
32262 |
|
32263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32264 |
function BorderPanel(props) {
|
32265 |
const {
|
32266 |
-
|
|
|
|
|
32267 |
} = props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32268 |
const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color');
|
32269 |
const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius');
|
32270 |
const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style');
|
32271 |
const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width');
|
32272 |
const isDisabled = [!isColorSupported, !isRadiusSupported, !isStyleSupported, !isWidthSupported].every(Boolean);
|
32273 |
|
32274 |
-
if (isDisabled) {
|
32275 |
return null;
|
32276 |
}
|
32277 |
|
32278 |
const defaultBorderControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [BORDER_SUPPORT_KEY, '__experimentalDefaultControls']);
|
|
|
32279 |
|
32280 |
-
const
|
32281 |
-
|
32282 |
-
return newAttributes => {
|
32283 |
-
var _newAttributes$style;
|
32284 |
|
32285 |
-
|
32286 |
-
|
32287 |
-
|
32288 |
-
|
32289 |
-
|
32290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32291 |
}
|
32292 |
};
|
32293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32294 |
};
|
32295 |
|
|
|
32296 |
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
32297 |
__experimentalGroup: "border"
|
32298 |
-
}, isWidthSupported && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
32299 |
-
|
32300 |
-
|
32301 |
-
|
32302 |
-
|
32303 |
-
|
32304 |
-
resetAllFilter: createResetAllFilter('width'),
|
32305 |
-
panelId: clientId
|
32306 |
-
}, (0,external_wp_element_namespaceObject.createElement)(BorderWidthEdit, props)), isStyleSupported && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
32307 |
-
className: "single-column",
|
32308 |
-
hasValue: () => hasBorderStyleValue(props),
|
32309 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Style'),
|
32310 |
-
onDeselect: () => resetBorderStyle(props),
|
32311 |
-
isShownByDefault: defaultBorderControls === null || defaultBorderControls === void 0 ? void 0 : defaultBorderControls.style,
|
32312 |
-
resetAllFilter: createResetAllFilter('style'),
|
32313 |
panelId: clientId
|
32314 |
-
}, (0,external_wp_element_namespaceObject.createElement)(
|
32315 |
-
|
32316 |
-
|
32317 |
-
|
32318 |
-
|
32319 |
-
|
32320 |
-
|
32321 |
-
|
32322 |
-
|
32323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32324 |
hasValue: () => hasBorderRadiusValue(props),
|
32325 |
label: (0,external_wp_i18n_namespaceObject.__)('Radius'),
|
32326 |
onDeselect: () => resetBorderRadius(props),
|
32327 |
isShownByDefault: defaultBorderControls === null || defaultBorderControls === void 0 ? void 0 : defaultBorderControls.radius,
|
32328 |
-
resetAllFilter:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32329 |
panelId: clientId
|
32330 |
}, (0,external_wp_element_namespaceObject.createElement)(BorderRadiusEdit, props)));
|
32331 |
}
|
@@ -32374,6 +31846,187 @@ function removeBorderAttribute(style, attribute) {
|
|
32374 |
}
|
32375 |
});
|
32376 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32377 |
|
32378 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/gradients/use-gradient.js
|
32379 |
/**
|
@@ -32610,6 +32263,120 @@ function ContrastChecker(_ref) {
|
|
32610 |
|
32611 |
/* harmony default export */ var contrast_checker = (ContrastChecker);
|
32612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32613 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/tools-panel-color-dropdown.js
|
32614 |
|
32615 |
|
@@ -35531,6 +35298,21 @@ const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOr
|
|
35531 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls);
|
35532 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles);
|
35533 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35534 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/duotone-control/index.js
|
35535 |
|
35536 |
|
@@ -35541,6 +35323,7 @@ const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOr
|
|
35541 |
|
35542 |
|
35543 |
|
|
|
35544 |
function DuotoneControl(_ref) {
|
35545 |
let {
|
35546 |
colorPalette,
|
@@ -35576,8 +35359,10 @@ function DuotoneControl(_ref) {
|
|
35576 |
"aria-expanded": isOpen,
|
35577 |
onKeyDown: openOnArrowDown,
|
35578 |
label: (0,external_wp_i18n_namespaceObject.__)('Apply duotone filter'),
|
35579 |
-
icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DuotoneSwatch, {
|
35580 |
values: value
|
|
|
|
|
35581 |
})
|
35582 |
});
|
35583 |
},
|
@@ -35661,28 +35446,44 @@ function getValuesFromColors() {
|
|
35661 |
*/
|
35662 |
|
35663 |
/**
|
35664 |
-
*
|
35665 |
*
|
35666 |
* @param {Object} props Duotone props.
|
35667 |
* @param {string} props.selector Selector to apply the filter to.
|
35668 |
* @param {string} props.id Unique id for this duotone filter.
|
35669 |
-
* @param {Values} props.values R, G, B, and A values to filter with.
|
35670 |
*
|
35671 |
* @return {WPElement} Duotone element.
|
35672 |
*/
|
35673 |
|
35674 |
-
function
|
35675 |
let {
|
35676 |
selector,
|
35677 |
-
id
|
35678 |
-
values
|
35679 |
} = _ref;
|
35680 |
-
const
|
35681 |
${selector} {
|
35682 |
filter: url( #${id} );
|
35683 |
}
|
35684 |
`;
|
35685 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35686 |
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
35687 |
viewBox: "0 0 0 0",
|
35688 |
width: "0",
|
@@ -35722,18 +35523,40 @@ ${selector} {
|
|
35722 |
// Re-mask the image with the original transparency since the feColorMatrix above loses that information.
|
35723 |
in2: "SourceGraphic",
|
35724 |
operator: "in"
|
35725 |
-
}))))
|
35726 |
-
|
35727 |
-
|
35728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35729 |
}));
|
35730 |
}
|
35731 |
|
35732 |
-
function useMultiOriginPresets(
|
35733 |
let {
|
35734 |
presetSetting,
|
35735 |
defaultSetting
|
35736 |
-
} =
|
35737 |
const disableDefault = !useSetting(defaultSetting);
|
35738 |
const userPresets = useSetting(`${presetSetting}.custom`) || duotone_EMPTY_ARRAY;
|
35739 |
const themePresets = useSetting(`${presetSetting}.theme`) || duotone_EMPTY_ARRAY;
|
@@ -35741,13 +35564,13 @@ function useMultiOriginPresets(_ref2) {
|
|
35741 |
return (0,external_wp_element_namespaceObject.useMemo)(() => [...userPresets, ...themePresets, ...(disableDefault ? duotone_EMPTY_ARRAY : defaultPresets)], [disableDefault, userPresets, themePresets, defaultPresets]);
|
35742 |
}
|
35743 |
|
35744 |
-
function DuotonePanel(
|
35745 |
var _style$color;
|
35746 |
|
35747 |
let {
|
35748 |
attributes,
|
35749 |
setAttributes
|
35750 |
-
} =
|
35751 |
const style = attributes === null || attributes === void 0 ? void 0 : attributes.style;
|
35752 |
const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone;
|
35753 |
const duotonePalette = useMultiOriginPresets({
|
@@ -35882,7 +35705,7 @@ const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrd
|
|
35882 |
const selectorsGroup = scopeSelector(`.editor-styles-wrapper .${id}`, duotoneSupport);
|
35883 |
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id);
|
35884 |
const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
|
35885 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(
|
35886 |
selector: selectorsGroup,
|
35887 |
id: id,
|
35888 |
values: getValuesFromColors(values)
|
@@ -35890,6 +35713,15 @@ const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrd
|
|
35890 |
className: className
|
35891 |
})));
|
35892 |
}, 'withDuotoneStyles');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35893 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes);
|
35894 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/duotone/with-editor-controls', withDuotoneControls);
|
35895 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/duotone/with-styles', withDuotoneStyles);
|
@@ -36110,49 +35942,32 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
|
|
36110 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/layout/with-inspector-controls', withInspectorControls);
|
36111 |
|
36112 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/use-border-props.js
|
36113 |
-
/**
|
36114 |
-
* External dependencies
|
36115 |
-
*/
|
36116 |
-
|
36117 |
/**
|
36118 |
* Internal dependencies
|
36119 |
*/
|
36120 |
|
36121 |
|
36122 |
-
|
36123 |
// This utility is intended to assist where the serialization of the border
|
36124 |
// block support is being skipped for a block but the border related CSS classes
|
36125 |
// & styles still need to be generated so they can be applied to inner elements.
|
36126 |
|
36127 |
-
const use_border_props_EMPTY_ARRAY = [];
|
36128 |
/**
|
36129 |
* Provides the CSS class names and inline styles for a block's border support
|
36130 |
* attributes.
|
36131 |
*
|
36132 |
-
* @param {Object} attributes
|
36133 |
-
* @param {string} attributes.borderColor Selected named border color.
|
36134 |
-
* @param {Object} attributes.style Block's styles attribute.
|
36135 |
-
*
|
36136 |
* @return {Object} Border block support derived CSS classes & styles.
|
36137 |
*/
|
36138 |
|
36139 |
-
function getBorderClassesAndStyles(
|
36140 |
-
var
|
36141 |
|
36142 |
-
|
36143 |
-
|
36144 |
-
style
|
36145 |
-
} = _ref;
|
36146 |
-
const borderStyles = (style === null || style === void 0 ? void 0 : style.border) || {};
|
36147 |
-
const borderClass = getColorClassName('border-color', borderColor);
|
36148 |
-
const className = classnames_default()({
|
36149 |
-
[borderClass]: !!borderClass,
|
36150 |
-
'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.color)
|
36151 |
-
});
|
36152 |
return {
|
36153 |
className: className || undefined,
|
36154 |
style: getInlineStyles({
|
36155 |
-
border
|
36156 |
})
|
36157 |
};
|
36158 |
}
|
@@ -36169,12 +35984,20 @@ function getBorderClassesAndStyles(_ref) {
|
|
36169 |
*/
|
36170 |
|
36171 |
function useBorderProps(attributes) {
|
36172 |
-
const
|
36173 |
-
|
36174 |
-
|
|
|
|
|
|
|
|
|
|
|
36175 |
|
36176 |
-
if (
|
36177 |
-
const borderColorObject =
|
|
|
|
|
|
|
36178 |
borderProps.style.borderColor = borderColorObject.color;
|
36179 |
}
|
36180 |
|
@@ -36371,6 +36194,7 @@ function useCachedTruthy(value) {
|
|
36371 |
|
36372 |
|
36373 |
|
|
|
36374 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
|
36375 |
|
36376 |
|
@@ -39196,7 +39020,6 @@ function BlockStylesPreviewPanel(_ref) {
|
|
39196 |
|
39197 |
|
39198 |
|
39199 |
-
|
39200 |
/**
|
39201 |
* Internal dependencies
|
39202 |
*/
|
@@ -39297,15 +39120,8 @@ function BlockStyles(_ref3) {
|
|
39297 |
onFocus: () => styleItemHandler(style),
|
39298 |
onMouseLeave: () => styleItemHandler(null),
|
39299 |
onBlur: () => styleItemHandler(null),
|
39300 |
-
onKeyDown: event => {
|
39301 |
-
if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) {
|
39302 |
-
event.preventDefault();
|
39303 |
-
onSelectStylePreview(style);
|
39304 |
-
}
|
39305 |
-
},
|
39306 |
onClick: () => onSelectStylePreview(style),
|
39307 |
-
|
39308 |
-
tabIndex: "0"
|
39309 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
39310 |
as: "span",
|
39311 |
limit: 12,
|
@@ -39877,6 +39693,112 @@ function __experimentalBlockVariationTransforms(_ref4) {
|
|
39877 |
|
39878 |
/* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
|
39879 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39880 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
|
39881 |
|
39882 |
|
@@ -40069,6 +39991,82 @@ function NonDefaultControls(_ref2) {
|
|
40069 |
}));
|
40070 |
}
|
40071 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40072 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
|
40073 |
|
40074 |
|
@@ -43545,6 +43543,11 @@ function LinkControl(_ref) {
|
|
43545 |
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url);
|
43546 |
const isEndingEditWithFocus = (0,external_wp_element_namespaceObject.useRef)(false);
|
43547 |
const currentInputIsEmpty = !(currentInputValue !== null && currentInputValue !== void 0 && (_currentInputValue$tr = currentInputValue.trim()) !== null && _currentInputValue$tr !== void 0 && _currentInputValue$tr.length);
|
|
|
|
|
|
|
|
|
|
|
43548 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
43549 |
if (forceIsEditingLink !== undefined && forceIsEditingLink !== isEditingLink) {
|
43550 |
setIsEditingLink(forceIsEditingLink);
|
@@ -43573,7 +43576,7 @@ function LinkControl(_ref) {
|
|
43573 |
const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperNode.current)[whichFocusTargetIndex] || wrapperNode.current;
|
43574 |
nextFocusTarget.focus();
|
43575 |
isEndingEditWithFocus.current = false;
|
43576 |
-
}, [isEditingLink]);
|
43577 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
43578 |
/**
|
43579 |
* If the value's `text` property changes then sync this
|
@@ -43604,12 +43607,6 @@ function LinkControl(_ref) {
|
|
43604 |
setIsEditingLink(false);
|
43605 |
}
|
43606 |
|
43607 |
-
const {
|
43608 |
-
createPage,
|
43609 |
-
isCreatingPage,
|
43610 |
-
errorMessage
|
43611 |
-
} = useCreatePage(createSuggestion);
|
43612 |
-
|
43613 |
const handleSelectSuggestion = updatedValue => {
|
43614 |
onChange({ ...updatedValue,
|
43615 |
title: internalTextValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title)
|
@@ -44763,40 +44760,6 @@ function useUndoAutomaticChange() {
|
|
44763 |
}, []);
|
44764 |
}
|
44765 |
|
44766 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-caret-in-format.js
|
44767 |
-
/**
|
44768 |
-
* WordPress dependencies
|
44769 |
-
*/
|
44770 |
-
|
44771 |
-
|
44772 |
-
/**
|
44773 |
-
* Internal dependencies
|
44774 |
-
*/
|
44775 |
-
|
44776 |
-
|
44777 |
-
function useCaretInFormat(_ref) {
|
44778 |
-
let {
|
44779 |
-
value
|
44780 |
-
} = _ref;
|
44781 |
-
const hasActiveFormats = value.activeFormats && !!value.activeFormats.length;
|
44782 |
-
const {
|
44783 |
-
isCaretWithinFormattedText
|
44784 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
44785 |
-
const {
|
44786 |
-
enterFormattedText,
|
44787 |
-
exitFormattedText
|
44788 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
44789 |
-
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
44790 |
-
if (hasActiveFormats) {
|
44791 |
-
if (!isCaretWithinFormattedText()) {
|
44792 |
-
enterFormattedText();
|
44793 |
-
}
|
44794 |
-
} else if (isCaretWithinFormattedText()) {
|
44795 |
-
exitFormattedText();
|
44796 |
-
}
|
44797 |
-
}, [hasActiveFormats]);
|
44798 |
-
}
|
44799 |
-
|
44800 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-mark-persistent.js
|
44801 |
/**
|
44802 |
* WordPress dependencies
|
@@ -45923,7 +45886,6 @@ function FormatEdit(_ref) {
|
|
45923 |
|
45924 |
|
45925 |
|
45926 |
-
|
45927 |
const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
|
45928 |
const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
|
45929 |
/**
|
@@ -46117,9 +46079,6 @@ function RichTextWrapper(_ref, forwardedRef) {
|
|
46117 |
record: value,
|
46118 |
onChange
|
46119 |
});
|
46120 |
-
useCaretInFormat({
|
46121 |
-
value
|
46122 |
-
});
|
46123 |
useMarkPersistent({
|
46124 |
html: adjustedValue,
|
46125 |
value
|
@@ -47659,10 +47618,10 @@ function BlockTools(_ref) {
|
|
47659 |
__unstableContentRef: __unstableContentRef
|
47660 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, {
|
47661 |
name: "block-toolbar",
|
47662 |
-
ref:
|
47663 |
}), children, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, {
|
47664 |
name: "__unstable-block-tools-after",
|
47665 |
-
ref:
|
47666 |
})))
|
47667 |
);
|
47668 |
}
|
2256 |
"__unstableEditorStyles": function() { return /* reexport */ EditorStyles; },
|
2257 |
"__unstableIframe": function() { return /* reexport */ iframe; },
|
2258 |
"__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; },
|
2259 |
+
"__unstablePresetDuotoneFilter": function() { return /* reexport */ PresetDuotoneFilter; },
|
2260 |
"__unstableRichTextInputEvent": function() { return /* reexport */ __unstableRichTextInputEvent; },
|
2261 |
"__unstableUseBlockSelectionClearer": function() { return /* reexport */ useBlockSelectionClearer; },
|
2262 |
"__unstableUseClipboardHandler": function() { return /* reexport */ useClipboardHandler; },
|
2308 |
"__unstableGetSelectedBlocksWithPartialSelection": function() { return __unstableGetSelectedBlocksWithPartialSelection; },
|
2309 |
"__unstableIsFullySelected": function() { return __unstableIsFullySelected; },
|
2310 |
"__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
|
2311 |
+
"__unstableIsSelectionCollapsed": function() { return __unstableIsSelectionCollapsed; },
|
2312 |
"__unstableIsSelectionMergeable": function() { return __unstableIsSelectionMergeable; },
|
2313 |
"areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
|
2314 |
"canEditBlock": function() { return canEditBlock; },
|
2377 |
"isBlockSelected": function() { return isBlockSelected; },
|
2378 |
"isBlockValid": function() { return isBlockValid; },
|
2379 |
"isBlockWithinSelection": function() { return isBlockWithinSelection; },
|
2380 |
+
"isCaretWithinFormattedText": function() { return isCaretWithinFormattedText; },
|
2381 |
"isDraggingBlocks": function() { return isDraggingBlocks; },
|
2382 |
"isFirstMultiSelectedBlock": function() { return isFirstMultiSelectedBlock; },
|
2383 |
"isLastBlockChangePersistent": function() { return isLastBlockChangePersistent; },
|
3799 |
|
3800 |
return state;
|
3801 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3802 |
/**
|
3803 |
* Internal helper reducer for selectionStart and selectionEnd. Can hold a block
|
3804 |
* selection, represented by an object with property clientId.
|
4421 |
blocks,
|
4422 |
isTyping,
|
4423 |
draggedBlocks,
|
|
|
4424 |
selection,
|
4425 |
isMultiSelecting,
|
4426 |
isSelectionEnabled,
|
4734 |
|
4735 |
;// CONCATENATED MODULE: external ["wp","richText"]
|
4736 |
var external_wp_richText_namespaceObject = window["wp"]["richText"];
|
4737 |
+
;// CONCATENATED MODULE: external ["wp","deprecated"]
|
4738 |
+
var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
4739 |
+
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
4740 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/utils.js
|
4741 |
/**
|
4742 |
* Helper function that maps attribute definition properties to the
|
4774 |
|
4775 |
|
4776 |
|
4777 |
+
|
4778 |
/**
|
4779 |
* Internal dependencies
|
4780 |
*/
|
5621 |
const selectionFocus = getSelectionEnd(state);
|
5622 |
return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined';
|
5623 |
}
|
5624 |
+
/**
|
5625 |
+
* Returns true if the selection is collapsed.
|
5626 |
+
*
|
5627 |
+
* @param {Object} state Editor state.
|
5628 |
+
*
|
5629 |
+
* @return {boolean} Whether the selection is collapsed.
|
5630 |
+
*/
|
5631 |
+
|
5632 |
+
function __unstableIsSelectionCollapsed(state) {
|
5633 |
+
const selectionAnchor = getSelectionStart(state);
|
5634 |
+
const selectionFocus = getSelectionEnd(state);
|
5635 |
+
return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset;
|
5636 |
+
}
|
5637 |
/**
|
5638 |
* Check whether the selection is mergeable.
|
5639 |
*
|
5967 |
/**
|
5968 |
* Returns true if the caret is within formatted text, or false otherwise.
|
5969 |
*
|
5970 |
+
* @deprecated
|
5971 |
*
|
5972 |
* @return {boolean} Whether the caret is within formatted text.
|
5973 |
*/
|
5974 |
|
5975 |
+
function isCaretWithinFormattedText() {
|
5976 |
+
external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', {
|
5977 |
+
since: '6.1',
|
5978 |
+
version: '6.3'
|
5979 |
+
});
|
5980 |
+
return false;
|
5981 |
}
|
5982 |
/**
|
5983 |
* Returns the insertion point, the index at which the new inserted block would
|
7185 |
|
7186 |
;// CONCATENATED MODULE: external ["wp","a11y"]
|
7187 |
var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
|
|
|
|
|
|
|
7188 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/actions.js
|
7189 |
/**
|
7190 |
* External dependencies
|
8335 |
/**
|
8336 |
* Returns an action object used in signalling that the caret has entered formatted text.
|
8337 |
*
|
8338 |
+
* @deprecated
|
8339 |
+
*
|
8340 |
* @return {Object} Action object.
|
8341 |
*/
|
8342 |
|
8343 |
function enterFormattedText() {
|
8344 |
+
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).enterFormattedText', {
|
8345 |
+
since: '6.1',
|
8346 |
+
version: '6.3'
|
8347 |
+
});
|
8348 |
return {
|
8349 |
+
type: 'DO_NOTHING'
|
8350 |
};
|
8351 |
}
|
8352 |
/**
|
8353 |
* Returns an action object used in signalling that the user caret has exited formatted text.
|
8354 |
*
|
8355 |
+
* @deprecated
|
8356 |
+
*
|
8357 |
* @return {Object} Action object.
|
8358 |
*/
|
8359 |
|
8360 |
function exitFormattedText() {
|
8361 |
+
external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).exitFormattedText', {
|
8362 |
+
since: '6.1',
|
8363 |
+
version: '6.3'
|
8364 |
+
});
|
8365 |
return {
|
8366 |
+
type: 'DO_NOTHING'
|
8367 |
};
|
8368 |
}
|
8369 |
/**
|
24684 |
};
|
24685 |
})(BlockListAppender));
|
24686 |
|
24687 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/use-popover-scroll.js
|
24688 |
/**
|
24689 |
* WordPress dependencies
|
24690 |
*/
|
24723 |
}, [scrollableRef]);
|
24724 |
}
|
24725 |
|
24726 |
+
/* harmony default export */ var use_popover_scroll = (usePopoverScroll);
|
24727 |
+
|
24728 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/inbetween.js
|
24729 |
+
|
24730 |
|
24731 |
|
24732 |
/**
|
24741 |
|
24742 |
|
24743 |
|
|
|
24744 |
/**
|
24745 |
* Internal dependencies
|
24746 |
*/
|
24748 |
|
24749 |
|
24750 |
|
|
|
24751 |
const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
|
24752 |
|
24753 |
+
function BlockPopoverInbetween(_ref) {
|
24754 |
let {
|
24755 |
+
previousClientId,
|
24756 |
+
nextClientId,
|
24757 |
+
children,
|
24758 |
__unstablePopoverSlot,
|
24759 |
+
__unstableContentRef,
|
24760 |
+
...props
|
24761 |
} = _ref;
|
|
|
|
|
|
|
|
|
|
|
|
|
24762 |
const {
|
24763 |
orientation,
|
24764 |
+
rootClientId
|
|
|
|
|
|
|
24765 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
24766 |
var _getBlockListSettings;
|
24767 |
|
24768 |
const {
|
|
|
24769 |
getBlockListSettings,
|
24770 |
+
getBlockRootClientId
|
|
|
|
|
|
|
24771 |
} = select(store);
|
|
|
|
|
|
|
|
|
|
|
|
|
24772 |
|
24773 |
+
const _rootClientId = getBlockRootClientId(previousClientId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24774 |
|
24775 |
return {
|
24776 |
+
orientation: ((_getBlockListSettings = getBlockListSettings(_rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
24777 |
+
rootClientId: _rootClientId
|
|
|
|
|
|
|
24778 |
};
|
24779 |
+
}, [previousClientId]);
|
24780 |
const previousElement = useBlockElement(previousClientId);
|
24781 |
const nextElement = useBlockElement(nextClientId);
|
24782 |
const isVertical = orientation === 'vertical';
|
24805 |
width,
|
24806 |
height: previousElement ? previousElement.offsetHeight : nextElement.offsetHeight
|
24807 |
};
|
24808 |
+
}, [previousElement, nextElement, isVertical]);
|
24809 |
const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
24810 |
if (!previousElement && !nextElement) {
|
24811 |
return {};
|
24855 |
ownerDocument
|
24856 |
};
|
24857 |
}, [previousElement, nextElement]);
|
24858 |
+
const popoverScrollRef = use_popover_scroll(__unstableContentRef);
|
24859 |
+
|
24860 |
+
if (!previousElement || !nextElement) {
|
24861 |
+
return null;
|
24862 |
+
}
|
24863 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
24864 |
+
// While ideally it would be enough to capture the
|
24865 |
+
// bubbling focus event from the Inserter, due to the
|
24866 |
+
// characteristics of click focusing of `button`s in
|
24867 |
+
// Firefox and Safari, it is not reliable.
|
24868 |
+
//
|
24869 |
+
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
24870 |
+
|
24871 |
+
|
24872 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
24873 |
+
ref: popoverScrollRef,
|
24874 |
+
noArrow: true,
|
24875 |
+
animate: false,
|
24876 |
+
getAnchorRect: getAnchorRect,
|
24877 |
+
focusOnMount: false // Render in the old slot if needed for backward compatibility,
|
24878 |
+
// otherwise render in place (not in the the default popover slot).
|
24879 |
+
,
|
24880 |
+
__unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
|
24881 |
+
// This makes sure the popover doesn't animate from its previous position.
|
24882 |
+
,
|
24883 |
+
key: nextClientId + '--' + rootClientId
|
24884 |
+
}, props, {
|
24885 |
+
className: classnames_default()('block-editor-block-popover', props.className)
|
24886 |
+
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
24887 |
+
style: style
|
24888 |
+
}, children));
|
24889 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
24890 |
+
}
|
24891 |
+
|
24892 |
+
/* harmony default export */ var inbetween = (BlockPopoverInbetween);
|
24893 |
+
|
24894 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/insertion-point.js
|
24895 |
+
|
24896 |
+
|
24897 |
+
/**
|
24898 |
+
* External dependencies
|
24899 |
+
*/
|
24900 |
+
|
24901 |
+
/**
|
24902 |
+
* WordPress dependencies
|
24903 |
+
*/
|
24904 |
+
|
24905 |
+
|
24906 |
+
|
24907 |
+
|
24908 |
+
|
24909 |
+
/**
|
24910 |
+
* Internal dependencies
|
24911 |
+
*/
|
24912 |
+
|
24913 |
+
|
24914 |
+
|
24915 |
+
|
24916 |
+
const insertion_point_InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
|
24917 |
+
|
24918 |
+
function InsertionPointPopover(_ref) {
|
24919 |
+
let {
|
24920 |
+
__unstablePopoverSlot,
|
24921 |
+
__unstableContentRef
|
24922 |
+
} = _ref;
|
24923 |
+
const {
|
24924 |
+
selectBlock,
|
24925 |
+
hideInsertionPoint
|
24926 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
24927 |
+
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
24928 |
+
const ref = (0,external_wp_element_namespaceObject.useRef)();
|
24929 |
+
const {
|
24930 |
+
orientation,
|
24931 |
+
previousClientId,
|
24932 |
+
nextClientId,
|
24933 |
+
rootClientId,
|
24934 |
+
isInserterShown
|
24935 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
24936 |
+
var _getBlockListSettings;
|
24937 |
+
|
24938 |
+
const {
|
24939 |
+
getBlockOrder,
|
24940 |
+
getBlockListSettings,
|
24941 |
+
getBlockInsertionPoint,
|
24942 |
+
isBlockBeingDragged,
|
24943 |
+
getPreviousBlockClientId,
|
24944 |
+
getNextBlockClientId
|
24945 |
+
} = select(store);
|
24946 |
+
const insertionPoint = getBlockInsertionPoint();
|
24947 |
+
const order = getBlockOrder(insertionPoint.rootClientId);
|
24948 |
+
|
24949 |
+
if (!order.length) {
|
24950 |
+
return {};
|
24951 |
+
}
|
24952 |
+
|
24953 |
+
let _previousClientId = order[insertionPoint.index - 1];
|
24954 |
+
let _nextClientId = order[insertionPoint.index];
|
24955 |
+
|
24956 |
+
while (isBlockBeingDragged(_previousClientId)) {
|
24957 |
+
_previousClientId = getPreviousBlockClientId(_previousClientId);
|
24958 |
+
}
|
24959 |
+
|
24960 |
+
while (isBlockBeingDragged(_nextClientId)) {
|
24961 |
+
_nextClientId = getNextBlockClientId(_nextClientId);
|
24962 |
+
}
|
24963 |
+
|
24964 |
+
return {
|
24965 |
+
previousClientId: _previousClientId,
|
24966 |
+
nextClientId: _nextClientId,
|
24967 |
+
orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
|
24968 |
+
rootClientId: insertionPoint.rootClientId,
|
24969 |
+
isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
|
24970 |
+
};
|
24971 |
+
}, []);
|
24972 |
+
const isVertical = orientation === 'vertical';
|
24973 |
const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
|
|
|
24974 |
|
24975 |
function onClick(event) {
|
24976 |
if (event.target === ref.current && nextClientId) {
|
24992 |
if (event.target === ref.current && !openRef.current) {
|
24993 |
hideInsertionPoint();
|
24994 |
}
|
24995 |
+
} // Define animation variants for the line element.
|
|
|
24996 |
|
24997 |
|
|
|
|
|
24998 |
const horizontalLine = {
|
24999 |
start: {
|
25000 |
width: 0,
|
25046 |
opacity: 1,
|
25047 |
borderRadius: '2px',
|
25048 |
transition: {
|
25049 |
+
delay: isInserterShown ? 0.4 : 0
|
25050 |
}
|
25051 |
},
|
25052 |
hover: { ...(!isVertical ? horizontalLine.hover : verticalLine.hover),
|
25068 |
}
|
25069 |
}
|
25070 |
};
|
25071 |
+
const className = classnames_default()('block-editor-block-list__insertion-point', 'is-' + orientation);
|
25072 |
+
return (0,external_wp_element_namespaceObject.createElement)(inbetween, {
|
25073 |
+
previousClientId: previousClientId,
|
25074 |
+
nextClientId: nextClientId,
|
25075 |
+
__unstablePopoverSlot: __unstablePopoverSlot,
|
25076 |
+
__unstableContentRef: __unstableContentRef
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25077 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
25078 |
layout: !disableMotion,
|
25079 |
initial: disableMotion ? 'rest' : 'start',
|
25086 |
onClick: onClick,
|
25087 |
onFocus: onFocus,
|
25088 |
className: classnames_default()(className, {
|
25089 |
+
'is-with-inserter': isInserterShown
|
25090 |
}),
|
25091 |
+
onHoverEnd: maybeHideInserterPoint
|
|
|
25092 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
25093 |
variants: lineVariants,
|
25094 |
className: "block-editor-block-list__insertion-point-indicator"
|
25095 |
+
}), isInserterShown && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
25096 |
variants: inserterVariants,
|
25097 |
className: classnames_default()('block-editor-block-list__insertion-point-inserter')
|
25098 |
}, (0,external_wp_element_namespaceObject.createElement)(inserter, {
|
25107 |
openRef.current = false;
|
25108 |
}
|
25109 |
}))));
|
|
|
25110 |
}
|
25111 |
|
25112 |
function InsertionPoint(_ref2) {
|
25113 |
let {
|
25114 |
children,
|
25115 |
+
...props
|
|
|
25116 |
} = _ref2;
|
25117 |
const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
25118 |
return select(store).isBlockInsertionPointVisible();
|
25119 |
}, []);
|
25120 |
+
return (0,external_wp_element_namespaceObject.createElement)(insertion_point_InsertionPointOpenRef.Provider, {
|
25121 |
value: (0,external_wp_element_namespaceObject.useRef)(false)
|
25122 |
+
}, isVisible && (0,external_wp_element_namespaceObject.createElement)(InsertionPointPopover, props), children);
|
|
|
|
|
|
|
25123 |
}
|
25124 |
|
25125 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-in-between-inserter.js
|
25136 |
|
25137 |
|
25138 |
function useInBetweenInserter() {
|
25139 |
+
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
25140 |
const hasReducedUI = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().hasReducedUI, []);
|
25141 |
const {
|
25142 |
getBlockListSettings,
|
25342 |
* @property {string} title Human-readable block type label.
|
25343 |
* @property {WPIcon} icon Block type icon.
|
25344 |
* @property {string} description A detailed block type description.
|
25345 |
+
* @property {string} anchor HTML anchor.
|
25346 |
*/
|
25347 |
|
25348 |
/**
|
25386 |
return {
|
25387 |
title: match.title || blockType.title,
|
25388 |
icon: match.icon || blockType.icon,
|
25389 |
+
description: match.description || blockType.description,
|
25390 |
+
anchor: attributes === null || attributes === void 0 ? void 0 : attributes.anchor
|
25391 |
};
|
25392 |
}, [clientId]);
|
25393 |
}
|
25733 |
|
25734 |
|
25735 |
|
25736 |
+
|
25737 |
/**
|
25738 |
* Block selection button component, displaying the label of the block. If the block
|
25739 |
* descends from a root block, a button is displayed enabling the user to select
|
25748 |
function BlockSelectionButton(_ref) {
|
25749 |
let {
|
25750 |
clientId,
|
25751 |
+
rootClientId
|
|
|
25752 |
} = _ref;
|
25753 |
const blockInformation = useBlockDisplayInformation(clientId);
|
25754 |
const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
25793 |
ref.current.focus();
|
25794 |
(0,external_wp_a11y_namespaceObject.speak)(label);
|
25795 |
}, [label]);
|
25796 |
+
const blockElement = useBlockElement(clientId);
|
25797 |
const {
|
25798 |
hasBlockMovingClientId,
|
25799 |
getBlockIndex,
|
26466 |
"aria-describedby": descriptionId
|
26467 |
}, props, {
|
26468 |
onClick: isDisabled ? null : onClick,
|
26469 |
+
disabled: isDisabled,
|
26470 |
+
__experimentalIsFocusable: true
|
26471 |
+
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
|
26472 |
+
id: descriptionId
|
26473 |
}, getBlockMoverDescription(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, direction === 'up' ? -1 : 1, orientation)));
|
26474 |
});
|
26475 |
const BlockMoverUpButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
|
26502 |
|
26503 |
|
26504 |
|
|
|
|
|
26505 |
/**
|
26506 |
* Internal dependencies
|
26507 |
*/
|
26512 |
|
26513 |
function BlockMover(_ref) {
|
26514 |
let {
|
|
|
|
|
26515 |
clientIds,
|
|
|
|
|
|
|
|
|
26516 |
hideDragHandle
|
26517 |
} = _ref;
|
26518 |
+
const {
|
26519 |
+
canMove,
|
26520 |
+
rootClientId,
|
26521 |
+
isFirst,
|
26522 |
+
isLast,
|
26523 |
+
orientation
|
26524 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
26525 |
+
var _getBlockListSettings;
|
26526 |
|
26527 |
+
const {
|
26528 |
+
getBlockIndex,
|
26529 |
+
getBlockListSettings,
|
26530 |
+
canMoveBlocks,
|
26531 |
+
getBlockOrder,
|
26532 |
+
getBlockRootClientId
|
26533 |
+
} = select(store);
|
26534 |
+
const normalizedClientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
|
26535 |
+
const firstClientId = (0,external_lodash_namespaceObject.first)(normalizedClientIds);
|
26536 |
|
26537 |
+
const _rootClientId = getBlockRootClientId((0,external_lodash_namespaceObject.first)(normalizedClientIds));
|
26538 |
+
|
26539 |
+
const firstIndex = getBlockIndex(firstClientId);
|
26540 |
+
const lastIndex = getBlockIndex((0,external_lodash_namespaceObject.last)(normalizedClientIds));
|
26541 |
+
const blockOrder = getBlockOrder(_rootClientId);
|
26542 |
+
return {
|
26543 |
+
canMove: canMoveBlocks(clientIds, _rootClientId),
|
26544 |
+
rootClientId: _rootClientId,
|
26545 |
+
isFirst: firstIndex === 0,
|
26546 |
+
isLast: lastIndex === blockOrder.length - 1,
|
26547 |
+
orientation: (_getBlockListSettings = getBlockListSettings(_rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation
|
26548 |
+
};
|
26549 |
+
}, [clientIds]);
|
26550 |
|
26551 |
if (!canMove || isFirst && isLast && !rootClientId) {
|
26552 |
return null;
|
26553 |
}
|
26554 |
|
26555 |
+
const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag');
|
|
|
|
|
|
|
|
|
26556 |
|
26557 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
|
26558 |
className: classnames_default()('block-editor-block-mover', {
|
|
|
26559 |
'is-horizontal': orientation === 'horizontal'
|
26560 |
})
|
26561 |
}, !hideDragHandle && (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
|
26562 |
+
clientIds: clientIds
|
|
|
26563 |
}, draggableProps => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({
|
26564 |
icon: drag_handle,
|
26565 |
className: "block-editor-block-mover__drag-handle",
|
26568 |
// button can only be used with a pointer device.
|
26569 |
,
|
26570 |
tabIndex: "-1"
|
26571 |
+
}, draggableProps))), (0,external_wp_element_namespaceObject.createElement)("div", {
|
26572 |
className: "block-editor-block-mover__move-button-container"
|
26573 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverUpButton, _extends({
|
|
|
|
|
|
|
26574 |
clientIds: clientIds
|
26575 |
+
}, itemProps))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, itemProps => (0,external_wp_element_namespaceObject.createElement)(BlockMoverDownButton, _extends({
|
|
|
|
|
|
|
26576 |
clientIds: clientIds
|
26577 |
}, itemProps)))));
|
26578 |
}
|
26581 |
*/
|
26582 |
|
26583 |
|
26584 |
+
/* harmony default export */ var block_mover = (BlockMover);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26585 |
|
26586 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/utils.js
|
26587 |
/**
|
27902 |
hasMultiSelection,
|
27903 |
getSettings,
|
27904 |
__unstableIsFullySelected,
|
27905 |
+
__unstableIsSelectionCollapsed,
|
27906 |
__unstableIsSelectionMergeable,
|
27907 |
__unstableGetSelectedBlocksWithPartialSelection
|
27908 |
} = (0,external_wp_data_namespaceObject.useSelect)(store);
|
27946 |
const eventDefaultPrevented = event.defaultPrevented;
|
27947 |
event.preventDefault();
|
27948 |
|
|
|
|
|
27949 |
const isSelectionMergeable = __unstableIsSelectionMergeable();
|
27950 |
|
27951 |
+
const shouldHandleWholeBlocks = __unstableIsSelectionCollapsed() || __unstableIsFullySelected();
|
27952 |
+
|
27953 |
+
const expandSelectionIsNeeded = !shouldHandleWholeBlocks && !isSelectionMergeable;
|
27954 |
|
27955 |
if (event.type === 'copy' || event.type === 'cut') {
|
27956 |
if (selectedBlockClientIds.length === 1) {
|
27965 |
notifyCopy(event.type, selectedBlockClientIds);
|
27966 |
let blocks; // Check if we have partial selection.
|
27967 |
|
27968 |
+
if (shouldHandleWholeBlocks) {
|
27969 |
blocks = getBlocksByClientId(selectedBlockClientIds);
|
27970 |
} else {
|
27971 |
const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection();
|
27984 |
// We need to also check if at the start we needed to
|
27985 |
// expand the selection, as in this point we might have
|
27986 |
// programmatically fully selected the blocks above.
|
27987 |
+
if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) {
|
27988 |
removeBlocks(selectedBlockClientIds);
|
27989 |
} else {
|
27990 |
__unstableDeleteSelection();
|
28507 |
/**
|
28508 |
* Return details about the block lock status.
|
28509 |
*
|
28510 |
+
* @param {string} clientId The block client Id.
|
|
|
|
|
28511 |
*
|
28512 |
* @return {Object} Block lock status
|
28513 |
*/
|
28514 |
|
28515 |
function useBlockLock(clientId) {
|
|
|
28516 |
return (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28517 |
const {
|
28518 |
canEditBlock,
|
28522 |
getBlockName,
|
28523 |
getBlockRootClientId
|
28524 |
} = select(store);
|
28525 |
+
const rootClientId = getBlockRootClientId(clientId);
|
28526 |
const canEdit = canEditBlock(clientId);
|
28527 |
const canMove = canMoveBlock(clientId, rootClientId);
|
28528 |
const canRemove = canRemoveBlock(clientId, rootClientId);
|
28533 |
canLock: canLockBlockType(getBlockName(clientId)),
|
28534 |
isLocked: !canEdit || !canMove || !canRemove
|
28535 |
};
|
28536 |
+
}, [clientId]);
|
28537 |
}
|
28538 |
|
28539 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/modal.js
|
28569 |
canEdit,
|
28570 |
canMove,
|
28571 |
canRemove
|
28572 |
+
} = useBlockLock(clientId);
|
28573 |
const {
|
28574 |
isReusable
|
28575 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28698 |
const {
|
28699 |
canLock,
|
28700 |
isLocked
|
28701 |
+
} = useBlockLock(clientId);
|
28702 |
const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
|
28703 |
|
28704 |
if (!canLock) {
|
29483 |
|
29484 |
/* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar);
|
29485 |
|
29486 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/index.js
|
29487 |
+
|
29488 |
|
29489 |
|
29490 |
/**
|
29491 |
* External dependencies
|
29492 |
*/
|
29493 |
|
|
|
29494 |
/**
|
29495 |
* WordPress dependencies
|
29496 |
*/
|
29497 |
|
29498 |
|
29499 |
|
29500 |
+
/**
|
29501 |
+
* Internal dependencies
|
29502 |
+
*/
|
29503 |
+
|
29504 |
+
|
29505 |
+
|
29506 |
+
function BlockPopover(_ref) {
|
29507 |
+
let {
|
29508 |
+
clientId,
|
29509 |
+
bottomClientId,
|
29510 |
+
children,
|
29511 |
+
__unstablePopoverSlot,
|
29512 |
+
__unstableContentRef,
|
29513 |
+
...props
|
29514 |
+
} = _ref;
|
29515 |
+
const selectedElement = useBlockElement(clientId);
|
29516 |
+
const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
|
29517 |
+
const popoverScrollRef = use_popover_scroll(__unstableContentRef);
|
29518 |
+
|
29519 |
+
if (!selectedElement || bottomClientId && !lastSelectedElement) {
|
29520 |
+
return null;
|
29521 |
+
}
|
29522 |
+
|
29523 |
+
const anchorRef = {
|
29524 |
+
top: selectedElement,
|
29525 |
+
bottom: lastSelectedElement
|
29526 |
+
};
|
29527 |
+
const {
|
29528 |
+
ownerDocument
|
29529 |
+
} = selectedElement;
|
29530 |
+
const stickyBoundaryElement = ownerDocument.defaultView.frameElement || (0,external_wp_dom_namespaceObject.getScrollContainer)(selectedElement) || ownerDocument.body;
|
29531 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
29532 |
+
ref: popoverScrollRef,
|
29533 |
+
noArrow: true,
|
29534 |
+
animate: false,
|
29535 |
+
position: "top right left",
|
29536 |
+
focusOnMount: false,
|
29537 |
+
anchorRef: anchorRef,
|
29538 |
+
__unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
|
29539 |
+
// otherwise render in place (not in the the default popover slot).
|
29540 |
+
,
|
29541 |
+
__unstableSlotName: __unstablePopoverSlot || null,
|
29542 |
+
__unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
|
29543 |
+
,
|
29544 |
+
__unstableObserveElement: selectedElement,
|
29545 |
+
shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
|
29546 |
+
// obscure specific sections of a block.
|
29547 |
+
,
|
29548 |
+
__unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
|
29549 |
+
}, props, {
|
29550 |
+
className: classnames_default()('block-editor-block-popover', props.className)
|
29551 |
+
}), children);
|
29552 |
+
}
|
29553 |
+
|
29554 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/selected-block-popover.js
|
29555 |
+
|
29556 |
+
|
29557 |
+
/**
|
29558 |
+
* External dependencies
|
29559 |
+
*/
|
29560 |
+
|
29561 |
+
|
29562 |
+
/**
|
29563 |
+
* WordPress dependencies
|
29564 |
+
*/
|
29565 |
+
|
29566 |
|
29567 |
|
29568 |
|
29578 |
|
29579 |
|
29580 |
|
29581 |
+
function selected_block_popover_selector(select) {
|
|
|
29582 |
const {
|
29583 |
isNavigationMode,
|
29584 |
isMultiSelecting,
|
29585 |
hasMultiSelection,
|
29586 |
isTyping,
|
|
|
29587 |
getSettings,
|
29588 |
getLastMultiSelectedBlockClientId
|
29589 |
} = select(store);
|
29591 |
isNavigationMode: isNavigationMode(),
|
29592 |
isMultiSelecting: isMultiSelecting(),
|
29593 |
isTyping: isTyping(),
|
|
|
|
|
29594 |
hasFixedToolbar: getSettings().hasFixedToolbar,
|
29595 |
+
lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
|
29596 |
};
|
29597 |
}
|
29598 |
|
29599 |
+
function SelectedBlockPopover(_ref) {
|
29600 |
let {
|
29601 |
clientId,
|
29602 |
rootClientId,
|
|
|
29603 |
isEmptyDefaultBlock,
|
29604 |
capturingClientId,
|
29605 |
__unstablePopoverSlot,
|
29609 |
isNavigationMode,
|
29610 |
isMultiSelecting,
|
29611 |
isTyping,
|
|
|
|
|
29612 |
hasFixedToolbar,
|
29613 |
lastClientId
|
29614 |
+
} = (0,external_wp_data_namespaceObject.useSelect)(selected_block_popover_selector, []);
|
29615 |
const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
29616 |
const {
|
29617 |
isBlockInsertionPointVisible,
|
29628 |
return order[insertionPoint.index] === clientId;
|
29629 |
}, [clientId]);
|
29630 |
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
|
29631 |
+
const isToolbarForced = (0,external_wp_element_namespaceObject.useRef)(false);
|
29632 |
const [isInserterShown, setIsInserterShown] = (0,external_wp_element_namespaceObject.useState)(false);
|
29633 |
const {
|
29634 |
stopTyping
|
29635 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
29636 |
+
const showEmptyBlockSideInserter = !isTyping && !isNavigationMode && isEmptyDefaultBlock;
|
|
|
|
|
29637 |
const shouldShowBreadcrumb = isNavigationMode;
|
29638 |
+
const shouldShowContextualToolbar = !isNavigationMode && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping;
|
29639 |
const canFocusHiddenToolbar = !isNavigationMode && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock;
|
29640 |
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
|
29641 |
+
isToolbarForced.current = true;
|
29642 |
stopTyping(true);
|
29643 |
}, {
|
29644 |
isDisabled: !canFocusHiddenToolbar
|
29645 |
});
|
29646 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
29647 |
+
isToolbarForced.current = false;
|
29648 |
+
}); // Stores the active toolbar item index so the block toolbar can return focus
|
|
|
|
|
29649 |
// to it when re-mounting.
|
29650 |
|
29651 |
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29652 |
|
29653 |
+
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar) {
|
|
|
|
|
29654 |
return null;
|
29655 |
}
|
29656 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29657 |
function onFocus() {
|
29658 |
setIsInserterShown(true);
|
29659 |
}
|
29660 |
|
29661 |
function onBlur() {
|
29662 |
setIsInserterShown(false);
|
29663 |
+
}
|
|
|
|
|
|
|
|
|
29664 |
|
29665 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockPopover, {
|
29666 |
+
clientId: capturingClientId || clientId,
|
29667 |
+
bottomClientId: lastClientId,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29668 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
29669 |
'is-insertion-point-visible': isInsertionPointVisible
|
29670 |
}),
|
29671 |
+
__unstablePopoverSlot: __unstablePopoverSlot,
|
29672 |
+
__unstableContentRef: __unstableContentRef
|
29673 |
+
}, shouldShowContextualToolbar && (0,external_wp_element_namespaceObject.createElement)("div", {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29674 |
onFocus: onFocus,
|
29675 |
onBlur: onBlur // While ideally it would be enough to capture the
|
29676 |
// bubbling focus event from the Inserter, due to the
|
29687 |
clientId: clientId,
|
29688 |
rootClientId: rootClientId,
|
29689 |
__experimentalIsQuick: true
|
29690 |
+
})), shouldShowContextualToolbar && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced
|
29691 |
// it should focus the toolbar right after the mount.
|
29692 |
, {
|
29693 |
+
focusOnMount: isToolbarForced.current,
|
29694 |
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
|
29695 |
__experimentalOnIndexChange: index => {
|
29696 |
initialToolbarItemIndexRef.current = index;
|
29700 |
key: clientId
|
29701 |
}), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, {
|
29702 |
clientId: clientId,
|
29703 |
+
rootClientId: rootClientId
|
29704 |
+
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29705 |
}
|
29706 |
|
29707 |
function wrapperSelector(select) {
|
29721 |
|
29722 |
const {
|
29723 |
name,
|
29724 |
+
attributes = {}
|
|
|
29725 |
} = getBlock(clientId) || {};
|
29726 |
const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId.
|
29727 |
|
29737 |
clientId,
|
29738 |
rootClientId: getBlockRootClientId(clientId),
|
29739 |
name,
|
|
|
29740 |
isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({
|
29741 |
name,
|
29742 |
attributes
|
29760 |
clientId,
|
29761 |
rootClientId,
|
29762 |
name,
|
|
|
29763 |
isEmptyDefaultBlock,
|
29764 |
capturingClientId
|
29765 |
} = selected;
|
29768 |
return null;
|
29769 |
}
|
29770 |
|
29771 |
+
return (0,external_wp_element_namespaceObject.createElement)(SelectedBlockPopover, {
|
29772 |
clientId: clientId,
|
29773 |
rootClientId: rootClientId,
|
|
|
29774 |
isEmptyDefaultBlock: isEmptyDefaultBlock,
|
29775 |
capturingClientId: capturingClientId,
|
29776 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
29797 |
let {
|
29798 |
children
|
29799 |
} = _ref;
|
29800 |
+
const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef);
|
29801 |
const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // If context is set, `BlockTools` is a parent component.
|
29802 |
|
29803 |
if (openRef || isDisabled) {
|
30852 |
}, (0,external_wp_element_namespaceObject.createElement)(Items, props));
|
30853 |
}
|
30854 |
|
30855 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/utils.js
|
|
|
|
|
|
|
30856 |
/**
|
30857 |
+
* WordPress dependencies
|
30858 |
*/
|
30859 |
|
|
|
30860 |
/**
|
30861 |
+
* Gets the (non-undefined) item with the highest occurrence within an array
|
30862 |
+
* Based in part on: https://stackoverflow.com/a/20762713
|
30863 |
+
*
|
30864 |
+
* Undefined values are always sorted to the end by `sort`, so this function
|
30865 |
+
* returns the first element, to always prioritize real values over undefined
|
30866 |
+
* values.
|
30867 |
+
*
|
30868 |
+
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description
|
30869 |
+
*
|
30870 |
+
* @param {Array<any>} inputArray Array of items to check.
|
30871 |
+
* @return {any} The item with the most occurrences.
|
30872 |
*/
|
30873 |
|
30874 |
+
function mode(inputArray) {
|
30875 |
+
const arr = [...inputArray];
|
30876 |
+
return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift();
|
30877 |
+
}
|
30878 |
+
/**
|
30879 |
+
* Returns the most common CSS unit in the radius values.
|
30880 |
+
* Falls back to `px` as a default unit.
|
30881 |
+
*
|
30882 |
+
* @param {Object|string} values Radius values.
|
30883 |
+
* @return {string} Most common CSS unit in values. Default: `px`.
|
30884 |
+
*/
|
30885 |
|
30886 |
+
function getAllUnit() {
|
30887 |
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30888 |
|
30889 |
+
if (typeof values === 'string') {
|
30890 |
+
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values);
|
30891 |
+
return unit || 'px';
|
30892 |
+
}
|
30893 |
|
30894 |
+
const allUnits = Object.values(values).map(value => {
|
30895 |
+
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
|
30896 |
+
return unit;
|
30897 |
+
});
|
30898 |
+
return mode(allUnits) || 'px';
|
30899 |
+
}
|
30900 |
/**
|
30901 |
+
* Gets the 'all' input value and unit from values data.
|
30902 |
+
*
|
30903 |
+
* @param {Object|string} values Radius values.
|
30904 |
+
* @return {string} A value + unit for the 'all' input.
|
30905 |
*/
|
30906 |
|
30907 |
+
function getAllValue() {
|
30908 |
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30909 |
|
30910 |
+
/**
|
30911 |
+
* Border radius support was originally a single pixel value.
|
30912 |
+
*
|
30913 |
+
* To maintain backwards compatibility treat this case as the all value.
|
30914 |
+
*/
|
30915 |
+
if (typeof values === 'string') {
|
30916 |
+
return values;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30917 |
}
|
30918 |
|
30919 |
+
const parsedQuantitiesAndUnits = Object.values(values).map(value => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value));
|
30920 |
+
const allValues = parsedQuantitiesAndUnits.map(value => {
|
30921 |
+
var _value$;
|
30922 |
+
|
30923 |
+
return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : '';
|
30924 |
+
});
|
30925 |
+
const allUnits = parsedQuantitiesAndUnits.map(value => value[1]);
|
30926 |
+
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
30927 |
+
const unit = mode(allUnits);
|
30928 |
+
const allValue = value === 0 || value ? `${value}${unit}` : undefined;
|
30929 |
+
return allValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30930 |
}
|
30931 |
+
/**
|
30932 |
+
* Checks to determine if values are mixed.
|
30933 |
+
*
|
30934 |
+
* @param {Object} values Radius values.
|
30935 |
+
* @return {boolean} Whether values are mixed.
|
30936 |
+
*/
|
30937 |
|
30938 |
+
function hasMixedValues() {
|
30939 |
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30940 |
+
const allValue = getAllValue(values);
|
30941 |
+
const isMixed = typeof values === 'string' ? false : isNaN(parseFloat(allValue));
|
30942 |
+
return isMixed;
|
|
|
|
|
30943 |
}
|
30944 |
+
/**
|
30945 |
+
* Checks to determine if values are defined.
|
30946 |
+
*
|
30947 |
+
* @param {Object} values Radius values.
|
30948 |
+
* @return {boolean} Whether values are mixed.
|
30949 |
+
*/
|
30950 |
|
30951 |
+
function hasDefinedValues(values) {
|
30952 |
+
if (!values) {
|
30953 |
+
return false;
|
30954 |
+
} // A string value represents a shorthand value.
|
30955 |
|
|
|
|
|
30956 |
|
30957 |
+
if (typeof values === 'string') {
|
30958 |
+
return true;
|
30959 |
+
} // An object represents longhand border radius values, if any are set
|
30960 |
+
// flag values as being defined.
|
30961 |
|
|
|
30962 |
|
30963 |
+
const filteredValues = Object.values(values).filter(value => {
|
30964 |
+
return !!value || value === 0;
|
30965 |
+
});
|
30966 |
+
return !!filteredValues.length;
|
30967 |
+
}
|
30968 |
+
|
30969 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/all-input-control.js
|
30970 |
|
30971 |
|
|
|
|
|
|
|
30972 |
|
30973 |
/**
|
30974 |
* WordPress dependencies
|
30980 |
*/
|
30981 |
|
30982 |
|
30983 |
+
function AllInputControl(_ref) {
|
30984 |
let {
|
30985 |
+
onChange,
|
30986 |
+
values,
|
30987 |
+
...props
|
|
|
|
|
|
|
|
|
|
|
30988 |
} = _ref;
|
30989 |
+
const allValue = getAllValue(values);
|
30990 |
+
const hasValues = hasDefinedValues(values);
|
30991 |
+
const isMixed = hasValues && hasMixedValues(values);
|
30992 |
+
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null;
|
30993 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
30994 |
+
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
30995 |
+
disableUnits: isMixed,
|
30996 |
+
isOnly: true,
|
30997 |
+
value: allValue,
|
30998 |
+
onChange: onChange,
|
30999 |
+
placeholder: allPlaceholder
|
31000 |
+
}));
|
31001 |
+
}
|
31002 |
|
31003 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/input-controls.js
|
|
|
|
|
31004 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31005 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31006 |
|
|
|
31007 |
/**
|
31008 |
+
* WordPress dependencies
|
31009 |
*/
|
31010 |
|
31011 |
+
|
31012 |
+
const CORNERS = {
|
31013 |
+
topLeft: (0,external_wp_i18n_namespaceObject.__)('Top left'),
|
31014 |
+
topRight: (0,external_wp_i18n_namespaceObject.__)('Top right'),
|
31015 |
+
bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'),
|
31016 |
+
bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right')
|
31017 |
+
};
|
31018 |
+
function BoxInputControls(_ref) {
|
31019 |
+
let {
|
31020 |
+
onChange,
|
31021 |
+
values: valuesProp,
|
31022 |
+
...props
|
31023 |
+
} = _ref;
|
31024 |
+
|
31025 |
+
const createHandleOnChange = corner => next => {
|
31026 |
+
if (!onChange) {
|
31027 |
+
return;
|
31028 |
+
}
|
31029 |
+
|
31030 |
+
onChange({ ...values,
|
31031 |
+
[corner]: next ? next : undefined
|
31032 |
+
});
|
31033 |
+
}; // For shorthand style & backwards compatibility, handle flat string value.
|
31034 |
+
|
31035 |
+
|
31036 |
+
const values = typeof valuesProp !== 'string' ? valuesProp : {
|
31037 |
+
topLeft: valuesProp,
|
31038 |
+
topRight: valuesProp,
|
31039 |
+
bottomLeft: valuesProp,
|
31040 |
+
bottomRight: valuesProp
|
31041 |
+
}; // Controls are wrapped in tooltips as visible labels aren't desired here.
|
31042 |
+
|
31043 |
+
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
31044 |
+
className: "components-border-radius-control__input-controls-wrapper"
|
31045 |
+
}, Object.entries(CORNERS).map(_ref2 => {
|
31046 |
+
let [key, label] = _ref2;
|
31047 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
31048 |
+
key: key,
|
31049 |
+
"aria-label": label,
|
31050 |
+
value: values[key],
|
31051 |
+
onChange: createHandleOnChange(key)
|
31052 |
+
}));
|
31053 |
+
}));
|
31054 |
}
|
31055 |
|
31056 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link.js
|
|
|
|
|
|
|
31057 |
|
31058 |
|
31059 |
/**
|
31060 |
+
* WordPress dependencies
|
31061 |
*/
|
31062 |
|
31063 |
+
const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
31064 |
+
xmlns: "http://www.w3.org/2000/svg",
|
31065 |
+
viewBox: "0 0 24 24"
|
31066 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31067 |
+
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"
|
31068 |
+
}));
|
31069 |
+
/* harmony default export */ var library_link = (link_link);
|
31070 |
+
|
31071 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link-off.js
|
31072 |
|
31073 |
|
31074 |
/**
|
31075 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
31076 |
*/
|
31077 |
|
31078 |
+
const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
31079 |
+
xmlns: "http://www.w3.org/2000/svg",
|
31080 |
+
viewBox: "0 0 24 24"
|
31081 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
31082 |
+
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"
|
31083 |
+
}));
|
31084 |
+
/* harmony default export */ var link_off = (linkOff);
|
|
|
31085 |
|
31086 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/linked-button.js
|
|
|
|
|
|
|
|
|
|
|
31087 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31088 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31089 |
|
31090 |
+
/**
|
31091 |
+
* WordPress dependencies
|
31092 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31093 |
|
31094 |
|
31095 |
|
31292 |
});
|
31293 |
}
|
31294 |
|
31295 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/utils.js
|
|
|
|
|
31296 |
/**
|
31297 |
+
* External dependencies
|
31298 |
*/
|
31299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31300 |
|
|
|
31301 |
|
31302 |
|
31303 |
+
k([names, a11y]);
|
31304 |
/**
|
31305 |
+
* Provided an array of color objects as set by the theme or by the editor defaults,
|
31306 |
+
* and the values of the defined color or custom color returns a color object describing the color.
|
31307 |
+
*
|
31308 |
+
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31309 |
+
* @param {?string} definedColor A string containing the color slug.
|
31310 |
+
* @param {?string} customColor A string containing the customColor value.
|
31311 |
+
*
|
31312 |
+
* @return {?Object} If definedColor is passed and the name is found in colors,
|
31313 |
+
* the color object exactly as set by the theme or editor defaults is returned.
|
31314 |
+
* Otherwise, an object that just sets the color is defined.
|
31315 |
*/
|
31316 |
|
31317 |
+
const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
|
31318 |
+
if (definedColor) {
|
31319 |
+
const colorObj = (0,external_lodash_namespaceObject.find)(colors, {
|
31320 |
+
slug: definedColor
|
31321 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31322 |
|
31323 |
+
if (colorObj) {
|
31324 |
+
return colorObj;
|
31325 |
+
}
|
31326 |
+
}
|
31327 |
|
31328 |
+
return {
|
31329 |
+
color: customColor
|
31330 |
+
};
|
31331 |
+
};
|
31332 |
/**
|
31333 |
+
* Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.
|
31334 |
+
*
|
31335 |
+
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31336 |
+
* @param {?string} colorValue A string containing the color value.
|
31337 |
+
*
|
31338 |
+
* @return {?Object} Color object included in the colors array whose color property equals colorValue.
|
31339 |
+
* Returns undefined if no color object matches this requirement.
|
31340 |
*/
|
31341 |
|
31342 |
+
const getColorObjectByColorValue = (colors, colorValue) => {
|
31343 |
+
return (0,external_lodash_namespaceObject.find)(colors, {
|
31344 |
+
color: colorValue
|
31345 |
+
});
|
31346 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31347 |
/**
|
31348 |
+
* Returns a class based on the context a color is being used and its slug.
|
31349 |
+
*
|
31350 |
+
* @param {string} colorContextName Context/place where color is being used e.g: background, text etc...
|
31351 |
+
* @param {string} colorSlug Slug of the color.
|
31352 |
+
*
|
31353 |
+
* @return {?string} String with the class corresponding to the color in the provided context.
|
31354 |
+
* Returns undefined if either colorContextName or colorSlug are not provided.
|
31355 |
*/
|
31356 |
|
31357 |
+
function getColorClassName(colorContextName, colorSlug) {
|
31358 |
+
if (!colorContextName || !colorSlug) {
|
31359 |
+
return undefined;
|
31360 |
+
}
|
31361 |
|
31362 |
+
return `has-${(0,external_lodash_namespaceObject.kebabCase)(colorSlug)}-${colorContextName}`;
|
31363 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31364 |
/**
|
31365 |
+
* Given an array of color objects and a color value returns the color value of the most readable color in the array.
|
31366 |
*
|
31367 |
+
* @param {Array} colors Array of color objects as set by the theme or by the editor defaults.
|
31368 |
+
* @param {?string} colorValue A string containing the color value.
|
|
|
31369 |
*
|
31370 |
+
* @return {string} String with the color value of the most readable color.
|
31371 |
*/
|
31372 |
|
31373 |
+
function getMostReadableColor(colors, colorValue) {
|
31374 |
+
const colordColor = w(colorValue);
|
31375 |
+
return (0,external_lodash_namespaceObject.maxBy)(colors, _ref => {
|
31376 |
+
let {
|
31377 |
+
color
|
31378 |
+
} = _ref;
|
31379 |
+
return colordColor.contrast(color);
|
31380 |
+
}).color;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31381 |
}
|
31382 |
|
31383 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js
|
31384 |
+
/**
|
31385 |
+
* Internal dependencies
|
31386 |
+
*/
|
31387 |
+
|
31388 |
+
function useCommonSingleMultipleSelects() {
|
31389 |
+
return {
|
31390 |
+
disableCustomColors: !useSetting('color.custom'),
|
31391 |
+
disableCustomGradients: !useSetting('color.customGradient')
|
31392 |
+
};
|
31393 |
+
}
|
31394 |
+
|
31395 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js
|
31396 |
+
/**
|
31397 |
+
* WordPress dependencies
|
31398 |
+
*/
|
31399 |
|
31400 |
|
31401 |
/**
|
31405 |
|
31406 |
|
31407 |
/**
|
31408 |
+
* Retrieves color and gradient related settings.
|
31409 |
*
|
31410 |
+
* The arrays for colors and gradients are made up of color palettes from each
|
31411 |
+
* origin i.e. "Core", "Theme", and "User".
|
31412 |
*
|
31413 |
+
* @return {Object} Color and gradient related settings.
|
31414 |
*/
|
31415 |
|
31416 |
+
function useMultipleOriginColorsAndGradients() {
|
31417 |
+
const colorGradientSettings = useCommonSingleMultipleSelects();
|
31418 |
+
const customColors = useSetting('color.palette.custom');
|
31419 |
+
const themeColors = useSetting('color.palette.theme');
|
31420 |
+
const defaultColors = useSetting('color.palette.default');
|
31421 |
+
const shouldDisplayDefaultColors = useSetting('color.defaultPalette');
|
31422 |
+
colorGradientSettings.colors = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
31423 |
+
const result = [];
|
31424 |
|
31425 |
+
if (themeColors && themeColors.length) {
|
31426 |
+
result.push({
|
31427 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
|
31428 |
+
colors: themeColors
|
31429 |
+
});
|
31430 |
+
}
|
31431 |
|
31432 |
+
if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
|
31433 |
+
result.push({
|
31434 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
|
31435 |
+
colors: defaultColors
|
31436 |
+
});
|
31437 |
+
}
|
|
|
|
|
|
|
|
|
31438 |
|
31439 |
+
if (customColors && customColors.length) {
|
31440 |
+
result.push({
|
31441 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette comes from the theme.'),
|
31442 |
+
colors: customColors
|
31443 |
+
});
|
31444 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
31445 |
|
31446 |
+
return result;
|
31447 |
+
}, [defaultColors, themeColors, customColors]);
|
31448 |
+
const customGradients = useSetting('color.gradients.custom');
|
31449 |
+
const themeGradients = useSetting('color.gradients.theme');
|
31450 |
+
const defaultGradients = useSetting('color.gradients.default');
|
31451 |
+
const shouldDisplayDefaultGradients = useSetting('color.defaultGradients');
|
31452 |
+
colorGradientSettings.gradients = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
31453 |
+
const result = [];
|
31454 |
|
31455 |
+
if (themeGradients && themeGradients.length) {
|
31456 |
+
result.push({
|
31457 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'),
|
31458 |
+
gradients: themeGradients
|
31459 |
+
});
|
31460 |
+
}
|
|
|
|
|
|
|
|
|
|
|
31461 |
|
31462 |
+
if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) {
|
31463 |
+
result.push({
|
31464 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
|
31465 |
+
gradients: defaultGradients
|
31466 |
+
});
|
31467 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
31468 |
|
31469 |
+
if (customGradients && customGradients.length) {
|
31470 |
+
result.push({
|
31471 |
+
name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'),
|
31472 |
+
gradients: customGradients
|
31473 |
+
});
|
31474 |
+
}
|
31475 |
|
31476 |
+
return result;
|
31477 |
+
}, [customGradients, themeGradients, defaultGradients]);
|
31478 |
+
return colorGradientSettings;
|
31479 |
+
}
|
31480 |
|
31481 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/border.js
|
|
|
|
|
31482 |
|
31483 |
|
31484 |
|
31485 |
/**
|
31486 |
+
* External dependencies
|
31487 |
*/
|
31488 |
|
|
|
|
|
|
|
|
|
31489 |
/**
|
31490 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
31491 |
*/
|
31492 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31493 |
|
|
|
|
|
|
|
31494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31495 |
|
|
|
|
|
|
|
|
|
31496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31497 |
|
|
|
|
|
|
|
|
|
31498 |
|
31499 |
+
/**
|
31500 |
+
* Internal dependencies
|
31501 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
31502 |
|
31503 |
|
|
|
|
|
|
|
|
|
|
|
31504 |
|
31505 |
|
|
|
|
|
|
|
31506 |
|
|
|
|
|
|
|
|
|
|
|
31507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31508 |
|
31509 |
+
const BORDER_SUPPORT_KEY = '__experimentalBorder';
|
31510 |
+
const borderSides = ['top', 'right', 'bottom', 'left'];
|
31511 |
|
31512 |
+
const hasBorderValue = props => {
|
31513 |
+
const {
|
31514 |
+
borderColor,
|
31515 |
+
style
|
31516 |
+
} = props.attributes;
|
31517 |
+
return (0,external_wp_components_namespaceObject.__experimentalIsDefinedBorder)(style === null || style === void 0 ? void 0 : style.border) || !!borderColor;
|
31518 |
+
}; // The border color, style, and width are omitted so they get undefined. The
|
31519 |
+
// border radius is separate and must retain its selection.
|
31520 |
+
|
31521 |
+
|
31522 |
+
const resetBorder = _ref => {
|
31523 |
+
var _style$border;
|
31524 |
|
|
|
31525 |
let {
|
31526 |
attributes = {},
|
31527 |
setAttributes
|
31530 |
style
|
31531 |
} = attributes;
|
31532 |
setAttributes({
|
31533 |
+
borderColor: undefined,
|
31534 |
+
style: { ...style,
|
31535 |
+
border: cleanEmptyObject({
|
31536 |
+
radius: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius
|
31537 |
+
})
|
31538 |
+
}
|
31539 |
});
|
31540 |
+
};
|
31541 |
|
31542 |
+
const resetBorderFilter = newAttributes => {
|
31543 |
+
var _newAttributes$style, _newAttributes$style$;
|
31544 |
|
31545 |
+
return { ...newAttributes,
|
31546 |
+
borderColor: undefined,
|
31547 |
+
style: { ...newAttributes.style,
|
31548 |
+
border: {
|
31549 |
+
radius: (_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : (_newAttributes$style$ = _newAttributes$style.border) === null || _newAttributes$style$ === void 0 ? void 0 : _newAttributes$style$.radius
|
31550 |
+
}
|
31551 |
+
}
|
31552 |
+
};
|
31553 |
+
};
|
31554 |
|
31555 |
+
const getColorByProperty = (colors, property, value) => {
|
31556 |
+
let matchedColor;
|
31557 |
+
colors.some(origin => origin.colors.some(color => {
|
31558 |
+
if (color[property] === value) {
|
31559 |
+
matchedColor = color;
|
31560 |
+
return true;
|
31561 |
+
}
|
31562 |
|
31563 |
+
return false;
|
31564 |
+
}));
|
31565 |
+
return matchedColor;
|
31566 |
+
};
|
31567 |
|
31568 |
+
const getMultiOriginColor = _ref2 => {
|
31569 |
+
let {
|
31570 |
+
colors,
|
31571 |
+
namedColor,
|
31572 |
+
customColor
|
31573 |
+
} = _ref2;
|
31574 |
|
31575 |
+
// Search each origin (default, theme, or user) for matching color by name.
|
31576 |
+
if (namedColor) {
|
31577 |
+
const colorObject = getColorByProperty(colors, 'slug', namedColor);
|
31578 |
|
31579 |
+
if (colorObject) {
|
31580 |
+
return colorObject;
|
31581 |
+
}
|
31582 |
+
} // Skip if no custom color or matching named color.
|
31583 |
|
31584 |
|
31585 |
+
if (!customColor) {
|
31586 |
+
return {
|
31587 |
+
color: undefined
|
31588 |
+
};
|
31589 |
+
} // Attempt to find color via custom color value or build new object.
|
31590 |
|
31591 |
|
31592 |
+
const colorObject = getColorByProperty(colors, 'color', customColor);
|
31593 |
+
return colorObject ? colorObject : {
|
31594 |
+
color: customColor
|
31595 |
+
};
|
31596 |
+
};
|
31597 |
|
31598 |
+
const getBorderObject = (attributes, colors) => {
|
31599 |
+
const {
|
31600 |
+
borderColor,
|
31601 |
+
style
|
31602 |
+
} = attributes;
|
31603 |
+
const {
|
31604 |
+
border: borderStyles
|
31605 |
+
} = style || {}; // If we have a named color for a flat border. Fetch that color object and
|
31606 |
+
// apply that color's value to the color property within the style object.
|
31607 |
|
31608 |
+
if (borderColor) {
|
31609 |
+
const {
|
31610 |
+
color
|
31611 |
+
} = getMultiOriginColor({
|
31612 |
+
colors,
|
31613 |
+
namedColor: borderColor
|
31614 |
+
});
|
31615 |
+
return color ? { ...borderStyles,
|
31616 |
+
color
|
31617 |
+
} : borderStyles;
|
31618 |
+
} // Individual side border color slugs are stored within the border style
|
31619 |
+
// object. If we don't have a border styles object we have nothing further
|
31620 |
+
// to hydrate.
|
31621 |
|
31622 |
|
31623 |
+
if (!borderStyles) {
|
31624 |
+
return borderStyles;
|
31625 |
+
} // If we have named colors for the individual side borders, retrieve their
|
31626 |
+
// related color objects and apply the real color values to the split
|
31627 |
+
// border objects.
|
31628 |
+
|
31629 |
+
|
31630 |
+
const hydratedBorderStyles = { ...borderStyles
|
31631 |
+
};
|
31632 |
+
borderSides.forEach(side => {
|
31633 |
+
var _hydratedBorderStyles;
|
31634 |
+
|
31635 |
+
const colorSlug = getColorSlugFromVariable((_hydratedBorderStyles = hydratedBorderStyles[side]) === null || _hydratedBorderStyles === void 0 ? void 0 : _hydratedBorderStyles.color);
|
31636 |
+
|
31637 |
+
if (colorSlug) {
|
31638 |
+
const {
|
31639 |
+
color
|
31640 |
+
} = getMultiOriginColor({
|
31641 |
+
colors,
|
31642 |
+
namedColor: colorSlug
|
31643 |
+
});
|
31644 |
+
hydratedBorderStyles[side] = { ...hydratedBorderStyles[side],
|
31645 |
+
color
|
31646 |
+
};
|
31647 |
+
}
|
31648 |
+
});
|
31649 |
+
return hydratedBorderStyles;
|
31650 |
+
};
|
31651 |
+
|
31652 |
+
function getColorSlugFromVariable(value) {
|
31653 |
+
const namedColor = /var:preset\|color\|(.+)/.exec(value);
|
31654 |
+
|
31655 |
+
if (namedColor && namedColor[1]) {
|
31656 |
+
return namedColor[1];
|
31657 |
+
}
|
31658 |
+
|
31659 |
+
return null;
|
31660 |
+
}
|
31661 |
+
|
31662 |
function BorderPanel(props) {
|
31663 |
const {
|
31664 |
+
attributes,
|
31665 |
+
clientId,
|
31666 |
+
setAttributes
|
31667 |
} = props;
|
31668 |
+
const {
|
31669 |
+
style
|
31670 |
+
} = attributes;
|
31671 |
+
const {
|
31672 |
+
colors
|
31673 |
+
} = useMultipleOriginColorsAndGradients();
|
31674 |
+
const isSupported = hasBorderSupport(props.name);
|
31675 |
const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color');
|
31676 |
const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius');
|
31677 |
const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style');
|
31678 |
const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width');
|
31679 |
const isDisabled = [!isColorSupported, !isRadiusSupported, !isStyleSupported, !isWidthSupported].every(Boolean);
|
31680 |
|
31681 |
+
if (isDisabled || !isSupported) {
|
31682 |
return null;
|
31683 |
}
|
31684 |
|
31685 |
const defaultBorderControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [BORDER_SUPPORT_KEY, '__experimentalDefaultControls']);
|
31686 |
+
const showBorderByDefault = (defaultBorderControls === null || defaultBorderControls === void 0 ? void 0 : defaultBorderControls.color) || (defaultBorderControls === null || defaultBorderControls === void 0 ? void 0 : defaultBorderControls.width);
|
31687 |
|
31688 |
+
const onBorderChange = newBorder => {
|
31689 |
+
var _style$border2;
|
|
|
|
|
31690 |
|
31691 |
+
// Filter out named colors and apply them to appropriate block
|
31692 |
+
// attributes so that CSS classes can be used to apply those colors.
|
31693 |
+
// e.g. has-primary-border-top-color.
|
31694 |
+
let newBorderStyles = { ...newBorder
|
31695 |
+
};
|
31696 |
+
let newBorderColor;
|
31697 |
+
|
31698 |
+
if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(newBorder)) {
|
31699 |
+
// For each side check if the side has a color value set
|
31700 |
+
// If so, determine if it belongs to a named color, in which case
|
31701 |
+
// we update the color property.
|
31702 |
+
//
|
31703 |
+
// This deliberately overwrites `newBorderStyles` to avoid mutating
|
31704 |
+
// the passed object which causes problems otherwise.
|
31705 |
+
newBorderStyles = {
|
31706 |
+
top: { ...newBorder.top
|
31707 |
+
},
|
31708 |
+
right: { ...newBorder.right
|
31709 |
+
},
|
31710 |
+
bottom: { ...newBorder.bottom
|
31711 |
+
},
|
31712 |
+
left: { ...newBorder.left
|
31713 |
}
|
31714 |
};
|
31715 |
+
borderSides.forEach(side => {
|
31716 |
+
var _newBorder$side;
|
31717 |
+
|
31718 |
+
if ((_newBorder$side = newBorder[side]) !== null && _newBorder$side !== void 0 && _newBorder$side.color) {
|
31719 |
+
var _newBorder$side2;
|
31720 |
+
|
31721 |
+
const colorObject = getMultiOriginColor({
|
31722 |
+
colors,
|
31723 |
+
customColor: (_newBorder$side2 = newBorder[side]) === null || _newBorder$side2 === void 0 ? void 0 : _newBorder$side2.color
|
31724 |
+
});
|
31725 |
+
|
31726 |
+
if (colorObject.slug) {
|
31727 |
+
newBorderStyles[side].color = `var:preset|color|${colorObject.slug}`;
|
31728 |
+
}
|
31729 |
+
}
|
31730 |
+
});
|
31731 |
+
} else if (newBorder !== null && newBorder !== void 0 && newBorder.color) {
|
31732 |
+
// We have a flat border configuration. Apply named color slug to
|
31733 |
+
// `borderColor` attribute and clear color style property if found.
|
31734 |
+
const customColor = newBorder === null || newBorder === void 0 ? void 0 : newBorder.color;
|
31735 |
+
const colorObject = getMultiOriginColor({
|
31736 |
+
colors,
|
31737 |
+
customColor
|
31738 |
+
});
|
31739 |
+
|
31740 |
+
if (colorObject.slug) {
|
31741 |
+
newBorderColor = colorObject.slug;
|
31742 |
+
newBorderStyles.color = undefined;
|
31743 |
+
}
|
31744 |
+
} // Ensure previous border radius styles are maintained and clean
|
31745 |
+
// overall result for empty objects or properties.
|
31746 |
+
|
31747 |
+
|
31748 |
+
const newStyle = cleanEmptyObject({ ...style,
|
31749 |
+
border: {
|
31750 |
+
radius: style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.radius,
|
31751 |
+
...newBorderStyles
|
31752 |
+
}
|
31753 |
+
});
|
31754 |
+
setAttributes({
|
31755 |
+
style: newStyle,
|
31756 |
+
borderColor: newBorderColor
|
31757 |
+
});
|
31758 |
};
|
31759 |
|
31760 |
+
const hydratedBorder = getBorderObject(attributes, colors);
|
31761 |
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
31762 |
__experimentalGroup: "border"
|
31763 |
+
}, (isWidthSupported || isColorSupported) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
31764 |
+
hasValue: () => hasBorderValue(props),
|
31765 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Border'),
|
31766 |
+
onDeselect: () => resetBorder(props),
|
31767 |
+
isShownByDefault: showBorderByDefault,
|
31768 |
+
resetAllFilter: resetBorderFilter,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31769 |
panelId: clientId
|
31770 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBorderBoxControl, {
|
31771 |
+
colors: colors,
|
31772 |
+
enableAlpha: true,
|
31773 |
+
onChange: onBorderChange,
|
31774 |
+
popoverClassNames: {
|
31775 |
+
linked: 'block-editor__border-box-control__popover',
|
31776 |
+
top: 'block-editor__border-box-control__popover-top',
|
31777 |
+
right: 'block-editor__border-box-control__popover-right',
|
31778 |
+
bottom: 'block-editor__border-box-control__popover-bottom',
|
31779 |
+
left: 'block-editor__border-box-control__popover-left'
|
31780 |
+
},
|
31781 |
+
showStyle: isStyleSupported,
|
31782 |
+
value: hydratedBorder,
|
31783 |
+
__experimentalHasMultipleOrigins: true,
|
31784 |
+
__experimentalIsRenderedInSidebar: true
|
31785 |
+
})), isRadiusSupported && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
31786 |
hasValue: () => hasBorderRadiusValue(props),
|
31787 |
label: (0,external_wp_i18n_namespaceObject.__)('Radius'),
|
31788 |
onDeselect: () => resetBorderRadius(props),
|
31789 |
isShownByDefault: defaultBorderControls === null || defaultBorderControls === void 0 ? void 0 : defaultBorderControls.radius,
|
31790 |
+
resetAllFilter: newAttributes => {
|
31791 |
+
var _newAttributes$style2;
|
31792 |
+
|
31793 |
+
return { ...newAttributes,
|
31794 |
+
style: { ...newAttributes.style,
|
31795 |
+
border: { ...((_newAttributes$style2 = newAttributes.style) === null || _newAttributes$style2 === void 0 ? void 0 : _newAttributes$style2.border),
|
31796 |
+
radius: undefined
|
31797 |
+
}
|
31798 |
+
}
|
31799 |
+
};
|
31800 |
+
},
|
31801 |
panelId: clientId
|
31802 |
}, (0,external_wp_element_namespaceObject.createElement)(BorderRadiusEdit, props)));
|
31803 |
}
|
31846 |
}
|
31847 |
});
|
31848 |
}
|
31849 |
+
/**
|
31850 |
+
* Filters registered block settings, extending attributes to include
|
31851 |
+
* `borderColor` if needed.
|
31852 |
+
*
|
31853 |
+
* @param {Object} settings Original block settings.
|
31854 |
+
*
|
31855 |
+
* @return {Object} Updated block settings.
|
31856 |
+
*/
|
31857 |
+
|
31858 |
+
function addAttributes(settings) {
|
31859 |
+
if (!hasBorderSupport(settings, 'color')) {
|
31860 |
+
return settings;
|
31861 |
+
} // Allow blocks to specify default value if needed.
|
31862 |
+
|
31863 |
+
|
31864 |
+
if (settings.attributes.borderColor) {
|
31865 |
+
return settings;
|
31866 |
+
} // Add new borderColor attribute to block settings.
|
31867 |
+
|
31868 |
+
|
31869 |
+
return { ...settings,
|
31870 |
+
attributes: { ...settings.attributes,
|
31871 |
+
borderColor: {
|
31872 |
+
type: 'string'
|
31873 |
+
}
|
31874 |
+
}
|
31875 |
+
};
|
31876 |
+
}
|
31877 |
+
/**
|
31878 |
+
* Override props assigned to save component to inject border color.
|
31879 |
+
*
|
31880 |
+
* @param {Object} props Additional props applied to save element.
|
31881 |
+
* @param {Object} blockType Block type definition.
|
31882 |
+
* @param {Object} attributes Block's attributes.
|
31883 |
+
*
|
31884 |
+
* @return {Object} Filtered props to apply to save element.
|
31885 |
+
*/
|
31886 |
+
|
31887 |
+
|
31888 |
+
function border_addSaveProps(props, blockType, attributes) {
|
31889 |
+
if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType, BORDER_SUPPORT_KEY, 'color')) {
|
31890 |
+
return props;
|
31891 |
+
}
|
31892 |
+
|
31893 |
+
const borderClasses = getBorderClasses(attributes);
|
31894 |
+
const newClassName = classnames_default()(props.className, borderClasses); // If we are clearing the last of the previous classes in `className`
|
31895 |
+
// set it to `undefined` to avoid rendering empty DOM attributes.
|
31896 |
+
|
31897 |
+
props.className = newClassName ? newClassName : undefined;
|
31898 |
+
return props;
|
31899 |
+
}
|
31900 |
+
/**
|
31901 |
+
* Generates a CSS class name consisting of all the applicable border color
|
31902 |
+
* classes given the current block attributes.
|
31903 |
+
*
|
31904 |
+
* @param {Object} attributes Block's attributes.
|
31905 |
+
*
|
31906 |
+
* @return {string} CSS class name.
|
31907 |
+
*/
|
31908 |
+
|
31909 |
+
|
31910 |
+
function getBorderClasses(attributes) {
|
31911 |
+
var _style$border3;
|
31912 |
+
|
31913 |
+
const {
|
31914 |
+
borderColor,
|
31915 |
+
style
|
31916 |
+
} = attributes;
|
31917 |
+
const borderColorClass = getColorClassName('border-color', borderColor);
|
31918 |
+
return classnames_default()({
|
31919 |
+
'has-border-color': borderColor || (style === null || style === void 0 ? void 0 : (_style$border3 = style.border) === null || _style$border3 === void 0 ? void 0 : _style$border3.color),
|
31920 |
+
[borderColorClass]: !!borderColorClass
|
31921 |
+
});
|
31922 |
+
}
|
31923 |
+
/**
|
31924 |
+
* Filters the registered block settings to apply border color styles and
|
31925 |
+
* classnames to the block edit wrapper.
|
31926 |
+
*
|
31927 |
+
* @param {Object} settings Original block settings.
|
31928 |
+
*
|
31929 |
+
* @return {Object} Filtered block settings.
|
31930 |
+
*/
|
31931 |
+
|
31932 |
+
function addEditProps(settings) {
|
31933 |
+
if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings, BORDER_SUPPORT_KEY, 'color')) {
|
31934 |
+
return settings;
|
31935 |
+
}
|
31936 |
+
|
31937 |
+
const existingGetEditWrapperProps = settings.getEditWrapperProps;
|
31938 |
+
|
31939 |
+
settings.getEditWrapperProps = attributes => {
|
31940 |
+
let props = {};
|
31941 |
+
|
31942 |
+
if (existingGetEditWrapperProps) {
|
31943 |
+
props = existingGetEditWrapperProps(attributes);
|
31944 |
+
}
|
31945 |
+
|
31946 |
+
return border_addSaveProps(props, settings, attributes);
|
31947 |
+
};
|
31948 |
+
|
31949 |
+
return settings;
|
31950 |
+
}
|
31951 |
+
/**
|
31952 |
+
* This adds inline styles for color palette colors.
|
31953 |
+
* Ideally, this is not needed and themes should load their palettes on the editor.
|
31954 |
+
*
|
31955 |
+
* @param {Function} BlockListBlock Original component.
|
31956 |
+
*
|
31957 |
+
* @return {Function} Wrapped component.
|
31958 |
+
*/
|
31959 |
+
|
31960 |
+
|
31961 |
+
const withBorderColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
|
31962 |
+
var _style$border4, _style$border4$top, _style$border5, _style$border5$right, _style$border6, _style$border6$bottom, _style$border7, _style$border7$left, _props$wrapperProps;
|
31963 |
+
|
31964 |
+
const {
|
31965 |
+
name,
|
31966 |
+
attributes
|
31967 |
+
} = props;
|
31968 |
+
const {
|
31969 |
+
borderColor,
|
31970 |
+
style
|
31971 |
+
} = attributes;
|
31972 |
+
const {
|
31973 |
+
colors
|
31974 |
+
} = useMultipleOriginColorsAndGradients();
|
31975 |
+
|
31976 |
+
if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name, BORDER_SUPPORT_KEY, 'color')) {
|
31977 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
|
31978 |
+
}
|
31979 |
+
|
31980 |
+
const {
|
31981 |
+
color: borderColorValue
|
31982 |
+
} = getMultiOriginColor({
|
31983 |
+
colors,
|
31984 |
+
namedColor: borderColor
|
31985 |
+
});
|
31986 |
+
const {
|
31987 |
+
color: borderTopColor
|
31988 |
+
} = getMultiOriginColor({
|
31989 |
+
colors,
|
31990 |
+
namedColor: getColorSlugFromVariable(style === null || style === void 0 ? void 0 : (_style$border4 = style.border) === null || _style$border4 === void 0 ? void 0 : (_style$border4$top = _style$border4.top) === null || _style$border4$top === void 0 ? void 0 : _style$border4$top.color)
|
31991 |
+
});
|
31992 |
+
const {
|
31993 |
+
color: borderRightColor
|
31994 |
+
} = getMultiOriginColor({
|
31995 |
+
colors,
|
31996 |
+
namedColor: getColorSlugFromVariable(style === null || style === void 0 ? void 0 : (_style$border5 = style.border) === null || _style$border5 === void 0 ? void 0 : (_style$border5$right = _style$border5.right) === null || _style$border5$right === void 0 ? void 0 : _style$border5$right.color)
|
31997 |
+
});
|
31998 |
+
const {
|
31999 |
+
color: borderBottomColor
|
32000 |
+
} = getMultiOriginColor({
|
32001 |
+
colors,
|
32002 |
+
namedColor: getColorSlugFromVariable(style === null || style === void 0 ? void 0 : (_style$border6 = style.border) === null || _style$border6 === void 0 ? void 0 : (_style$border6$bottom = _style$border6.bottom) === null || _style$border6$bottom === void 0 ? void 0 : _style$border6$bottom.color)
|
32003 |
+
});
|
32004 |
+
const {
|
32005 |
+
color: borderLeftColor
|
32006 |
+
} = getMultiOriginColor({
|
32007 |
+
colors,
|
32008 |
+
namedColor: getColorSlugFromVariable(style === null || style === void 0 ? void 0 : (_style$border7 = style.border) === null || _style$border7 === void 0 ? void 0 : (_style$border7$left = _style$border7.left) === null || _style$border7$left === void 0 ? void 0 : _style$border7$left.color)
|
32009 |
+
});
|
32010 |
+
const extraStyles = {
|
32011 |
+
borderTopColor: borderTopColor || borderColorValue,
|
32012 |
+
borderRightColor: borderRightColor || borderColorValue,
|
32013 |
+
borderBottomColor: borderBottomColor || borderColorValue,
|
32014 |
+
borderLeftColor: borderLeftColor || borderColorValue
|
32015 |
+
};
|
32016 |
+
let wrapperProps = props.wrapperProps;
|
32017 |
+
wrapperProps = { ...props.wrapperProps,
|
32018 |
+
style: { ...((_props$wrapperProps = props.wrapperProps) === null || _props$wrapperProps === void 0 ? void 0 : _props$wrapperProps.style),
|
32019 |
+
...extraStyles
|
32020 |
+
}
|
32021 |
+
};
|
32022 |
+
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
|
32023 |
+
wrapperProps: wrapperProps
|
32024 |
+
}));
|
32025 |
+
});
|
32026 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addAttributes', addAttributes);
|
32027 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/border/addSaveProps', border_addSaveProps);
|
32028 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addEditProps', addEditProps);
|
32029 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/border/with-border-color-palette-styles', withBorderColorPaletteStyles);
|
32030 |
|
32031 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/gradients/use-gradient.js
|
32032 |
/**
|
32263 |
|
32264 |
/* harmony default export */ var contrast_checker = (ContrastChecker);
|
32265 |
|
32266 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/control.js
|
32267 |
+
|
32268 |
+
|
32269 |
+
|
32270 |
+
/**
|
32271 |
+
* External dependencies
|
32272 |
+
*/
|
32273 |
+
|
32274 |
+
|
32275 |
+
/**
|
32276 |
+
* WordPress dependencies
|
32277 |
+
*/
|
32278 |
+
|
32279 |
+
|
32280 |
+
|
32281 |
+
|
32282 |
+
/**
|
32283 |
+
* Internal dependencies
|
32284 |
+
*/
|
32285 |
+
|
32286 |
+
|
32287 |
+
const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
|
32288 |
+
|
32289 |
+
function ColorGradientControlInner(_ref) {
|
32290 |
+
let {
|
32291 |
+
colors,
|
32292 |
+
gradients,
|
32293 |
+
disableCustomColors,
|
32294 |
+
disableCustomGradients,
|
32295 |
+
__experimentalHasMultipleOrigins,
|
32296 |
+
__experimentalIsRenderedInSidebar,
|
32297 |
+
className,
|
32298 |
+
label,
|
32299 |
+
onColorChange,
|
32300 |
+
onGradientChange,
|
32301 |
+
colorValue,
|
32302 |
+
gradientValue,
|
32303 |
+
clearable,
|
32304 |
+
showTitle = true,
|
32305 |
+
enableAlpha
|
32306 |
+
} = _ref;
|
32307 |
+
const canChooseAColor = onColorChange && (!(0,external_lodash_namespaceObject.isEmpty)(colors) || !disableCustomColors);
|
32308 |
+
const canChooseAGradient = onGradientChange && (!(0,external_lodash_namespaceObject.isEmpty)(gradients) || !disableCustomGradients);
|
32309 |
+
const [currentTab, setCurrentTab] = (0,external_wp_element_namespaceObject.useState)(gradientValue ? 'gradient' : !!canChooseAColor && 'color');
|
32310 |
+
|
32311 |
+
if (!canChooseAColor && !canChooseAGradient) {
|
32312 |
+
return null;
|
32313 |
+
}
|
32314 |
+
|
32315 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
32316 |
+
className: classnames_default()('block-editor-color-gradient-control', className)
|
32317 |
+
}, (0,external_wp_element_namespaceObject.createElement)("fieldset", {
|
32318 |
+
className: "block-editor-color-gradient-control__fieldset"
|
32319 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
32320 |
+
spacing: 1
|
32321 |
+
}, showTitle && (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
32322 |
+
className: "block-editor-color-gradient-control__color-indicator"
|
32323 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
|
32324 |
+
value: currentTab,
|
32325 |
+
onChange: setCurrentTab,
|
32326 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Select color type'),
|
32327 |
+
hideLabelFromVision: true,
|
32328 |
+
isBlock: true
|
32329 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
|
32330 |
+
value: "color",
|
32331 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Solid')
|
32332 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
|
32333 |
+
value: "gradient",
|
32334 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Gradient')
|
32335 |
+
})), (currentTab === 'color' || !canChooseAGradient) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorPalette, {
|
32336 |
+
value: colorValue,
|
32337 |
+
onChange: canChooseAGradient ? newColor => {
|
32338 |
+
onColorChange(newColor);
|
32339 |
+
onGradientChange();
|
32340 |
+
} : onColorChange,
|
32341 |
+
colors,
|
32342 |
+
disableCustomColors,
|
32343 |
+
__experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
|
32344 |
+
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
32345 |
+
clearable: clearable,
|
32346 |
+
enableAlpha: enableAlpha
|
32347 |
+
}), (currentTab === 'gradient' || !canChooseAColor) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.GradientPicker, {
|
32348 |
+
value: gradientValue,
|
32349 |
+
onChange: canChooseAColor ? newGradient => {
|
32350 |
+
onGradientChange(newGradient);
|
32351 |
+
onColorChange();
|
32352 |
+
} : onGradientChange,
|
32353 |
+
gradients,
|
32354 |
+
disableCustomGradients,
|
32355 |
+
__experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
|
32356 |
+
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
32357 |
+
clearable: clearable
|
32358 |
+
}))));
|
32359 |
+
}
|
32360 |
+
|
32361 |
+
function ColorGradientControlSelect(props) {
|
32362 |
+
const colorGradientSettings = {};
|
32363 |
+
colorGradientSettings.colors = useSetting('color.palette');
|
32364 |
+
colorGradientSettings.gradients = useSetting('color.gradients');
|
32365 |
+
colorGradientSettings.disableCustomColors = !useSetting('color.custom');
|
32366 |
+
colorGradientSettings.disableCustomGradients = !useSetting('color.customGradient');
|
32367 |
+
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, _extends({}, colorGradientSettings, props));
|
32368 |
+
}
|
32369 |
+
|
32370 |
+
function ColorGradientControl(props) {
|
32371 |
+
if ((0,external_lodash_namespaceObject.every)(colorsAndGradientKeys, key => props.hasOwnProperty(key))) {
|
32372 |
+
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, props);
|
32373 |
+
}
|
32374 |
+
|
32375 |
+
return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlSelect, props);
|
32376 |
+
}
|
32377 |
+
|
32378 |
+
/* harmony default export */ var control = (ColorGradientControl);
|
32379 |
+
|
32380 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/tools-panel-color-dropdown.js
|
32381 |
|
32382 |
|
35298 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls);
|
35299 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles);
|
35300 |
|
35301 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/filter.js
|
35302 |
+
|
35303 |
+
|
35304 |
+
/**
|
35305 |
+
* WordPress dependencies
|
35306 |
+
*/
|
35307 |
+
|
35308 |
+
const filter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
35309 |
+
xmlns: "http://www.w3.org/2000/svg",
|
35310 |
+
viewBox: "0 0 24 24"
|
35311 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
35312 |
+
d: "M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"
|
35313 |
+
}));
|
35314 |
+
/* harmony default export */ var library_filter = (filter);
|
35315 |
+
|
35316 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/duotone-control/index.js
|
35317 |
|
35318 |
|
35323 |
|
35324 |
|
35325 |
|
35326 |
+
|
35327 |
function DuotoneControl(_ref) {
|
35328 |
let {
|
35329 |
colorPalette,
|
35359 |
"aria-expanded": isOpen,
|
35360 |
onKeyDown: openOnArrowDown,
|
35361 |
label: (0,external_wp_i18n_namespaceObject.__)('Apply duotone filter'),
|
35362 |
+
icon: value ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DuotoneSwatch, {
|
35363 |
values: value
|
35364 |
+
}) : (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
35365 |
+
icon: library_filter
|
35366 |
})
|
35367 |
});
|
35368 |
},
|
35446 |
*/
|
35447 |
|
35448 |
/**
|
35449 |
+
* Stylesheet for rendering the duotone filter.
|
35450 |
*
|
35451 |
* @param {Object} props Duotone props.
|
35452 |
* @param {string} props.selector Selector to apply the filter to.
|
35453 |
* @param {string} props.id Unique id for this duotone filter.
|
|
|
35454 |
*
|
35455 |
* @return {WPElement} Duotone element.
|
35456 |
*/
|
35457 |
|
35458 |
+
function DuotoneStylesheet(_ref) {
|
35459 |
let {
|
35460 |
selector,
|
35461 |
+
id
|
|
|
35462 |
} = _ref;
|
35463 |
+
const css = `
|
35464 |
${selector} {
|
35465 |
filter: url( #${id} );
|
35466 |
}
|
35467 |
`;
|
35468 |
+
return (0,external_wp_element_namespaceObject.createElement)("style", null, css);
|
35469 |
+
}
|
35470 |
+
/**
|
35471 |
+
* SVG for rendering the duotone filter.
|
35472 |
+
*
|
35473 |
+
* @param {Object} props Duotone props.
|
35474 |
+
* @param {string} props.id Unique id for this duotone filter.
|
35475 |
+
* @param {Values} props.values R, G, B, and A values to filter with.
|
35476 |
+
*
|
35477 |
+
* @return {WPElement} Duotone element.
|
35478 |
+
*/
|
35479 |
+
|
35480 |
+
|
35481 |
+
function DuotoneFilter(_ref2) {
|
35482 |
+
let {
|
35483 |
+
id,
|
35484 |
+
values
|
35485 |
+
} = _ref2;
|
35486 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
|
35487 |
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
35488 |
viewBox: "0 0 0 0",
|
35489 |
width: "0",
|
35523 |
// Re-mask the image with the original transparency since the feColorMatrix above loses that information.
|
35524 |
in2: "SourceGraphic",
|
35525 |
operator: "in"
|
35526 |
+
}))));
|
35527 |
+
}
|
35528 |
+
/**
|
35529 |
+
* SVG and stylesheet needed for rendering the duotone filter.
|
35530 |
+
*
|
35531 |
+
* @param {Object} props Duotone props.
|
35532 |
+
* @param {string} props.selector Selector to apply the filter to.
|
35533 |
+
* @param {string} props.id Unique id for this duotone filter.
|
35534 |
+
* @param {Values} props.values R, G, B, and A values to filter with.
|
35535 |
+
*
|
35536 |
+
* @return {WPElement} Duotone element.
|
35537 |
+
*/
|
35538 |
+
|
35539 |
+
|
35540 |
+
function InlineDuotone(_ref3) {
|
35541 |
+
let {
|
35542 |
+
selector,
|
35543 |
+
id,
|
35544 |
+
values
|
35545 |
+
} = _ref3;
|
35546 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, {
|
35547 |
+
id: id,
|
35548 |
+
values: values
|
35549 |
+
}), (0,external_wp_element_namespaceObject.createElement)(DuotoneStylesheet, {
|
35550 |
+
id: id,
|
35551 |
+
selector: selector
|
35552 |
}));
|
35553 |
}
|
35554 |
|
35555 |
+
function useMultiOriginPresets(_ref4) {
|
35556 |
let {
|
35557 |
presetSetting,
|
35558 |
defaultSetting
|
35559 |
+
} = _ref4;
|
35560 |
const disableDefault = !useSetting(defaultSetting);
|
35561 |
const userPresets = useSetting(`${presetSetting}.custom`) || duotone_EMPTY_ARRAY;
|
35562 |
const themePresets = useSetting(`${presetSetting}.theme`) || duotone_EMPTY_ARRAY;
|
35564 |
return (0,external_wp_element_namespaceObject.useMemo)(() => [...userPresets, ...themePresets, ...(disableDefault ? duotone_EMPTY_ARRAY : defaultPresets)], [disableDefault, userPresets, themePresets, defaultPresets]);
|
35565 |
}
|
35566 |
|
35567 |
+
function DuotonePanel(_ref5) {
|
35568 |
var _style$color;
|
35569 |
|
35570 |
let {
|
35571 |
attributes,
|
35572 |
setAttributes
|
35573 |
+
} = _ref5;
|
35574 |
const style = attributes === null || attributes === void 0 ? void 0 : attributes.style;
|
35575 |
const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone;
|
35576 |
const duotonePalette = useMultiOriginPresets({
|
35705 |
const selectorsGroup = scopeSelector(`.editor-styles-wrapper .${id}`, duotoneSupport);
|
35706 |
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id);
|
35707 |
const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
|
35708 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(InlineDuotone, {
|
35709 |
selector: selectorsGroup,
|
35710 |
id: id,
|
35711 |
values: getValuesFromColors(values)
|
35713 |
className: className
|
35714 |
})));
|
35715 |
}, 'withDuotoneStyles');
|
35716 |
+
function PresetDuotoneFilter(_ref6) {
|
35717 |
+
let {
|
35718 |
+
preset
|
35719 |
+
} = _ref6;
|
35720 |
+
return (0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, {
|
35721 |
+
id: `wp-duotone-${preset.slug}`,
|
35722 |
+
values: getValuesFromColors(preset.colors)
|
35723 |
+
});
|
35724 |
+
}
|
35725 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes);
|
35726 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/duotone/with-editor-controls', withDuotoneControls);
|
35727 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/duotone/with-styles', withDuotoneStyles);
|
35942 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/layout/with-inspector-controls', withInspectorControls);
|
35943 |
|
35944 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/use-border-props.js
|
|
|
|
|
|
|
|
|
35945 |
/**
|
35946 |
* Internal dependencies
|
35947 |
*/
|
35948 |
|
35949 |
|
|
|
35950 |
// This utility is intended to assist where the serialization of the border
|
35951 |
// block support is being skipped for a block but the border related CSS classes
|
35952 |
// & styles still need to be generated so they can be applied to inner elements.
|
35953 |
|
|
|
35954 |
/**
|
35955 |
* Provides the CSS class names and inline styles for a block's border support
|
35956 |
* attributes.
|
35957 |
*
|
35958 |
+
* @param {Object} attributes Block attributes.
|
|
|
|
|
|
|
35959 |
* @return {Object} Border block support derived CSS classes & styles.
|
35960 |
*/
|
35961 |
|
35962 |
+
function getBorderClassesAndStyles(attributes) {
|
35963 |
+
var _attributes$style;
|
35964 |
|
35965 |
+
const border = ((_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.border) || {};
|
35966 |
+
const className = getBorderClasses(attributes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35967 |
return {
|
35968 |
className: className || undefined,
|
35969 |
style: getInlineStyles({
|
35970 |
+
border
|
35971 |
})
|
35972 |
};
|
35973 |
}
|
35984 |
*/
|
35985 |
|
35986 |
function useBorderProps(attributes) {
|
35987 |
+
const {
|
35988 |
+
colors
|
35989 |
+
} = useMultipleOriginColorsAndGradients();
|
35990 |
+
const borderProps = getBorderClassesAndStyles(attributes);
|
35991 |
+
const {
|
35992 |
+
borderColor
|
35993 |
+
} = attributes; // Force inline styles to apply named border colors when themes do not load
|
35994 |
+
// their color stylesheets in the editor.
|
35995 |
|
35996 |
+
if (borderColor) {
|
35997 |
+
const borderColorObject = getMultiOriginColor({
|
35998 |
+
colors,
|
35999 |
+
namedColor: borderColor
|
36000 |
+
});
|
36001 |
borderProps.style.borderColor = borderColorObject.color;
|
36002 |
}
|
36003 |
|
36194 |
|
36195 |
|
36196 |
|
36197 |
+
|
36198 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
|
36199 |
|
36200 |
|
39020 |
|
39021 |
|
39022 |
|
|
|
39023 |
/**
|
39024 |
* Internal dependencies
|
39025 |
*/
|
39120 |
onFocus: () => styleItemHandler(style),
|
39121 |
onMouseLeave: () => styleItemHandler(null),
|
39122 |
onBlur: () => styleItemHandler(null),
|
|
|
|
|
|
|
|
|
|
|
|
|
39123 |
onClick: () => onSelectStylePreview(style),
|
39124 |
+
"aria-current": activeStyle.name === style.name
|
|
|
39125 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
39126 |
as: "span",
|
39127 |
limit: 12,
|
39693 |
|
39694 |
/* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
|
39695 |
|
39696 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-solid.js
|
39697 |
+
|
39698 |
+
|
39699 |
+
/**
|
39700 |
+
* WordPress dependencies
|
39701 |
+
*/
|
39702 |
+
|
39703 |
+
const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
39704 |
+
xmlns: "http://www.w3.org/2000/svg",
|
39705 |
+
width: "24",
|
39706 |
+
height: "24",
|
39707 |
+
fill: "none"
|
39708 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
39709 |
+
d: "M5 11.25h14v1.5H5z"
|
39710 |
+
}));
|
39711 |
+
/* harmony default export */ var line_solid = (lineSolid);
|
39712 |
+
|
39713 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dashed.js
|
39714 |
+
|
39715 |
+
|
39716 |
+
/**
|
39717 |
+
* WordPress dependencies
|
39718 |
+
*/
|
39719 |
+
|
39720 |
+
const lineDashed = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
39721 |
+
xmlns: "http://www.w3.org/2000/svg",
|
39722 |
+
width: "24",
|
39723 |
+
height: "24",
|
39724 |
+
fill: "none"
|
39725 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
39726 |
+
fillRule: "evenodd",
|
39727 |
+
d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",
|
39728 |
+
clipRule: "evenodd"
|
39729 |
+
}));
|
39730 |
+
/* harmony default export */ var line_dashed = (lineDashed);
|
39731 |
+
|
39732 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dotted.js
|
39733 |
+
|
39734 |
+
|
39735 |
+
/**
|
39736 |
+
* WordPress dependencies
|
39737 |
+
*/
|
39738 |
+
|
39739 |
+
const lineDotted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
39740 |
+
xmlns: "http://www.w3.org/2000/svg",
|
39741 |
+
width: "24",
|
39742 |
+
height: "24",
|
39743 |
+
fill: "none"
|
39744 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
39745 |
+
fillRule: "evenodd",
|
39746 |
+
d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",
|
39747 |
+
clipRule: "evenodd"
|
39748 |
+
}));
|
39749 |
+
/* harmony default export */ var line_dotted = (lineDotted);
|
39750 |
+
|
39751 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-style-control/index.js
|
39752 |
+
|
39753 |
+
|
39754 |
+
/**
|
39755 |
+
* WordPress dependencies
|
39756 |
+
*/
|
39757 |
+
|
39758 |
+
|
39759 |
+
|
39760 |
+
const BORDER_STYLES = [{
|
39761 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Solid'),
|
39762 |
+
icon: line_solid,
|
39763 |
+
value: 'solid'
|
39764 |
+
}, {
|
39765 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Dashed'),
|
39766 |
+
icon: line_dashed,
|
39767 |
+
value: 'dashed'
|
39768 |
+
}, {
|
39769 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Dotted'),
|
39770 |
+
icon: line_dotted,
|
39771 |
+
value: 'dotted'
|
39772 |
+
}];
|
39773 |
+
/**
|
39774 |
+
* Control to display border style options.
|
39775 |
+
*
|
39776 |
+
* @param {Object} props Component props.
|
39777 |
+
* @param {Function} props.onChange Handler for changing border style selection.
|
39778 |
+
* @param {string} props.value Currently selected border style value.
|
39779 |
+
*
|
39780 |
+
* @return {WPElement} Custom border style segmented control.
|
39781 |
+
*/
|
39782 |
+
|
39783 |
+
function BorderStyleControl(_ref) {
|
39784 |
+
let {
|
39785 |
+
onChange,
|
39786 |
+
value
|
39787 |
+
} = _ref;
|
39788 |
+
return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
|
39789 |
+
className: "components-border-style-control"
|
39790 |
+
}, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Style')), (0,external_wp_element_namespaceObject.createElement)("div", {
|
39791 |
+
className: "components-border-style-control__buttons"
|
39792 |
+
}, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
39793 |
+
key: borderStyle.value,
|
39794 |
+
icon: borderStyle.icon,
|
39795 |
+
isSmall: true,
|
39796 |
+
isPressed: borderStyle.value === value,
|
39797 |
+
onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value),
|
39798 |
+
"aria-label": borderStyle.label
|
39799 |
+
}))));
|
39800 |
+
}
|
39801 |
+
|
39802 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
|
39803 |
|
39804 |
|
39991 |
}));
|
39992 |
}
|
39993 |
|
39994 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/dropdown.js
|
39995 |
+
|
39996 |
+
|
39997 |
+
|
39998 |
+
/**
|
39999 |
+
* External dependencies
|
40000 |
+
*/
|
40001 |
+
|
40002 |
+
/**
|
40003 |
+
* WordPress dependencies
|
40004 |
+
*/
|
40005 |
+
|
40006 |
+
|
40007 |
+
/**
|
40008 |
+
* Internal dependencies
|
40009 |
+
*/
|
40010 |
+
|
40011 |
+
|
40012 |
+
function ColorGradientSettingsDropdown(_ref) {
|
40013 |
+
let {
|
40014 |
+
colors,
|
40015 |
+
gradients,
|
40016 |
+
disableCustomColors,
|
40017 |
+
disableCustomGradients,
|
40018 |
+
__experimentalHasMultipleOrigins,
|
40019 |
+
__experimentalIsRenderedInSidebar,
|
40020 |
+
enableAlpha,
|
40021 |
+
settings
|
40022 |
+
} = _ref;
|
40023 |
+
let dropdownPosition;
|
40024 |
+
|
40025 |
+
if (__experimentalIsRenderedInSidebar) {
|
40026 |
+
dropdownPosition = 'bottom left';
|
40027 |
+
}
|
40028 |
+
|
40029 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
|
40030 |
+
isBordered: true,
|
40031 |
+
isSeparated: true,
|
40032 |
+
className: "block-editor-panel-color-gradient-settings__item-group"
|
40033 |
+
}, settings.map((setting, index) => setting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
40034 |
+
key: index,
|
40035 |
+
position: dropdownPosition,
|
40036 |
+
className: "block-editor-panel-color-gradient-settings__dropdown",
|
40037 |
+
contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content",
|
40038 |
+
renderToggle: _ref2 => {
|
40039 |
+
var _setting$gradientValu;
|
40040 |
+
|
40041 |
+
let {
|
40042 |
+
isOpen,
|
40043 |
+
onToggle
|
40044 |
+
} = _ref2;
|
40045 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItem, {
|
40046 |
+
onClick: onToggle,
|
40047 |
+
className: classnames_default()('block-editor-panel-color-gradient-settings__item', {
|
40048 |
+
'is-open': isOpen
|
40049 |
+
})
|
40050 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
40051 |
+
justify: "flex-start"
|
40052 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
40053 |
+
className: "block-editor-panel-color-gradient-settings__color-indicator",
|
40054 |
+
colorValue: (_setting$gradientValu = setting.gradientValue) !== null && _setting$gradientValu !== void 0 ? _setting$gradientValu : setting.colorValue
|
40055 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, setting.label)));
|
40056 |
+
},
|
40057 |
+
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(control, _extends({
|
40058 |
+
showTitle: false,
|
40059 |
+
colors,
|
40060 |
+
gradients,
|
40061 |
+
disableCustomColors,
|
40062 |
+
disableCustomGradients,
|
40063 |
+
__experimentalHasMultipleOrigins,
|
40064 |
+
__experimentalIsRenderedInSidebar,
|
40065 |
+
enableAlpha
|
40066 |
+
}, setting))
|
40067 |
+
})));
|
40068 |
+
}
|
40069 |
+
|
40070 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
|
40071 |
|
40072 |
|
43543 |
const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url);
|
43544 |
const isEndingEditWithFocus = (0,external_wp_element_namespaceObject.useRef)(false);
|
43545 |
const currentInputIsEmpty = !(currentInputValue !== null && currentInputValue !== void 0 && (_currentInputValue$tr = currentInputValue.trim()) !== null && _currentInputValue$tr !== void 0 && _currentInputValue$tr.length);
|
43546 |
+
const {
|
43547 |
+
createPage,
|
43548 |
+
isCreatingPage,
|
43549 |
+
errorMessage
|
43550 |
+
} = useCreatePage(createSuggestion);
|
43551 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
43552 |
if (forceIsEditingLink !== undefined && forceIsEditingLink !== isEditingLink) {
|
43553 |
setIsEditingLink(forceIsEditingLink);
|
43576 |
const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperNode.current)[whichFocusTargetIndex] || wrapperNode.current;
|
43577 |
nextFocusTarget.focus();
|
43578 |
isEndingEditWithFocus.current = false;
|
43579 |
+
}, [isEditingLink, isCreatingPage]);
|
43580 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
43581 |
/**
|
43582 |
* If the value's `text` property changes then sync this
|
43607 |
setIsEditingLink(false);
|
43608 |
}
|
43609 |
|
|
|
|
|
|
|
|
|
|
|
|
|
43610 |
const handleSelectSuggestion = updatedValue => {
|
43611 |
onChange({ ...updatedValue,
|
43612 |
title: internalTextValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title)
|
44760 |
}, []);
|
44761 |
}
|
44762 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44763 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-mark-persistent.js
|
44764 |
/**
|
44765 |
* WordPress dependencies
|
45886 |
|
45887 |
|
45888 |
|
|
|
45889 |
const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
|
45890 |
const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
|
45891 |
/**
|
46079 |
record: value,
|
46080 |
onChange
|
46081 |
});
|
|
|
|
|
|
|
46082 |
useMarkPersistent({
|
46083 |
html: adjustedValue,
|
46084 |
value
|
47618 |
__unstableContentRef: __unstableContentRef
|
47619 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, {
|
47620 |
name: "block-toolbar",
|
47621 |
+
ref: use_popover_scroll(__unstableContentRef)
|
47622 |
}), children, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover.Slot, {
|
47623 |
name: "__unstable-block-tools-after",
|
47624 |
+
ref: use_popover_scroll(__unstableContentRef)
|
47625 |
})))
|
47626 |
);
|
47627 |
}
|
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-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-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '0ea1dd48a433c928965110278f528535');
|
build/block-editor/index.min.js
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(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})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(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:function(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:function(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 f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+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();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},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:function(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:function(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),f=o.offset(e),g=o.outerHeight(e),h=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:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(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):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(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):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(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 f(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 g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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 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 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)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(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={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,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(g(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(g(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},h)},8575:function(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:function(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}},5372:function(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:function(e,t,n){e.exports=n(5372)()},9567:function(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:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(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={},f=!0,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!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(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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:function(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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return wv},AlignmentToolbar:function(){return Bv},Autocomplete:function(){return Av},BlockAlignmentControl:function(){return zr},BlockAlignmentToolbar:function(){return Vr},BlockBreadcrumb:function(){return Vv},BlockColorsStyleSelector:function(){return $v},BlockContextProvider:function(){return tl},BlockControls:function(){return lo},BlockEdit:function(){return ll},BlockEditorKeyboardShortcuts:function(){return my},BlockEditorProvider:function(){return Mc},BlockFormatControls:function(){return ro},BlockIcon:function(){return Tc},BlockInspector:function(){return cy},BlockList:function(){return Cf},BlockMover:function(){return Hp},BlockNavigationDropdown:function(){return db},BlockPreview:function(){return od},BlockSelectionClearer:function(){return Ac},BlockSettingsMenu:function(){return Gm},BlockSettingsMenuControls:function(){return Fm},BlockStyles:function(){return gb},BlockTitle:function(){return Ip},BlockToolbar:function(){return Qm},BlockTools:function(){return uy},BlockVerticalAlignmentControl:function(){return ur},BlockVerticalAlignmentToolbar:function(){return dr},ButtonBlockAppender:function(){return hp},ButtonBlockerAppender:function(){return gp},ColorPalette:function(){return Mb},ColorPaletteControl:function(){return Rb},ContrastChecker:function(){return hg},CopyHandler:function(){return ym},DefaultBlockAppender:function(){return mp},FontSizePicker:function(){return rh},InnerBlocks:function(){return kf},Inserter:function(){return pp},InspectorAdvancedControls:function(){return zo},InspectorControls:function(){return Vo},JustifyContentControl:function(){return fr},JustifyToolbar:function(){return gr},LineHeightControl:function(){return Vg},MediaPlaceholder:function(){return l_},MediaReplaceFlow:function(){return e_},MediaUpload:function(){return Zk},MediaUploadCheck:function(){return Jk},MultiSelectScrollIntoView:function(){return fy},NavigableToolbar:function(){return Pp},ObserveTyping:function(){return by},PanelColorSettings:function(){return i_},PlainText:function(){return A_},RichText:function(){return M_},RichTextShortcut:function(){return F_},RichTextToolbarButton:function(){return z_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return oy},ToolSelector:function(){return G_},Typewriter:function(){return Ey},URLInput:function(){return Tk},URLInputButton:function(){return j_},URLPopover:function(){return o_},Warning:function(){return sl},WritingFlow:function(){return qc},__experimentalBlockAlignmentMatrixControl:function(){return Fv},__experimentalBlockContentOverlay:function(){return Hv},__experimentalBlockFullHeightAligmentControl:function(){return Ov},__experimentalBlockPatternSetup:function(){return Ib},__experimentalBlockPatternsList:function(){return Bd},__experimentalBlockVariationPicker:function(){return vb},__experimentalBlockVariationTransforms:function(){return Nb},__experimentalBorderRadiusControl:function(){return Zf},__experimentalBorderStyleControl:function(){return rg},__experimentalColorGradientControl:function(){return Tf},__experimentalColorGradientSettingsDropdown:function(){return Nf},__experimentalDateFormatPicker:function(){return Db},__experimentalDuotoneControl:function(){return $h},__experimentalFontAppearanceControl:function(){return zg},__experimentalFontFamilyControl:function(){return Qg},__experimentalGetBorderClassesAndStyles:function(){return lv},__experimentalGetColorClassesAndStyles:function(){return sv},__experimentalGetGradientClass:function(){return dg},__experimentalGetGradientObjectByGradientValue:function(){return mg},__experimentalGetMatchingVariation:function(){return By},__experimentalGetSpacingClassesAndStyles:function(){return uv},__experimentalImageEditingProvider:function(){return dk},__experimentalImageEditor:function(){return yk},__experimentalImageSizeControl:function(){return Ck},__experimentalImageURLInputUI:function(){return ey},__experimentalLayoutStyle:function(){return Mr},__experimentalLetterSpacingControl:function(){return Bh},__experimentalLibrary:function(){return dy},__experimentalLinkControl:function(){return Yk},__experimentalLinkControlSearchInput:function(){return Hk},__experimentalLinkControlSearchItem:function(){return Mk},__experimentalLinkControlSearchResults:function(){return Ak},__experimentalListView:function(){return cb},__experimentalPanelColorGradientSettings:function(){return $b},__experimentalPreviewOptions:function(){return ty},__experimentalResponsiveBlockControl:function(){return O_},__experimentalTextDecorationControl:function(){return fh},__experimentalTextTransformControl:function(){return Eh},__experimentalToolsPanelColorDropdown:function(){return vg},__experimentalUnitControl:function(){return U_},__experimentalUseBlockPreview:function(){return rd},__experimentalUseBorderProps:function(){return iv},__experimentalUseColorProps:function(){return cv},__experimentalUseCustomSides:function(){return Zo},__experimentalUseGradient:function(){return gg},__experimentalUseNoRecursiveRenders:function(){return wy},__experimentalUseResizeCanvas:function(){return ny},__unstableBlockNameContext:function(){return Ym},__unstableBlockSettingsMenuFirstItem:function(){return Im},__unstableBlockToolbarLastItem:function(){return gm},__unstableEditorStyles:function(){return Ju},__unstableIframe:function(){return Xc},__unstableInserterMenuExtension:function(){return tp},__unstableRichTextInputEvent:function(){return V_},__unstableUseBlockSelectionClearer:function(){return Lc},__unstableUseClipboardHandler:function(){return _m},__unstableUseMouseMoveTypingReset:function(){return hy},__unstableUseTypewriter:function(){return yy},__unstableUseTypingObserver:function(){return vy},createCustomColorsHOC:function(){return gv},getColorClassName:function(){return Af},getColorObjectByAttributeValues:function(){return Rf},getColorObjectByColorValue:function(){return Lf},getFontSize:function(){return th},getFontSizeClass:function(){return oh},getFontSizeObjectByValue:function(){return nh},getGradientSlugByValue:function(){return fg},getGradientValueBySlug:function(){return pg},getPxFromCssUnit:function(){return Dy},store:function(){return Yn},storeConfig:function(){return qn},transformStyles:function(){return Qu},useBlockDisplayInformation:function(){return wp},useBlockEditContext:function(){return Jn},useBlockProps:function(){return bc},useCachedTruthy:function(){return dv},useInnerBlocksProps:function(){return bf},useSetting:function(){return xo},withColorContext:function(){return Pb},withColors:function(){return hv},withFontSizes:function(){return bv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Dt},__experimentalGetAllowedBlocks:function(){return ht},__experimentalGetAllowedPatterns:function(){return _t},__experimentalGetBlockListSettingsForBlocks:function(){return Bt},__experimentalGetDirectInsertBlock:function(){return vt},__experimentalGetGlobalBlocksByName:function(){return J},__experimentalGetLastBlockAttributeChanges:function(){return Tt},__experimentalGetParsedPattern:function(){return bt},__experimentalGetPatternTransformItems:function(){return Et},__experimentalGetPatternsByBlockTypes:function(){return yt},__experimentalGetReusableBlockTitle:function(){return It},__unstableGetBlockWithoutInnerBlocks:function(){return j},__unstableGetClientIdWithClientIdsTree:function(){return q},__unstableGetClientIdsTree:function(){return Y},__unstableGetSelectedBlocksWithPartialSelection:function(){return Pe},__unstableIsFullySelected:function(){return Te},__unstableIsLastBlockChangeIgnored:function(){return xt},__unstableIsSelectionMergeable:function(){return Ne},areInnerBlocksControlled:function(){return At},canEditBlock:function(){return it},canInsertBlockType:function(){return et},canInsertBlocks:function(){return tt},canLockBlockType:function(){return st},canMoveBlock:function(){return rt},canMoveBlocks:function(){return lt},canRemoveBlock:function(){return nt},canRemoveBlocks:function(){return ot},didAutomaticChange:function(){return Rt},getAdjacentBlockClientId:function(){return ge},getBlock:function(){return $},getBlockAttributes:function(){return W},getBlockCount:function(){return te},getBlockHierarchyRootClientId:function(){return me},getBlockIndex:function(){return Re},getBlockInsertionPoint:function(){return Ke},getBlockListSettings:function(){return Ct},getBlockMode:function(){return Ve},getBlockName:function(){return G},getBlockOrder:function(){return Me},getBlockParents:function(){return de},getBlockParentsByBlockName:function(){return pe},getBlockRootClientId:function(){return ue},getBlockSelectionEnd:function(){return le},getBlockSelectionStart:function(){return re},getBlockTransformItems:function(){return ft},getBlocks:function(){return K},getBlocksByClientId:function(){return ee},getClientIdsOfDescendants:function(){return Q},getClientIdsWithDescendants:function(){return X},getDraggedBlockClientIds:function(){return Ue},getFirstMultiSelectedBlockClientId:function(){return Ee},getGlobalBlockCount:function(){return Z},getInserterItems:function(){return mt},getLastMultiSelectedBlockClientId:function(){return Ce},getLowestCommonAncestorWithSelectedBlock:function(){return fe},getMultiSelectedBlockClientIds:function(){return _e},getMultiSelectedBlocks:function(){return ye},getMultiSelectedBlocksEndClientId:function(){return xe},getMultiSelectedBlocksStartClientId:function(){return Ie},getNextBlockClientId:function(){return ve},getPreviousBlockClientId:function(){return he},getSelectedBlock:function(){return ce},getSelectedBlockClientId:function(){return ae},getSelectedBlockClientIds:function(){return ke},getSelectedBlockCount:function(){return ie},getSelectedBlocksInitialCaretPosition:function(){return be},getSelectionEnd:function(){return oe},getSelectionStart:function(){return ne},getSettings:function(){return St},getTemplate:function(){return Qe},getTemplateLock:function(){return Xe},hasBlockMovingClientId:function(){return Mt},hasInserterItems:function(){return gt},hasMultiSelection:function(){return Oe},hasSelectedBlock:function(){return se},hasSelectedInnerBlock:function(){return Ae},isAncestorBeingDragged:function(){return $e},isAncestorMultiSelected:function(){return Be},isBlockBeingDragged:function(){return We},isBlockHighlighted:function(){return Lt},isBlockInsertionPointVisible:function(){return qe},isBlockMultiSelected:function(){return we},isBlockSelected:function(){return Le},isBlockValid:function(){return U},isBlockWithinSelection:function(){return De},isCaretWithinFormattedText:function(){return je},isDraggingBlocks:function(){return Ge},isFirstMultiSelectedBlock:function(){return Se},isLastBlockChangePersistent:function(){return wt},isMultiSelecting:function(){return Fe},isNavigationMode:function(){return Pt},isSelectionEnabled:function(){return ze},isTyping:function(){return He},isValidTemplate:function(){return Ye},wasBlockJustInserted:function(){return Ot}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return hn},__unstableExpandSelection:function(){return bn},__unstableMarkAutomaticChange:function(){return Fn},__unstableMarkLastChangeAsPersistent:function(){return Dn},__unstableMarkNextChangeAsNotPersistent:function(){return On},__unstableSaveReusableBlock:function(){return An},__unstableSplitSelection:function(){return vn},clearSelectedBlock:function(){return Jt},duplicateBlocks:function(){return Hn},enterFormattedText:function(){return Tn},exitFormattedText:function(){return Nn},flashBlock:function(){return $n},hideInsertionPoint:function(){return mn},insertAfterBlock:function(){return Un},insertBeforeBlock:function(){return Gn},insertBlock:function(){return un},insertBlocks:function(){return dn},insertDefaultBlock:function(){return Mn},mergeBlocks:function(){return kn},moveBlockToPosition:function(){return cn},moveBlocksDown:function(){return ln},moveBlocksToPosition:function(){return an},moveBlocksUp:function(){return sn},multiSelect:function(){return Zt},receiveBlocks:function(){return Wt},removeBlock:function(){return En},removeBlocks:function(){return yn},replaceBlock:function(){return on},replaceBlocks:function(){return nn},replaceInnerBlocks:function(){return Cn},resetBlocks:function(){return Ht},resetSelection:function(){return Ut},selectBlock:function(){return Kt},selectNextBlock:function(){return Yt},selectPreviousBlock:function(){return qt},selectionChange:function(){return Pn},setBlockMovingClientId:function(){return Vn},setHasControlledInnerBlocks:function(){return jn},setNavigationMode:function(){return zn},setTemplateValidity:function(){return fn},showInsertionPoint:function(){return pn},startDraggingBlocks:function(){return In},startMultiSelect:function(){return Qt},startTyping:function(){return wn},stopDraggingBlocks:function(){return xn},stopMultiSelect:function(){return Xt},stopTyping:function(){return Bn},synchronizeTemplate:function(){return gn},toggleBlockHighlight:function(){return Wn},toggleBlockMode:function(){return Sn},toggleSelection:function(){return en},updateBlock:function(){return jt},updateBlockAttributes:function(){return $t},updateBlockListSettings:function(){return Rn},updateSettings:function(){return Ln},validateBlocksToTemplate:function(){return Gt}});var 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}).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}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(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)}function _(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,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(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 I(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 x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(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=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(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=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(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:!w(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,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);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=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){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}var N,P,M=(0,m.combineReducers)({blocks:x,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},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}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:T(r.selectionStart,l),selectionEnd:T(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;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,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,m.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(e,t){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 null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode: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_NAVIGATION_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"START_TYPING":case"STOP_TYPING":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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(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 D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(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(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(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;function V(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const H=[];function G(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 U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function W(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const j=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&At(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=D(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Q=D(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=D((e=>{const t=[];for(const n of Me(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),Z=D(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),J=D(((e,t)=>{if(!t)return H;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Me(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){return _e(e).length||(e.selection.selectionStart.clientId?1:0)}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=ae(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=D((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])),pe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(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 me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function fe(e,t){const n=ae(e),o=[...de(e,t),t],r=[...de(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 ge(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ae(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(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 he(e,t){return ge(e,t,-1)}function ve(e,t){return ge(e,t,1)}function be(e){return e.initialPosition}const ke=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Me(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 _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=D((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function Se(e,t){return Ee(e)===t}function we(e,t){return-1!==_e(e).indexOf(t)}const Be=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=we(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e,t){const n=ne(e),o=oe(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=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Me(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=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Pe=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=$(e,a.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...V(h)}),k=(0,z.create)({html:g,...V(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,...V(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...V(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||H}function Re(e,t){return Me(e,ue(e,t)).indexOf(t)}function Le(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ae(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>Le(e,t)||we(e,t)||n&&Ae(e,t,n)))}function De(e,t){if(!t)return!1;const n=_e(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Oe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Fe(e){return e.isMultiSelecting}function ze(e){return e.isSelectionEnabled}function Ve(e,t){return e.blocksMode[t]||"visual"}function He(e){return e.isTyping}function Ge(e){return!!e.draggedBlocks.length}function Ue(e){return e.draggedBlocks}function We(e,t){return e.draggedBlocks.includes(t)}function $e(e,t){if(!Ge(e))return!1;const n=de(e,t);return(0,u.some)(n,(t=>We(e,t)))}function je(e){return e.isCaretWithinFormattedText}function Ke(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Re(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function qe(e){return null!==e.insertionPoint}function Ye(e){return e.template.isValid}function Qe(e){return e.settings.template}function Xe(e,t){if(!t)return e.settings.templateLock;const n=Ct(e,t);return n?n.templateLock:null}const Ze=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Je=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}=St(e),s=Ze(i,t,!0);if(!s)return!1;const a=!!Xe(e,o);if(a)return!1;const c=Ct(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Ze(d,t),m=n.parent,f=G(e,o),g=Ze(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];h=(0,u.some)(t,(t=>Ze(v,G(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},et=D(Je,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function tt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>et(e,G(e,t),n)))}function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,t,n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function it(e,t){const n=W(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function st(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function at(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 ct=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Je(e,t.name,n),ut=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=at(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:dt(r,l)}},dt=(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}},pt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ee(e,X(e)),{name:t.name}));const{time:i,count:s=0}=at(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:dt(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}}},mt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=pt(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=F;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}=at(e,l)||{},c=dt(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=>ct(e,n,t))).map(n),a=Je(e,"core/block",t)?Nt(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=ut(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,Nt(e),(0,r.getBlockTypes)()])),ft=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=pt(e,{buildScope:"transform"}),s=(0,r.getBlockTypes)().filter((t=>ct(e,t,o))).map(i),a=(0,u.mapKeys)(s,(e=>{let{name:t}=e;return t}));a["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=a[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(a["*"]):a[null==t?void 0:t.name]&&e.push(a[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>a[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),gt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ct(e,n,t)));if(n)return!0;const o=Je(e,"core/block",t)&&Nt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Nt(e),(0,r.getBlockTypes)()])),ht=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>ct(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),bt=D(((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])),kt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=St(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return bt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Ze(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)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),_t=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=kt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return et(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),yt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=_t(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)=>[..._t.getDependants(e,t)])),Et=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||At(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return yt(e,o,n)}),((e,t)=>[...yt.getDependants(e,t)]));function Ct(e,t){return e.blockListSettings[t]}function St(e){return e.settings}function wt(e){return e.blocks.isPersistentChange}const Bt=D((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])),It=D(((e,t)=>{var n;const o=(0,u.find)(Nt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Nt(e)]));function xt(e){return e.blocks.isIgnoredChange}function Tt(e){return e.lastBlockAttributesChange}function Nt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Pt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function Rt(e){return!!e.automaticChangeStatus}function Lt(e,t){return e.highlightedBlock===t}function At(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Dt=D(((e,t)=>{if(!t.length)return null;const n=ae(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ot(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ft=window.wp.a11y,zt=window.wp.deprecated,Vt=n.n(zt);const Ht=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Gt(e))},Gt=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 Ut(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Wt(e){return Vt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $t(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function jt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Kt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Qt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Zt=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,Ft.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function Jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function en(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function tn(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 nn=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=(0,u.castArray)(e),t=tn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));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 on(e,t){return nn(e,t)}const rn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},ln=rn("MOVE_BLOCKS_DOWN"),sn=rn("MOVE_BLOCKS_UP"),an=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 cn(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 an([e],t,n,o)}function un(e,t,n,o,r){return dn([e],t,n,o,0,r)}const dn=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;(0,u.isObject)(r)&&(l=r,r=0,Vt()("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=tn((0,u.castArray)(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 pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function mn(){return{type:"HIDE_INSERTION_POINT"}}function fn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const gn=()=>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)},hn=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 d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...V(S)}),I=(0,z.create)({html:C,...V(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...V(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...V(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf(""))),L=M[R],A=(0,z.create)({html:L,...V(g.attributes[R])}),D=A.text.indexOf(""),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...V(g.attributes[R])});M[R]=F;const H=o.getSelectedBlockClientIds(),G=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(H,G,0,o.getSelectedBlocksInitialCaretPosition())}))},vn=()=>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),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...V(b)}),y=(0,z.create)({html:v,...V(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:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},kn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?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 g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...V(v)}),"",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...V(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],n=(0,z.create)({html:t,...V(d.attributes[e])}),o=n.text.indexOf(""),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...V(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},yn=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=(0,u.castArray)(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 En(e,t){return yn([e],t)}function Cn(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 Sn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function wn(){return{type:"START_TYPING"}}function Bn(){return{type:"STOP_TYPING"}}function In(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function xn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Tn(){return{type:"ENTER_FORMATTED_TEXT"}}function Nn(){return{type:"EXIT_FORMATTED_TEXT"}}function Pn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Mn=(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 Rn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ln(e){return{type:"UPDATE_SETTINGS",settings:e}}function An(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Dn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function On(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Fn=()=>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({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ft.speak)((0,g.__)("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.")):(0,Ft.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Vn=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,Ft.speak)((0,g.__)("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."))}},Hn=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((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Gn=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)},Un=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 Wn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const $n=e=>async t=>{let{dispatch:n}=t;n(Wn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Wn(e,!1))};function jn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const Kn="core/block-editor",qn={reducer:M,selectors:e,actions:t},Yn=(0,m.createReduxStore)(Kn,{...qn,persist:["preferences"]});(0,m.registerStore)(Kn,{...qn,persist:["preferences"]});const Qn={name:"",isSelected:!1},Xn=(0,s.createContext)(Qn),{Provider:Zn}=Xn;function Jn(){return(0,s.useContext)(Xn)}function eo(){const{isSelected:e,clientId:t,name:n}=Jn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Yn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function to(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=eo(),{clientId:o}=Jn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Yn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function no(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const oo=to;oo.Slot=no;const ro=e=>(0,s.createElement)(to,i({group:"inline"},e));ro.Slot=e=>(0,s.createElement)(no,i({group:"inline"},e));var lo=oo,io=(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"})),so=(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"})),ao=(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"})),co=(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"})),uo=(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"})),po=(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"})),mo=(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"})),fo=(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"})),go=(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"})),ho=(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"})),vo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),bo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const _o=(0,s.createContext)({refs:new Map,callbacks:new Map});function yo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(_o.Provider,{value:n},t)}function Eo(e){const{refs:t,callbacks:n}=(0,s.useContext)(_o),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Co(e){const{refs:t}=(0,s.useContext)(_o),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function So(e){const{callbacks:t}=(0,s.useContext)(_o),n=Co(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const wo=["color","border","typography","spacing"],Bo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0: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=>void 0===e.fontSizes?void 0: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},Io={"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 xo(e){const{name:t}=Jn();return(0,m.useSelect)((n=>{var o;if(wo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Yn).getSettings(),i=(e=>Io[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=Bo[i]?Bo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var To={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function No(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=eo(),l=null===(t=To[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Po=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Po),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Mo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Ro(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Mo(c.attributes,e,t)})}))})),c}function Lo(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 Ao(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Yn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Yn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Po(r.style)},t[n]=r})),r(n,t,!0)}),[Po,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Do(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Oo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=To[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Ao,{group:n,label:o},(0,s.createElement)(Do,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Fo=No;Fo.Slot=Oo;const zo=e=>(0,s.createElement)(No,i({},e,{__experimentalGroup:"advanced"}));zo.Slot=e=>(0,s.createElement)(Oo,i({},e,{__experimentalGroup:"advanced"})),zo.slotName="InspectorAdvancedControls";var Vo=Fo;function Ho(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.margin)}function Go(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.margin"),n=!Jo(e,"margin");return!Ho(e)||t||n}function Uo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),i=Zo(n,"margin"),a=i&&i.some((e=>Yo.includes(e)));return Go(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Po(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Po(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Wo(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.padding)}function $o(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.padding"),n=!Jo(e,"padding");return!Wo(e)||t||n}function jo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),i=Zo(n,"padding"),a=i&&i.some((e=>Yo.includes(e)));return $o(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Po(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Po(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ko="spacing",qo=["top","right","bottom","left"],Yo=["vertical","horizontal"];function Qo(e){const t=nr(e),n=$o(e),o=Go(e),l=Xo(e),i=(a=e.name,"web"===s.Platform.OS&&(er(a)||Wo(a)||Ho(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ko,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(Vo,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(jo,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Uo,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("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:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(or,e)))}const Xo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=nr(e),n=$o(e),o=Go(e);return t&&n&&o};function Zo(e,t){const n=(0,r.getBlockSupport)(e,Ko);if(n&&"boolean"!=typeof n[t])return n[t]}function Jo(e,t){const n=Zo(e,t);return!(n&&n.some((e=>qo.includes(e)))&&n.some((e=>Yo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function er(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.blockGap)}function tr(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 nr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.blockGap");return!er(e)||t}function or(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),a=Zo(r,"blockGap"),c=Co(n);if(nr(e))return null;const u=a&&a.some((e=>Yo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...tr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Po(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;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=tr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const rr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),lr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),ir={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:lr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:rr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},sr=["top","center","bottom"],ar={isAlternate:!0};var cr=function(e){let{value:t,onChange:n,controls:o=sr,isCollapsed:r=!0,isToolbar:l}=e;const a=ir[t],c=ir.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:ar,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ir[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const ur=e=>(0,s.createElement)(cr,i({},e,{isToolbar:!1})),dr=e=>(0,s.createElement)(cr,i({},e,{isToolbar:!0})),pr={left:mo,center:fo,right:go,"space-between":ho};var mr=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?pr[r]:pr.left,d=[{name:"left",icon:mo,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:fo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:go,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:ho,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const fr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!1})),gr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!0})),hr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},vr={left:"flex-start",right:"flex-end",center:"center"},br={top:"flex-start",center:"center",bottom:"flex-end"},kr=["wrap","nowrap"];var _r={name:"flex",label:(0,g.__)("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)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Er,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Sr,{layout:t,onChange:n}))),(0,s.createElement)(Cr,{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)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Er,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(yr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==xo("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Lo(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=tr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=hr[r.justifyContent]||hr.left,p=kr.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${br[r.verticalAlignment]||br.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${vr[r.justifyContent]||vr.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ko(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${ko(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function yr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=br.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(ur,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Er(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)(fr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,g.__)("Justify items left")},{value:"center",icon:fo,label:(0,g.__)("Justify items center")},{value:"right",icon:go,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:ho,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Cr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Sr(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Br=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("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)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wr,{icon:ao})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wr,{icon:uo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==xo("spacing.blockGap"),u=tr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Lo(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${ko(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${ko(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${ko(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${ko(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${ko(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${ko(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${ko(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(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,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(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}},_r];function Ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Br.find((t=>t.name===e))}const xr={type:"default"},Tr=(0,s.createContext)(xr),Nr=Tr.Provider;function Pr(){return(0,s.useContext)(Tr)}function Mr(e){let{layout:t={},...n}=e;const o=Ir(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Rr=["none","left","center","right","wide","full"],Lr=["wide","full"];function Ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Pr(),r=Ir(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)return[];const{alignments:i=Rr}=o,s=e.filter((e=>(o.alignments||t||!Lr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Dr={none:{icon:io,title:(0,g._x)("None","Alignment option")},left:{icon:so,title:(0,g.__)("Align left")},center:{icon:ao,title:(0,g.__)("Align center")},right:{icon:co,title:(0,g.__)("Align right")},wide:{icon:uo,title:(0,g.__)("Wide width")},full:{icon:po,title:(0,g.__)("Full width")}},Or={isAlternate:!0};var Fr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ar(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Dr[t],m=Dr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Or,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Dr[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Dr[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.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)(f,i({},h,v))};const zr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!1})),Vr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!0})),Hr=["left","center","right","wide","full"],Gr=["wide","full"];function Ur(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)?Hr.filter((t=>e.includes(t))):!0===e?[...Hr]:[],!o||!0===e&&!n?(0,u.without)(t,...Gr):t}const Wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ar(Ur((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zr,{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:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ar(Ur((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){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Hr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$r),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ur((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){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const jr=/[\s#]/g,Kr={type:"string",source:"attribute",attribute:"id",selector:"*"},qr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(jr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Vo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Vo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Kr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",qr),(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 Yr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Vo,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");function Qr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Yr),(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=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Xr=[{name:"margin",generate:(e,t)=>Qr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Qr(e,t,["spacing","padding"],"padding")}];function Zr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Jr=window.wp.dom;const el=(0,s.createContext)({});function tl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(el),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(el.Provider,{value:r,children:n})}var nl=el;const ol={};var rl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(nl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ol),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function ll(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Zn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(rl,e))}var il=(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"})),sl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(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)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:il,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},al=n(1973);function cl(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,Jr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var ul=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,al.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(cl,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(cl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const dl=e=>(0,r.rawHandler)({HTML:e.originalContent});var pl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Yn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Yn);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,dl(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)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
-
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
10 |
-
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(ul,{block:i,onKeep:t,onConvert:n,convertor:dl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const ml=(0,s.createElement)(sl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var fl=()=>ml;class gl 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}}var hl=gl,vl=n(773),bl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Yn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Yn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(vl.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 kl=Ll();const _l=e=>Nl(e,kl);let yl=Ll();_l.write=e=>Nl(e,yl);let El=Ll();_l.onStart=e=>Nl(e,El);let Cl=Ll();_l.onFrame=e=>Nl(e,Cl);let Sl=Ll();_l.onFinish=e=>Nl(e,Sl);let wl=[];_l.setTimeout=(e,t)=>{let n=_l.now()+t,o=()=>{let e=wl.findIndex((e=>e.cancel==o));~e&&wl.splice(e,1),Dl.count-=~e?1:0},r={time:n,handler:e,cancel:o};return wl.splice(Bl(n),0,r),Dl.count+=1,Pl(),r};let Bl=e=>~(~wl.findIndex((t=>t.time>e))||~wl.length);_l.cancel=e=>{kl.delete(e),yl.delete(e)},_l.sync=e=>{Tl=!0,_l.batchedUpdates(e),Tl=!1},_l.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,_l.onStart(n)}return o.handler=e,o.cancel=()=>{El.delete(n),t=null},o};let Il="undefined"!=typeof window?window.requestAnimationFrame:()=>{};_l.use=e=>Il=e,_l.now="undefined"!=typeof performance?()=>performance.now():Date.now,_l.batchedUpdates=e=>e(),_l.catch=console.error,_l.frameLoop="always",_l.advance=()=>{"demand"!==_l.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Rl()};let xl=-1,Tl=!1;function Nl(e,t){Tl?(t.delete(e),e(0)):(t.add(e),Pl())}function Pl(){xl<0&&(xl=0,"demand"!==_l.frameLoop&&Il(Ml))}function Ml(){~xl&&(Il(Ml),_l.batchedUpdates(Rl))}function Rl(){let e=xl;xl=_l.now();let t=Bl(xl);t&&(Al(wl.splice(0,t),(e=>e.handler())),Dl.count-=t),El.flush(),kl.flush(e?Math.min(64,xl-e):16.667),Cl.flush(),yl.flush(),Sl.flush()}function Ll(){let e=new Set,t=e;return{add(n){Dl.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Dl.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Dl.count-=t.size,Al(t,(t=>t(n)&&e.add(t))),Dl.count+=e.size,t=e)}}}function Al(e,t){e.forEach((e=>{try{t(e)}catch(e){_l.catch(e)}}))}const Dl={count:0,clear(){xl=-1,wl=[],El=Ll(),kl=Ll(),Cl=Ll(),yl=Ll(),Sl=Ll(),Dl.count=0}};var Ol=n(9196),Fl=n.n(Ol);function zl(){}const Vl={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 Hl(e,t){if(Vl.arr(e)){if(!Vl.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 Gl=(e,t)=>e.forEach(t);function Ul(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Wl=e=>Vl.und(e)?[]:Vl.arr(e)?e:[e];function $l(e,t){if(e.size){const n=Array.from(e);e.clear(),Gl(n,t)}}const jl=(e,...t)=>$l(e,(e=>e(...t)));let Kl,ql,Yl=null,Ql=!1,Xl=zl;var Zl=Object.freeze({__proto__:null,get createStringInterpolator(){return Kl},get to(){return ql},get colors(){return Yl},get skipAnimation(){return Ql},get willAdvance(){return Xl},assign:e=>{e.to&&(ql=e.to),e.now&&(_l.now=e.now),void 0!==e.colors&&(Yl=e.colors),null!=e.skipAnimation&&(Ql=e.skipAnimation),e.createStringInterpolator&&(Kl=e.createStringInterpolator),e.requestAnimationFrame&&_l.use(e.requestAnimationFrame),e.batchedUpdates&&(_l.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Xl=e.willAdvance),e.frameLoop&&(_l.frameLoop=e.frameLoop)}});const Jl=new Set;let ei=[],ti=[],ni=0;const oi={get idle(){return!Jl.size&&!ei.length},start(e){ni>e.priority?(Jl.add(e),_l.onStart(ri)):(li(e),_l(si))},advance:si,sort(e){if(ni)_l.onFrame((()=>oi.sort(e)));else{const t=ei.indexOf(e);~t&&(ei.splice(t,1),ii(e))}},clear(){ei=[],Jl.clear()}};function ri(){Jl.forEach(li),Jl.clear(),_l(si)}function li(e){ei.includes(e)||ii(e)}function ii(e){ei.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ei),0,e)}function si(e){const t=ti;for(let n=0;n<ei.length;n++){const o=ei[n];ni=o.priority,o.idle||(Xl(o),o.advance(e),o.idle||t.push(o))}return ni=0,ti=ei,ti.length=0,ei=t,ei.length>0}const ai="[-+]?\\d*\\.?\\d+",ci=ai+"%";function ui(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const di=new RegExp("rgb"+ui(ai,ai,ai)),pi=new RegExp("rgba"+ui(ai,ai,ai,ai)),mi=new RegExp("hsl"+ui(ai,ci,ci)),fi=new RegExp("hsla"+ui(ai,ci,ci,ai)),gi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vi=/^#([0-9a-fA-F]{6})$/,bi=/^#([0-9a-fA-F]{8})$/;function ki(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 _i(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=ki(r,o,e+1/3),i=ki(r,o,e),s=ki(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function yi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ei(e){return(parseFloat(e)%360+360)%360/360}function Ci(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Si(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function wi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=vi.exec(e))?parseInt(t[1]+"ff",16)>>>0:Yl&&void 0!==Yl[e]?Yl[e]:(t=di.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|255)>>>0:(t=pi.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|Ci(t[4]))>>>0:(t=gi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bi.exec(e))?parseInt(t[1],16)>>>0:(t=hi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=mi.exec(e))?(255|_i(Ei(t[1]),Si(t[2]),Si(t[3])))>>>0:(t=fi.exec(e))?(_i(Ei(t[1]),Si(t[2]),Si(t[3]))|Ci(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 Bi=(e,t,n)=>{if(Vl.fun(e))return e;if(Vl.arr(e))return Bi({range:e,output:t,extrapolate:n});if(Vl.str(e.output[0]))return Kl(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 Ii(){return(Ii=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}).apply(this,arguments)}const xi=Symbol.for("FluidValue.get"),Ti=Symbol.for("FluidValue.observers"),Ni=e=>Boolean(e&&e[xi]),Pi=e=>e&&e[xi]?e[xi]():e,Mi=e=>e[Ti]||null;function Ri(e,t){let n=e[Ti];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Li{constructor(e){if(this[xi]=void 0,this[Ti]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ai(this,e)}}const Ai=(e,t)=>Fi(e,xi,t);function Di(e,t){if(e[xi]){let n=e[Ti];n||Fi(e,Ti,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Oi(e,t){let n=e[Ti];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ti]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Fi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),zi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Hi;const Gi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ui=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Wi=e=>{Hi||(Hi=Yl?new RegExp(`(${Object.keys(Yl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Pi(e).replace(Vi,wi).replace(Hi,wi))),n=t.map((e=>e.match(zi).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]})))).map((t=>Bi(Ii({},e,{output:t}))));return e=>{let n=0;return t[0].replace(zi,(()=>String(o[n++](e)))).replace(Gi,Ui)}},$i="react-spring: ",ji=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${$i}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ki=ji(console.warn),qi=ji(console.warn);function Yi(e){return Vl.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Yl||{}))}const Qi=e=>(0,Ol.useEffect)(e,Xi),Xi=[];function Zi(){const e=(0,Ol.useState)()[1],t=(0,Ol.useState)(Ji)[0];return Qi(t.unmount),()=>{t.current&&e({})}}function Ji(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function es(e){const t=(0,Ol.useRef)();return(0,Ol.useEffect)((()=>{t.current=e})),t.current}const ts="undefined"!=typeof window&&window.document&&window.document.createElement?Ol.useLayoutEffect:Ol.useEffect,ns=Symbol.for("Animated:node"),os=e=>e&&e[ns],rs=(e,t)=>{return n=e,o=ns,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ls=e=>e&&e[ns]&&e[ns].getPayload();class is{constructor(){this.payload=void 0,rs(this,this)}getPayload(){return this.payload||[]}}class ss extends is{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,Vl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new ss(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Vl.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,Vl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class as extends ss{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Bi({output:[e,e]})}static create(e){return new as(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Vl.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=Bi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const cs={dependencies:null};class us extends is{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ul(this.source,((n,o)=>{var r;(r=n)&&r[ns]===r?t[o]=n.getValue(e):Ni(n)?t[o]=Pi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Gl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ul(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){cs.dependencies&&Ni(e)&&cs.dependencies.add(e);const t=ls(e);t&&Gl(t,(e=>this.add(e)))}}class ds extends us{constructor(e){super(e)}static create(e){return new ds(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(ps)),!0)}}function ps(e){return(Yi(e)?as:ss).create(e)}function ms(e){const t=os(e);return t?t.constructor:Vl.arr(e)?ds:Yi(e)?as:ss}function fs(){return(fs=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}).apply(this,arguments)}const gs=(e,t)=>{const n=!Vl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ol.forwardRef)(((o,r)=>{const l=(0,Ol.useRef)(null),i=n&&(0,Ol.useCallback)((e=>{l.current=function(e,t){return e&&(Vl.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return cs.dependencies=n,e.style&&(e=fs({},e,{style:t.createAnimatedStyle(e.style)})),e=new us(e),cs.dependencies=null,[e,n]}(o,t),c=Zi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new hs(u,a),p=(0,Ol.useRef)();ts((()=>{const e=p.current;p.current=d,Gl(a,(e=>Di(e,d))),e&&(Gl(e.deps,(t=>Oi(t,e))),_l.cancel(e.update))})),(0,Ol.useEffect)(u,[]),Qi((()=>()=>{const e=p.current;Gl(e.deps,(t=>Oi(t,e)))}));const m=t.getComponentProps(s.getValue());return Ol.createElement(e,fs({},m,{ref:i}))}))};class hs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&_l.write(this.update)}}const vs=Symbol.for("AnimatedComponent"),bs=e=>Vl.str(e)?e:e&&Vl.str(e.displayName)?e.displayName:Vl.fun(e)&&e.name||null;function ks(){return(ks=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}).apply(this,arguments)}function _s(e,...t){return Vl.fun(e)?e(...t):e}const ys=(e,t)=>!0===e||!!(t&&e&&(Vl.fun(e)?e(t):Wl(e).includes(t))),Es=(e,t)=>Vl.obj(e)?t&&e[t]:e,Cs=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ss=e=>e,ws=(e,t=Ss)=>{let n=Bs;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);Vl.und(n)||(o[r]=n)}return o},Bs=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Is={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 xs(e){const t=function(e){const t={};let n=0;if(Ul(e,((e,o)=>{Is[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ul(e,((e,o)=>o in t||(n[o]=e))),n}return ks({},e)}function Ts(e){return e=Pi(e),Vl.arr(e)?e.map(Ts):Yi(e)?Zl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ns(e){for(const t in e)return!0;return!1}function Ps(e){return Vl.fun(e)||Vl.arr(e)&&Vl.obj(e[0])}function Ms(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Rs(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ls=ks({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class As{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,Ls)}}function Ds(e,t){if(Vl.und(t.decay)){const n=!Vl.und(t.tension)||!Vl.und(t.friction);!n&&Vl.und(t.frequency)&&Vl.und(t.damping)&&Vl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Os=[];class Fs{constructor(){this.changed=!1,this.values=Os,this.toValues=null,this.fromValues=Os,this.to=void 0,this.from=void 0,this.config=new As,this.immediate=!1}}function zs(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ys(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Vl.und(n.pause)||(r.paused=ys(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ys(e,t)),c=_s(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-_l.now()}function m(){c>0?(u=_l.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(ks({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Vs=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Us(e.get()):t.every((e=>e.noop))?Hs(e.get()):Gs(e.get(),t.every((e=>e.finished))),Hs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Gs=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Us=e=>({value:e,cancelled:!0,finished:!1});function Ws(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=ws(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)&&Us(o)||r!==n.asyncId&&Gs(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new js,i=new Ks;return(async()=>{if(Zl.skipAnimation)throw $s(n),i.result=Gs(o,!1),d(i),i;m(l);const s=Vl.obj(e)?ks({},e):ks({},t,{to:e});s.parentId=r,Ul(c,((e,t)=>{Vl.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 g;if(Zl.skipAnimation)return $s(n),Gs(o,!1);try{let t;t=Vl.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Gs(o.get(),!0,!1)}catch(e){if(e instanceof js)g=e.result;else{if(!(e instanceof Ks))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Vl.fun(i)&&_l.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function $s(e,t){$l(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class js 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 Ks extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const qs=e=>e instanceof Qs;let Ys=1;class Qs extends Li{constructor(...e){super(...e),this.id=Ys++,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=os(this);return e&&e.getValue()}to(...e){return Zl.to(this,e)}interpolate(...e){return Ki(`${$i}The "interpolate" function is deprecated in v9 (use "to" instead)`),Zl.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){Ri(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||oi.sort(this),Ri(this,{type:"priority",parent:this,priority:e})}}const Xs=Symbol.for("SpringPhase"),Zs=e=>(1&e[Xs])>0,Js=e=>(2&e[Xs])>0,ea=e=>(4&e[Xs])>0,ta=(e,t)=>t?e[Xs]|=3:e[Xs]&=-3,na=(e,t)=>t?e[Xs]|=4:e[Xs]&=-5;class oa extends Qs{constructor(e,t){if(super(),this.key=void 0,this.animation=new Fs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Vl.und(e)||!Vl.und(t)){const n=Vl.obj(e)?ks({},e):ks({},t,{from:e});Vl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Js(this)||this._state.asyncTo)||ea(this)}get goal(){return Pi(this.animation.to)}get velocity(){const e=os(this);return e instanceof ss?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Zs(this)}get isAnimating(){return Js(this)}get isPaused(){return ea(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ls(o.to);!i&&Ni(o.to)&&(l=Wl(Pi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==as?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=Vl.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Vl.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)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Vl.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=os(this),a=s.getValue();if(t){const e=Pi(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 _l.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Js(this)){const{to:e,config:t}=this.animation;_l.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 Vl.und(e)?(n=this.queue||[],this.queue=[]):n=[Vl.obj(e)?e:ks({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Vs(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),$s(this._state,e&&this._lastCallId),_l.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=Vl.obj(n)?n[t]:n,(null==n||Ps(n))&&(n=void 0),o=Vl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Zs(this)||(e.reverse&&([n,o]=[o,n]),o=Pi(o),Vl.und(o)?os(this)||this._set(n):this._set(o)),r}_update(e,t){let n=ks({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ws(n,((e,t)=>/^on/.test(t)?Es(e,o):e))),ua(this,n,"onProps"),da(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 zs(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ea(this)||(na(this,!0),jl(i.pauseQueue),da(this,"onPause",Gs(this,ra(this,this.animation.to)),this))},resume:()=>{ea(this)&&(na(this,!1),Js(this)&&this._resume(),jl(i.resumeQueue),da(this,"onResume",Gs(this,ra(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=la(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Us(this));const o=!Vl.und(e.to),r=!Vl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Us(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&&!Vl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Hl(d,c);p&&(s.from=d),d=Pi(d);const m=!Hl(u,a);m&&this._focus(u);const f=Ps(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Ds(n=ks({},n),t),t=ks({},n,t)),Ds(e,t),Object.assign(e,t);for(const t in Ls)null==e[t]&&(e[t]=Ls[t]);let{mass:o,frequency:r,damping:l}=e;Vl.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)}(g,_s(t.config,l),t.config!==i.config?_s(i.config,l):void 0);let b=os(this);if(!b||Vl.und(u))return n(Gs(this,!0));const k=Vl.und(t.reset)?r&&!t.default:!Vl.und(d)&&ys(t.reset,l),_=k?d:this.get(),y=Ts(u),E=Vl.num(y)||Vl.arr(y)||Yi(y),C=!f&&(!E||ys(i.immediate||t.immediate,l));if(m){const e=ms(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=Ni(u),B=!1;if(!w){const e=k||!Zs(this)&&p;(m||e)&&(B=Hl(Ts(_),y),w=!B),(Hl(s.immediate,C)||C)&&Hl(g.decay,h)&&Hl(g.velocity,v)||(w=!0)}if(B&&Js(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Ni(a))&&(s.values=b.getPayload(),s.toValues=Ni(u)?null:S==as?[1]:Wl(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Gl(ca,(e=>ua(this,t,e)));const o=Gs(this,ra(this,a));jl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&_l.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?_s(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ws(t.to,t,this._state,this)):w?this._start():Js(this)&&!m?this._pendingCalls.add(n):n(Hs(_))}_focus(e){const t=this.animation;e!==t.to&&(Mi(this)&&this._detach(),t.to=e,Mi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ni(t)&&(Di(t,this),qs(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ni(e)&&Oi(e,this)}_set(e,t=!0){const n=Pi(e);if(!Vl.und(n)){const e=os(this);if(!e||!Hl(n,e.getValue())){const o=ms(n);e&&e.constructor==o?e.setValue(n):rs(this,o.create(n)),e&&_l.batchedUpdates((()=>{this._onChange(n,t)}))}}return os(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,da(this,"onStart",Gs(this,ra(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),_s(this.animation.onChange,e,this)),_s(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;os(this).reset(Pi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Js(this)||(ta(this,!0),ea(this)||this._resume())}_resume(){Zl.skipAnimation?this.finish():oi.start(this)}_stop(e,t){if(Js(this)){ta(this,!1);const n=this.animation;Gl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ri(this,{type:"idle",parent:this});const o=t?Us(this.get()):Gs(this.get(),ra(this,null!=e?e:n.to));jl(this._pendingCalls,o),n.changed&&(n.changed=!1,da(this,"onRest",o,this))}}}function ra(e,t){const n=Ts(t);return Hl(Ts(e.get()),n)}function la(e,t=e.loop,n=e.to){let o=_s(t);if(o){const r=!0!==o&&xs(o),l=(r||e).reverse,i=!r||r.reset;return ia(ks({},e,{loop:t,default:!1,pause:void 0,to:!l||Ps(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ia(e){const{to:t,from:n}=e=xs(e),o=new Set;return Vl.obj(t)&&aa(t,o),Vl.obj(n)&&aa(n,o),e.keys=o.size?Array.from(o):null,e}function sa(e){const t=ia(e);return Vl.und(t.default)&&(t.default=ws(t)),t}function aa(e,t){Ul(e,((e,n)=>null!=e&&t.add(n)))}const ca=["onStart","onRest","onChange","onPause","onResume"];function ua(e,t,n){e.animation[n]=t[n]!==Cs(t,n)?Es(t[n],e.key):void 0}function da(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 pa=["onStart","onChange","onRest"];let ma=1;class fa{constructor(e,t){this.id=ma++,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(ks({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];Vl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ia(e)),this}start(e){let{queue:t}=this;return e?t=Wl(e).map(ia):this.queue=[],this._flush?this._flush(this,t):(ya(this,t),ga(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Gl(Wl(t),(t=>n[t].stop(!!e)))}else $s(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Vl.und(e))this.start({pause:!0});else{const t=this.springs;Gl(Wl(e),(e=>t[e].pause()))}return this}resume(e){if(Vl.und(e))this.start({pause:!1});else{const t=this.springs;Gl(Wl(e),(e=>t[e].resume()))}return this}each(e){Ul(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,$l(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&&$l(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,$l(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)}_l.onFrame(this._onFrame)}}function ga(e,t){return Promise.all(t.map((t=>ha(e,t)))).then((t=>Vs(e,t)))}async function ha(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Vl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Vl.arr(r)||Vl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Gl(pa,(n=>{const o=t[n];if(Vl.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,jl(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===Cs(t,"cancel");(u||m&&d.asyncId)&&p.push(zs(++e._lastAsyncId,{props:t,state:d,actions:{pause:zl,resume:zl,start(t,n){m?($s(d,e._lastAsyncId),n(Us(e))):(t.onRest=s,n(Ws(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Vs(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=la(t,i,r);if(n)return ya(e,[n]),ha(e,n,!0)}return a&&_l.batchedUpdates((()=>a(f,e,e.item))),f}function va(e,t){const n=ks({},e.springs);return t&&Gl(Wl(t),(e=>{Vl.und(e.keys)&&(e=ia(e)),Vl.obj(e.to)||(e=ks({},e,{to:void 0})),_a(n,e,(e=>ka(e)))})),ba(e,n),n}function ba(e,t){Ul(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Di(t,e))}))}function ka(e,t){const n=new oa;return n.key=e,t&&Di(n,t),n}function _a(e,t,n){t.keys&&Gl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function ya(e,t){Gl(t,(t=>{_a(e.springs,t,(t=>ka(t,e)))}))}const Ea=["children"],Ca=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,Ea);const o=(0,Ol.useContext)(Sa),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ol.useState)((()=>({inputs:t,result:e()}))),o=(0,Ol.useRef)(),r=o.current;let l=r;return l?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))||(l={inputs:t,result:e()}):l=n,(0,Ol.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Sa;return Ol.createElement(i,{value:n},t)},Sa=(wa=Ca,Ba={},Object.assign(wa,Ol.createContext(Ba)),wa.Provider._context=wa,wa.Consumer._context=wa,wa);var wa,Ba;Ca.Provider=Sa.Provider,Ca.Consumer=Sa.Consumer;const Ia=()=>{const e=[],t=function(t){qi(`${$i}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 Gl(e,((e,r)=>{if(Vl.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 Gl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Gl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Gl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Gl(e,((e,o)=>{if(Vl.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 Gl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Gl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Vl.fun(e)?e(n,t):e};return t._getProps=n,t};function xa(e,t,n){const o=Vl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ol.useMemo)((()=>o||3==arguments.length?Ia():void 0),[]),l=(0,Ol.useRef)(0),i=Zi(),s=(0,Ol.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=va(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ga(e,t):new Promise((o=>{ba(e,n),s.queue.push((()=>{o(ga(e,t))})),i()}))}})),[]),a=(0,Ol.useRef)([...s.ctrls]),c=[],u=es(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new fa(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=sa(n))}}(0,Ol.useMemo)((()=>{Gl(a.current.slice(e,u),(e=>{Ms(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ol.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>va(e,c[t]))),m=(0,Ol.useContext)(Ca),f=es(m),g=m!==f&&Ns(m);ts((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Gl(e,(e=>e()))),Gl(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Rs(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Qi((()=>()=>{Gl(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>ks({},e)));return r?[h,r]:h}let Ta;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ta||(Ta={}));class Na extends Qs{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Bi(...t);const n=this._get(),o=ms(n);rs(this,o.create(n))}advance(e){const t=this._get();Hl(t,this.get())||(os(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ma(this._active)&&Ra(this)}_get(){const e=Vl.arr(this.source)?this.source.map(Pi):Wl(Pi(this.source));return this.calc(...e)}_start(){this.idle&&!Ma(this._active)&&(this.idle=!1,Gl(ls(this),(e=>{e.done=!1})),Zl.skipAnimation?(_l.batchedUpdates((()=>this.advance())),Ra(this)):oi.start(this))}_attach(){let e=1;Gl(Wl(this.source),(t=>{Ni(t)&&Di(t,this),qs(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Gl(Wl(this.source),(e=>{Ni(e)&&Oi(e,this)})),this._active.clear(),Ra(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=Wl(this.source).reduce(((e,t)=>Math.max(e,(qs(t)?t.priority:0)+1)),0))}}function Pa(e){return!1!==e.idle}function Ma(e){return!e.size||Array.from(e).every(Pa)}function Ra(e){e.idle||(e.idle=!0,Gl(ls(e),(e=>{e.done=!0})),Ri(e,{type:"idle",parent:e}))}Zl.assign({createStringInterpolator:Wi,to:(e,t)=>new Na(e,t)}),oi.advance;var La=window.ReactDOM;function Aa(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 Da=["style","children","scrollTop","scrollLeft"],Oa=/^--/;function Fa(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Oa.test(e)||Va.hasOwnProperty(e)&&Va[e]?(""+t).trim():t+"px"}const za={};let Va={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 Ha=["Webkit","Ms","Moz","O"];Va=Object.keys(Va).reduce(((e,t)=>(Ha.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Va);const Ga=["x","y","z"],Ua=/^(matrix|translate|scale|rotate|skew)/,Wa=/^(translate)/,$a=/^(rotate|skew)/,ja=(e,t)=>Vl.num(e)&&0!==e?e+t:e,Ka=(e,t)=>Vl.arr(e)?e.every((e=>Ka(e,t))):Vl.num(e)?e===t:parseFloat(e)===t;class qa extends us{constructor(e){let{x:t,y:n,z:o}=e,r=Aa(e,Ga);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ja(e,"px"))).join(",")})`,Ka(e,0)]))),Ul(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Ua.test(t)){if(delete r[t],Vl.und(e))return;const n=Wa.test(t)?"px":$a.test(t)?"deg":"";l.push(Wl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ja(r,n)})`,Ka(r,0)]:e=>[`${t}(${e.map((e=>ja(e,n))).join(",")})`,Ka(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ya(l,i)),super(r)}}class Ya extends Li{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 Gl(this.inputs,((n,o)=>{const r=Pi(n[0]),[l,i]=this.transforms[o](Vl.arr(r)?r:n.map(Pi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Gl(this.inputs,(e=>Gl(e,(e=>Ni(e)&&Di(e,this)))))}observerRemoved(e){0==e&&Gl(this.inputs,(e=>Gl(e,(e=>Ni(e)&&Oi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ri(this,e)}}const Qa=["scrollTop","scrollLeft"];Zl.assign({batchedUpdates:La.unstable_batchedUpdates,createStringInterpolator:Wi,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 Xa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new us(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=bs(e)||"Anonymous";return(e=Vl.str(e)?l[e]||(l[e]=gs(e,r)):e[vs]||(e[vs]=gs(e,r))).displayName=`Animated(${t})`,e};return Ul(e,((t,n)=>{Vl.arr(e)&&(n=bs(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=Aa(o,Da),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:za[t]||(za[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=Fa(t,r[t]);Oa.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 qa(e),getComponentProps:e=>Aa(e,Qa)}).animated,Za=e=>e+1,Ja=e=>({top:e.offsetTop,left:e.offsetLeft});var ec=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Za,0),[u,p]=(0,s.useReducer)(Za,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?Ja(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Jr.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]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=Ja(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Vl.fun(e),[[o],r]=xa(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const tc=".block-editor-block-list__block",nc=".block-list-appender",oc=".block-editor-button-block-appender";function rc(e,t){return t.closest([tc,nc,oc].join(","))===e}function lc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(tc);return t?t.id.slice("block-".length):void 0}function ic(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Yn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Yn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Jr.focus.tabbable.find(t.current).filter((e=>(0,Jr.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(rc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Jr.focus.tabbable.findNext(t.current);if(e&&rc(t.current,e)&&(0,Jr.isFormElement)(e))return void e.focus()}(0,Jr.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function sc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ac(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Yn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",sc),t.addEventListener("mouseover",sc),()=>{t.removeEventListener("mouseout",sc),t.removeEventListener("mouseover",sc),t.classList.remove("is-hovered")}}),[e])}function cc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Yn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function uc(e){return(0,m.useSelect)((t=>{const n=t(Yn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function dc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Yn),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 pc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Yn);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 mc(e){const{isBlockSelected:t}=(0,m.useSelect)(Yn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):rc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var fc=window.wp.keycodes;function gc(e){const t=(0,m.useSelect)((t=>t(Yn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Yn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==fc.ENTER&&s!==fc.BACKSPACE&&s!==fc.DELETE||a!==i||(0,Jr.isTextField)(a)||(t.preventDefault(),s===fc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function hc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Yn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function vc(){const e=(0,s.useContext)(yf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function bc(){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)(kc),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Yn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ic(n),Eo(n),mc(n),gc(n),hc(n),ac(),vc(),ec({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Jn();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,cc(n),uc(n),dc(n),pc(n)),style:{...l.style,...e.style}}}bc.save=r.__unstableGetBlockProps;const kc=(0,s.createContext)();function _c(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",bc(o,{__unstableIsHtml:n}),t)}const yc=(0,m.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(Yn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Ec=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Yn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Yn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Yn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Yn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Cc=(0,d.compose)(d.pure,yc,Ec,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Yn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(ll,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(_c,{isHtml:!0},(0,s.createElement)(bl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(_c,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(_c,{className:"has-warning"},(0,s.createElement)(pl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Jr.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(kc.Provider,{value:M},(0,s.createElement)(hl,{fallback:(0,s.createElement)(_c,{className:"has-warning"},(0,s.createElement)(fl,null))},N))})),Sc=window.wp.htmlEntities,wc=(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"}));const Bc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Ic=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Bc.length));return(0,s.createElement)(p.Tip,null,Bc[e])},xc=(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"})),Tc=(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:xc});const l=(0,s.createElement)(p.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)})),Nc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Vt()("`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)(Tc,{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)))};function Pc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Yn),{getBlockName:h,getBlocks:v}=a.select(Yn),b=(0,m.useSelect)((e=>!t||e(Yn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Yn);let s=v(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=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Mc=(0,d.createHigherOrderComponent)((e=>(0,m.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,m.createRegistry)({},o);e.registerStore(Kn,qn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Yn);return(0,s.useEffect)((()=>{o(n)}),[n]),Pc(e),(0,s.createElement)(yo,null,t)}));function Rc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(Cf,null)))}function Lc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Yn),{clearSelectedBlock:n}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Ac(e){return(0,s.createElement)("div",i({ref:Lc()},e))}function Dc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Yn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Oc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Dc,[]),i=Co(r),s=Co((0,u.first)(n)),a=Co((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Fc(e,t,n,o){let r,l=Jr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Jr.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 zc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===fc.UP,p=c===fc.DOWN,m=c===fc.LEFT,f=c===fc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?Jr.isVerticalEdge:Jr.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,Jr.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===fc.UP||t===fc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,Jr.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=Fc(e,t,i);return!n||!function(e,t){return e.closest(tc)===t.closest(tc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,Jr.isVerticalEdge)(u,g)&&!w){const e=Fc(u,g,i,!0);e&&((0,Jr.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,Jr.isHorizontalEdge)(u,S)&&!w){const e=Fc(u,S,i);(0,Jr.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Vc=window.wp.keyboardShortcuts;function Hc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Yn),{multiSelect:o}=(0,m.useDispatch)(Yn),r=(0,Vc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Jr.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function Gc(e,t){e.contentEditable=t,t&&e.focus()}function Uc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Yn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Gc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Gc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function Wc(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Yn),{getBlockParents:o}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:l}=r;function i(){const r=l.getSelection();if(!r.rangeCount||r.isCollapsed)return void function(e,t){e.contentEditable=false}(n);const i=lc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(r)),s=lc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(r));if(i===s)t(i);else{const t=[...o(i),i],n=[...o(s),s],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){r.addEventListener("selectionchange",i),l.addEventListener("mouseup",i)}function a(){r.removeEventListener("selectionchange",i),l.removeEventListener("mouseup",i)}function c(){a(),s()}return s(),n.addEventListener("focusin",c),()=>{a(),n.removeEventListener("focusin",c)}}),[e,t,n,o])}function $c(){const{multiSelect:e,selectBlock:t}=(0,m.useDispatch)(Yn),{isSelectionEnabled:n,getBlockParents:o,getBlockSelectionStart:r,hasMultiSelection:l}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((e=>{function o(o){if(!n()||0!==o.button)return;const i=r(),s=lc(o.target);o.shiftKey?i!==s&&(e.contentEditable=!0,e.focus()):l()&&t(s)}return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[e,t,n,o,r,l])}function jc(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Yn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===fc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===fc.BACKSPACE||d.keyCode===fc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===fc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===fc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function Kc(){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,m.useSelect)(Yn),{setNavigationMode:a}=(0,m.useDispatch)(Yn),c=(0,m.useSelect)((e=>e(Yn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Jr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===fc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==fc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Jr.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Jr.isFormElement)(Jr.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==fc.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=Jr.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Yn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,jc(),Uc(),Wc(),$c(),Oc(),Hc(),zc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var qc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=Kc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const Yc="editor-styles-wrapper";function Qc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Xc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Qc(null==a?void 0:a.styles),_=Qc(null==a?void 0:a.scripts),y=Lc(),[E,C,S]=Kc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(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)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.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((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,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&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${Yc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Yc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Zc={grad:.9,turn:360,rad:360/(2*Math.PI)},Jc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},eu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},tu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},nu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ou=function(e){return{r:tu(e.r,0,255),g:tu(e.g,0,255),b:tu(e.b,0,255),a:tu(e.a)}},ru=function(e){return{r:eu(e.r),g:eu(e.g),b:eu(e.b),a:eu(e.a,3)}},lu=/^#([0-9a-f]{3,8})$/i,iu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},su=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}},au=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}},cu=function(e){return{h:nu(e.h),s:tu(e.s,0,100),l:tu(e.l,0,100),a:tu(e.a)}},uu=function(e){return{h:eu(e.h),s:eu(e.s),l:eu(e.l),a:eu(e.a,3)}},du=function(e){return au((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},pu=function(e){return{h:(t=su(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},mu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vu={string:[[function(e){var t=lu.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?eu(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?eu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=gu.exec(e)||hu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ou({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=mu.exec(e)||fu.exec(e);if(!t)return null;var n,o,r=cu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Zc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return du(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 Jc(t)&&Jc(n)&&Jc(o)?ou({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(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=cu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return du(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=function(e){return{h:nu(e.h),s:tu(e.s,0,100),v:tu(e.v,0,100),a:tu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return au(i)},"hsv"]]},bu=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]},ku=function(e,t){var n=pu(e);return{h:n.h,s:tu(n.s+100*t,0,100),l:n.l,a:n.a}},_u=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},yu=function(e,t){var n=pu(e);return{h:n.h,s:n.s,l:tu(n.l+100*t,0,100),a:n.a}},Eu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?bu(e.trim(),vu.string):"object"==typeof e&&null!==e?bu(e,vu.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 eu(_u(this.rgba),2)},e.prototype.isDark=function(){return _u(this.rgba)<.5},e.prototype.isLight=function(){return _u(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=ru(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?iu(eu(255*r)):"","#"+iu(t)+iu(n)+iu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return ru(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ru(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 uu(pu(this.rgba))},e.prototype.toHslString=function(){return t=(e=uu(pu(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=su(this.rgba),{h:eu(e.h),s:eu(e.s),v:eu(e.v),a:eu(e.a,3)};var e},e.prototype.invert=function(){return Cu({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),Cu(ku(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Cu(ku(this.rgba,-e))},e.prototype.grayscale=function(){return Cu(ku(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Cu(yu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Cu(yu(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?Cu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):eu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=pu(this.rgba);return"number"==typeof e?Cu({h:e,s:t.s,l:t.l,a:t.a}):eu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Cu(e).toHex()},e}(),Cu=function(e){return e instanceof Eu?e:new Eu(e)},Su=[],wu=function(e){e.forEach((function(e){Su.indexOf(e)<0&&(e(Eu,vu),Su.push(e))}))};function Bu(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 Iu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},xu=function(e){return.2126*Iu(e.r)+.7152*Iu(e.g)+.0722*Iu(e.b)};function Tu(e){e.prototype.luminance=function(){return e=xu(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=xu(l))>(a=xu(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 Nu=n(3124),Pu=n.n(Nu);const Mu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ru(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(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(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 f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return Lu(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=Lu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Mu,""),value:n?Lu(n[0]).replace(Mu,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){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 _=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=f();for(;r=k();)i.push(r),i=i.concat(f());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=Lu(t[1]);if(!c())return a("@media missing '{'");const o=f().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:Lu(t[1]),media:Lu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Lu(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Lu(t[1]),o=Lu(t[2]);if(!c())return a("@document missing '{'");const r=f().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=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());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=f().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=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Au(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Lu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Au(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){Au(e,o)})):n&&"object"==typeof n&&Au(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Du=n(8575),Ou=n.n(Du),Fu=zu;function zu(e){this.options=e||{}}zu.prototype.emit=function(e){return e},zu.prototype.visit=function(e){return this[e.type](e)},zu.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};var Vu=Hu;function Hu(e){Fu.call(this,e)}Ou()(Hu,Fu),Hu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Hu.prototype.comment=function(e){return this.emit("",e.position)},Hu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Hu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.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("}")},Hu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Hu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Hu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Hu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Hu.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("}")},Hu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Hu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Hu.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("}"):""},Hu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Gu=Uu;function Uu(e){e=e||{},Fu.call(this,e),this.indentation=e.indent}Ou()(Uu,Fu),Uu.prototype.compile=function(e){return this.stylesheet(e)},Uu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Uu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Uu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Uu.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}")},Uu.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}")},Uu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Uu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Uu.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}")},Uu.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)+"}")},Uu.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")},Uu.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}")},Uu.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}")},Uu.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}")},Uu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Uu.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()+"}"):""},Uu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Uu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Wu=function(e,t){try{const r=Ru(e);return n=Pu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Vu(o):new Gu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function $u(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 ju(e,t){return new URL(e,t).toString()}var Ku=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]};$u(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ju(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};const qu=/^(body|html|:root).*$/;var Yu=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(qu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Qu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Yu(t)),o&&r.push(Ku(o)),r.length?Wu(n,(0,d.compose)(r)):n}))};const Xu=".editor-styles-wrapper";function Zu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Xu);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=Cu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Ju(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Qu(t,Xu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Zu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let ed;wu([Bu,Tu]);const td=2e3;var nd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Yn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);ed=ed||(0,d.pure)(Cf);const g=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:a*g,maxHeight:a>td?td*g:void 0,minHeight:o}},(0,s.createElement)(Xc,{head:(0,s.createElement)(Ju,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:td,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(ed,{renderAppender:!1}))))},od=(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,m.useSelect)((e=>e(Yn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Mc,{value:d,settings:c},r?(0,s.createElement)(Rc,{onClick:l}):(0,s.createElement)(nd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function rd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Yn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Mc,{value:p,settings:a},(0,s.createElement)(wf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var ld=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(od,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Nc,{title:i,icon:a,description:c}))},id=(0,s.createContext)(),sd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(id);return(0,s.createElement)(p.__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)(p.Button,t,r)}))})),ad=(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 cd(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(Tc,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function
|
15 |
-
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,g.__)("Blocks")},
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,g.__)("Patterns")},
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,g.__)("Reusable")};var
|
28 |
-
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:
|
29 |
-
(0,g.__)("%s block added"),a.title);(0,
|
30 |
-
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wr,{icon:wc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const gp=(0,s.forwardRef)(((e,t)=>(Vt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),fp(e,t))));var hp=(0,s.forwardRef)(fp),vp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Yn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(mp,{rootClientId:n}):(0,s.createElement)(hp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));function bp(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const kp=(0,s.createContext)();function _p(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Yn),l=(0,s.useContext)(kp),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Yn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),b=So(u),k=So(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=bp(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,I={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:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(pp,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function yp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Yn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(kp.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(_p,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Ep(){const e=(0,s.useContext)(kp),t=(0,m.useSelect)((e=>e(Yn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Yn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Cp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Sp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function wp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Yn),{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}:d}),[e])}function Bp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Yn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=wp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Ip(e){let{clientId:t,maximumLength:n}=e;return Bp(t,n)}var xp=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Yn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=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,Jr.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,m.useDispatch)(Yn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(cd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Tp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=wp(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Yn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Yn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Ft.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Yn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Yn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Tc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(xp,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:ad,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===fc.UP,l=n===fc.DOWN,i=n===fc.LEFT,s=n===fc.RIGHT,a=n===fc.TAB,c=n===fc.ESCAPE,u=n===fc.ENTER,d=n===fc.SPACE,p=e.shiftKey;if(n===fc.BACKSPACE||n===fc.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),g=T(f||m),h=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=w(F),t=w(m),n=S(F);let o=S(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;if(b){t=o;do{t=Jr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=Jr.focus.tabbable.findNext(t))}else t=Jr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Ip,{clientId:t,maximumLength:35})))))};function Np(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Pp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Jr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Vt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Jr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,Vc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Np(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Np(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},Mp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Rp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Lp=(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"})),Ap=(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"}));const Dp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Mp:Rp:Lp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Rp:Mp:Ap:null,Op=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Fp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Fp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Yn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Yn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Dp(o,C),label:Op(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:I,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
@@ -42,69 +42,69 @@ title:(0,g.__)("Reusable")};var sp=function(e){let{children:t,showPatterns:n=!1,
|
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
-
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
-
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
56 |
/* translators: %s: Name of the block. */
|
57 |
-
(0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?
|
58 |
/* translators: %s: block name */
|
59 |
-
(0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=
|
60 |
/* translators: %s: Name of the block's parent. */
|
61 |
-
(0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(
|
62 |
/* translators: %s: block name */
|
63 |
-
(0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(
|
64 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Qm,{hideDragHandle:n}))};function Zm(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(Yn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Jm(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Zm,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Yn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Yn),I=!g&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!g||h),N=!(u||T||b||r);(0,Vc.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,s.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,s.useRef)(),M=So(t),R=So(k),L=So(l),A=bp(a);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,Jr.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(pp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Xm,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Tp,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(pp,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function ef(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Yn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function tf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(ef,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Jm,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function nf(e){let{children:t}=e;const n=(0,s.useContext)(kp),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Vt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(yp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(tf,{__unstablePopoverSlot:"block-toolbar"}),t))}var of=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Jn();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),rf=of((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(hp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),lf=(0,d.compose)([of,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Yn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(mp,{rootClientId:t})})),sf=window.wp.isShallowEqual,af=n.n(sf);const cf=new WeakMap;function uf(e,t){const n=(0,m.useSelect)((e=>e(Yn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Yn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Yn),d=function(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 n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,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,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,Jr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function df(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 pf(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=df(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function mf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=pf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function ff(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Yn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Yn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Yn),a=uf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=mf(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function gf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Yn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Yn).getBlockRootClientId(e);return{blockListSettings:t(Yn).getBlockListSettings(e),parentLock:t(Yn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Ir(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),af()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Yn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Yn),a=(0,m.useSelect)((t=>t(Yn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Yn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){cf.has(t)||cf.set(t,new WeakMap);const n=cf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(tl,{value:k},(0,s.createElement)(wf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function hf(e){return Pc(e),(0,s.createElement)(gf,e)}const vf=(0,s.forwardRef)(((e,t)=>{const n=bf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function bf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Jn(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Yn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,ff({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?hf:gf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(wf,t)}}bf.save=r.__unstableGetInnerBlocksProps,vf.DefaultBlockAppender=lf,vf.ButtonBlockAppender=rf,vf.Content=()=>bf.save().children;var kf=vf;const _f=(0,s.createContext)(),yf=(0,s.createContext)();function Ef(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Yn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=bf({ref:(0,d.useMergeRefs)([Lc(),Ep(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(_f.Provider,{value:o},(0,s.createElement)("div",p))}function Cf(e){return function(){const e=(0,m.useSelect)((e=>e(Yn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Yn).__experimentalGetParsedPattern(e[n].name),t=Cp(o))};return t=Cp(o),()=>Sp(t)}),[e])}(),(0,s.createElement)(nf,null,(0,s.createElement)(Zn,{value:Qn},(0,s.createElement)(Ef,e)))}function Sf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Yn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Nr,{value:l},(0,s.createElement)(yf.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Cc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(vp,{tagName:r,rootClientId:n,renderAppender:o}))}function wf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Sf,e))}Cf.__unstableElementContext=_f;const Bf=["colors","disableCustomColors","gradients","disableCustomGradients"];function If(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function xf(e){const t={};return t.colors=xo("color.palette"),t.gradients=xo("color.gradients"),t.disableCustomColors=!xo("color.custom"),t.disableCustomGradients=!xo("color.customGradient"),(0,s.createElement)(If,i({},t,e))}var Tf=function(e){return(0,u.every)(Bf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(If,e):(0,s.createElement)(xf,e)};function Nf(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(Tf,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Pf(){return{disableCustomColors:!xo("color.custom"),disableCustomGradients:!xo("color.customGradient")}}function Mf(){const e=Pf(),t=xo("color.palette.custom"),n=xo("color.palette.theme"),o=xo("color.palette.default"),r=xo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=xo("color.gradients.custom"),i=xo("color.gradients.theme"),a=xo("color.gradients.default"),c=xo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}wu([Bu,Tu]);const Rf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Lf=(e,t)=>(0,u.find)(e,{color:t});function Af(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Df=[];function Of(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Mf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=Rf(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Rf(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=Lf(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:Po(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Nf,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Ff(e,t,n){var o;if(!cg(t,"color")||Lo(t,sg,"color"))return e;const{borderColor:r,style:l}=n,i=Af("border-color",r),s=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=s||void 0,e}const zf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=xo("color.palette")||Df;if(!cg(r,"color")||Lo(r,sg,"color"))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Rf(c,a))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,s.createElement)(e,i({},t,{wrapperProps:d}))}));function Vf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Hf(){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,p.__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=Vf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Gf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Uf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Wf(e){let{onChange:t,values:n,...o}=e;const r=Hf(n),l=Uf(n)&&Gf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return cg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Ff),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!cg(e,"color")||Lo(e,sg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ff(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",zf);const $f={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function jf(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries($f).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Kf=(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"})),qf=(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 Yf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Kf:qf,iconSize:16,"aria-label":o})))}const Qf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Xf={px:100,em:20,rem:20};function Zf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Uf(n)||!Gf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Vf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Hf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Xf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(jf,{min:0,onChange:t,values:n||Qf,units:l}),(0,s.createElement)(Yf,{onClick:()=>r(!o),isLinked:o})))}function Jf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Po(t)),o({style:t})}})}var eg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),tg=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),ng=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const og=[{label:(0,g.__)("Solid"),icon:eg,value:"solid"},{label:(0,g.__)("Dashed"),icon:tg,value:"dashed"},{label:(0,g.__)("Dotted"),icon:ng,value:"dotted"}];function rg(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},og.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const lg=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(rg,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:Po(t)})}})},ig=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=Po(s)),o({borderColor:p,style:s})},units:h})},sg="__experimentalBorder";function ag(e){const{clientId:t}=e,n=xo("border.color")&&cg(e.name,"color"),o=xo("border.radius")&&cg(e.name,"radius"),l=xo("border.style")&&cg(e.name,"style"),i=xo("border.width")&&cg(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[sg,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(Vo,{__experimentalGroup:"border"},i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(ig,e)),l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(lg,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:ug(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Of,e)),o&&(0,s.createElement)(p.__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,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Jf,e)))}function cg(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,sg);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 ug(e,t){return Po({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function dg(e){if(e)return`has-${e}-gradient-background`}function pg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function mg(e,t){return(0,u.find)(e,["gradient",t])}function fg(e,t){const n=mg(e,t);return n&&n.slug}function gg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Jn(),o=xo("color.gradients.custom"),r=xo("color.gradients.theme"),l=xo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Yn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Yn),d=(0,s.useCallback)((o=>{const r=fg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=dg(a);let f;return f=a?pg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}wu([Bu,Tu]);var hg=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 m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Cu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Cu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
65 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
66 |
-
(0,g.__)("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,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ft.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function vg(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Mf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Tf,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function bg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function kg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=Co(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(bg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(bg(t).color);let n=p.current,o=bg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=bg(n).backgroundColor;i(o)})),(0,s.createElement)(Vo,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(vg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(hg,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const _g="color",yg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Eg=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,_g);return(0,u.isObject)(t)&&!!t.link},Cg=e=>{const t=(0,r.getBlockSupport)(e,_g);return(0,u.isObject)(t)&&!!t.gradients},Sg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&!1!==t.background},wg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&!1!==t.text},Bg=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Ig=(e,t)=>Po(Mo(t,e,void 0)),xg=e=>({textColor:void 0,style:Ig(["color","text"],e.style)}),Tg=e=>({style:Ig(["elements","link","color","text"],e.style)}),Ng=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 Pg(e,t,n){var o,r,l,i,s,a;if(!yg(t)||Lo(t,_g))return e;const u=Cg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Lo(t,_g,e),h=g("text")?Af("color",p):void 0,v=g("gradients")?dg(m):void 0,b=g("background")?Af("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Mg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Rf(e,n[1]).color:t};function Rg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=xo("color.palette.custom"),h=xo("color.palette.theme"),v=xo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=xo("color.gradients.custom"),_=xo("color.gradients.theme"),y=xo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=xo("color.custom"),S=xo("color.customGradient"),w=xo("color.background"),B=xo("color.link"),I=xo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!yg(p))return null;const P=Eg(p)&&B&&x,M=wg(p)&&I&&x,R=Sg(p)&&w&&x,L=Cg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=pg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Lf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:Po(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[_g,"__experimentalDefaultControls"]);return(0,s.createElement)(kg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Rf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Bg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Ig(["color","text"],t.style)})})(e),resetAllFilter:xg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Rf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=fg(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Po(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Po(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Bg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Ng(t))})(e),resetAllFilter:Ng}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Lf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Po(Mo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Mg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Bg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Ig(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Tg}]:[]]})}const Lg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=xo("color.palette.custom")||[],u=xo("color.palette.theme")||[],d=xo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!yg(o)||Lo(o,_g))return(0,s.createElement)(e,t);const m={};var f,g;a&&!Lo(o,_g,"text")&&(m.color=null===(f=Rf(p,a))||void 0===f?void 0:f.color),l&&!Lo(o,_g,"background")&&(m.backgroundColor=null===(g=Rf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Ag={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return yg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Cg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Pg),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!yg(e)||Lo(e,_g))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Lg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Ro({linkColor:Eg(r),textColor:wg(r),backgroundColor:Sg(r),gradient:Cg(r)},Ag,e,t,n,o)}));const Dg=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Og=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Fg=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function zg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Fg(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Dg.forEach((t=>{let{name:n,value:o}=t;Og.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
67 |
/* translators: 1: Font weight name. 2: Font style name. */
|
68 |
-
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return
|
69 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
70 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
71 |
-
(0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Vg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Vt()("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 a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__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(l)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,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Hg="typography.lineHeight";function Gg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vg,{__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:Po(t)})}})}function Ug(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Hg)||t}const Wg="typography.__experimentalFontStyle",$g="typography.__experimentalFontWeight";function jg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Kg(e),i=!qg(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)(zg,{onChange:e=>{r({style:Po({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Kg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wg),n=xo("typography.fontStyle");return!t||!n}function qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,$g),n=xo("typography.fontWeight");return!t||!n}function Yg(e){const t=Kg(e),n=qg(e);return t&&n}function Qg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=xo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Xg="typography.__experimentalFontFamily";function Zg(e,t,n){if(!(0,r.hasBlockSupport)(t,Xg))return e;if(Lo(t,Nh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Jp())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Jg(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=xo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Qg,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function eh(e){let{name:t}=e;const n=xo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Xg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Xg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Xg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zg(o,e,n)},e}));const th=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function nh(e,t){return(0,u.find)(e,{size:t})||{size:t}}function oh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var rh=function(e){const t=xo("typography.fontSizes"),n=!xo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lh="typography.fontSize";function ih(e,t,n){if(!(0,r.hasBlockSupport)(t,lh))return e;if(Lo(t,Nh,"fontSize"))return e;const o=new(Jp())(e.className);o.add(oh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function sh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=xo("typography.fontSizes"),a=th(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)(rh,{onChange:e=>{const t=nh(i,e).slug;l({style:Po({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ah(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=xo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,lh)||!n}const ch=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=xo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,lh)||Lo(i,Nh,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=th(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"),uh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,lh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ih),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,lh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ih(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ch),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ro({fontSize:(0,r.hasBlockSupport)(l,lh)},uh,e,t,n,o)}));var dh=(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"})),ph=(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"}));const mh=[{name:(0,g.__)("Underline"),value:"underline",icon:dh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:ph}];function fh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},mh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const gh="typography.__experimentalTextDecoration";function hh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gh),n=xo("typography.textDecoration");return t||!n}var bh=(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"})),kh=(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"})),_h=(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"}));const yh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:bh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:kh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:_h}];function Eh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},yh.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Ch="typography.__experimentalTextTransform";function Sh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function wh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ch),n=xo("typography.textTransform");return t||!n}function Bh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Ih="typography.__experimentalLetterSpacing";function xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ih),n=xo("typography.letterSpacing");return t||!n}const Nh="typography",Ph=[Hg,lh,Wg,$g,Xg,gh,Ch,Ih];function Mh(e){const{clientId:t}=e,n=eh(e),o=ah(e),l=Yg(e),i=Ug(e),a=vh(e),c=wh(e),u=Th(e),d=!Kg(e),m=!qg(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yg(e),ah(e),Ug(e),eh(e),vh(e),wh(e),Th(e)];return t.filter(Boolean).length===t.length}(e),h=Rh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Nh,"__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)(Vo,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("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)(Jg,e)),!o&&(0,s.createElement)(p.__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),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Po({...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)(sh,e)),!l&&(0,s.createElement)(p.__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:Fg(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(jg,e)),!i&&(0,s.createElement)(p.__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,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(Gg,e)),!a&&(0,s.createElement)(p.__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,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(hh,e)),!c&&(0,s.createElement)(p.__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.textTransform)}(e),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(Sh,e)),!u&&(0,s.createElement)(p.__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,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(xh,e)))}const Rh=e=>Ph.some((t=>(0,r.hasBlockSupport)(e,t))),Lh=[...Ph,sg,_g,Ko],Ah=e=>Lh.some((t=>(0,r.hasBlockSupport)(e,t))),Dh="var:";function Oh(e){return(0,u.startsWith)(e,Dh)?`var(--wp--${e.slice(Dh.length).split("|").join("--")})`:e}function Fh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Oh(r))})):t.includes(l.join("."))||(n[o]=Oh((0,u.get)(e,l))))}}));const o=Zr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const zh={[`${sg}.__experimentalSkipSerialization`]:["border"],"color.__experimentalSkipSerialization":[_g],[`${Nh}.__experimentalSkipSerialization`]:[Nh],[`${Ko}.__experimentalSkipSerialization`]:["spacing"]},Vh={...zh,[`${Ko}`]:["spacing.blockGap"]},Hh={gradients:"gradient"};function Gh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Vh;if(!Ah(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=Hh[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...Fh(l),...e.style},e}const Uh=(0,d.createHigherOrderComponent)((e=>t=>{const n=eo();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rg,t),(0,s.createElement)(Mh,t),(0,s.createElement)(ag,t),(0,s.createElement)(Qo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Wh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Lo(t.name,_g,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Fh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Cf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Ah(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Gh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Ah(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gh(o,e,n,zh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Uh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Wh);var $h=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==fc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const jh=[];function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Cu(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 qh(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.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:n},(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"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function Yh(e){let{presetSetting:t,defaultSetting:n}=e;const o=!xo(n),r=xo(`${t}.custom`)||jh,l=xo(`${t}.theme`)||jh,i=xo(`${t}.default`)||jh;return(0,s.useMemo)((()=>[...r,...l,...o?jh:i]),[o,r,l,i])}function Qh(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=Yh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Yh({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!xo("color.custom"),u=!xo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)($h,{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})}}))}wu([Bu]);const Xh=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Qh,t))}),"withDuotoneControls"),Zh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Cf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(qh,{selector:m,id:p,values:Kh(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"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",Xh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Zh);const Jh="__experimentalLayout";function ev(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=xo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Jh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Ir(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Vo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(tv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function tv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Br.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const nv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Jh)&&(0,s.createElement)(ev,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),ov=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Jh),a=(0,d.useInstanceId)(e),u=xo("layout")||{},p=(0,s.useContext)(Cf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Jh)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mr,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Jh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",ov),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",nv);const rv=[];function lv(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Af("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:Fh({border:r})}}function iv(e){const t=xo("color.palette")||rv,n=lv(e);if(e.borderColor){const o=Rf(t,e.borderColor);n.style.borderColor=o.color}return n}function sv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Af("background-color",s),m=Af("color",a),f=dg(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!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:Fh({color:(null==d?void 0:d.color)||{}})}}const av={};function cv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=xo("color.palette.custom")||[],l=xo("color.palette.theme")||[],i=xo("color.palette.default")||[],a=xo("color.gradients")||av,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=sv(e);if(t){const e=Rf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=pg(u,o)),n){const e=Rf(c,n);d.style.color=e.color}return d}function uv(e){const{style:t}=e;return{style:Fh({spacing:(null==t?void 0:t.spacing)||{}})}}function dv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const pv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),mv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=xo("color.palette.custom"),o=xo("color.palette.theme"),r=xo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function fv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Cu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Lf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Rf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:Af(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function gv(e){return function(){const t=pv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(fv(o,t),"withCustomColors")}}function hv(){const e=mv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(fv(n,e),"withColors")}const vv=[];var bv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=xo("typography.fontSizes")||vv;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=th(r,l,n[t]);return e[o]={...i,class:oh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},kv=(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"})),_v=(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"})),yv=(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"}));const Ev=[{icon:kv,title:(0,g.__)("Align text left"),align:"left"},{icon:_v,title:(0,g.__)("Align text center"),align:"center"},{icon:yv,title:(0,g.__)("Align text right"),align:"right"}],Cv={position:"bottom right",isAlternate:!0};var Sv=function(e){let{value:t,onChange:n,alignmentControls:o=Ev,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?yv:kv,label:r,toggleProps:{describedBy:l},popoverProps:Cv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const wv=e=>(0,s.createElement)(Sv,i({},e,{isToolbar:!1})),Bv=e=>(0,s.createElement)(Sv,i({},e,{isToolbar:!0}));var Iv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Yn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=vd(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Hd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(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)(Tc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},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))}}},xv=window.wp.apiFetch,Tv=n.n(xv),Nv=(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"})),Pv=(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"})),Mv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Tv()({path:(0,Qd.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)(wr,{key:"icon",icon:"page"===e.subtype?Nv:Pv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const Rv=[];function Lv(e){let{completers:t=Rv}=e;const{name:n}=Jn();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Iv,Mv])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Av=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Lv(e)}))},Dv=(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"})),Ov=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Dv,label:n,onClick:()=>o(!t),disabled:r})},Fv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==fc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},zv=(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"})),Vv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Yn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Yn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("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)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wr,{icon:zv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Ip,{clientId:e,maximumLength:35})),(0,s.createElement)(wr,{icon:zv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ip,{clientId:r,maximumLength:35})))};function Hv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{canEdit:p,isParentSelected:f,hasChildSelected:g,isDraggingBlocks:h,isParentHighlighted:v}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l,canEditBlock:i}=e(Yn);return{canEdit:i(t),isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),b=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":v,"is-drag
|
1 |
+
!function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(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})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(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:function(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:function(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 f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+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();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},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:function(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:function(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),f=o.offset(e),g=o.outerHeight(e),h=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:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(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):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(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):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(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 f(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 g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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 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 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)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(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={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:g,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(g(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(g(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},h)},8575:function(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:function(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}},5372:function(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:function(e,t,n){e.exports=n(5372)()},9567:function(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:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(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={},f=!0,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!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(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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:function(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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Iv},AlignmentToolbar:function(){return xv},Autocomplete:function(){return Ov},BlockAlignmentControl:function(){return Vr},BlockAlignmentToolbar:function(){return Hr},BlockBreadcrumb:function(){return Gv},BlockColorsStyleSelector:function(){return Kv},BlockContextProvider:function(){return nl},BlockControls:function(){return io},BlockEdit:function(){return il},BlockEditorKeyboardShortcuts:function(){return yy},BlockEditorProvider:function(){return Rc},BlockFormatControls:function(){return lo},BlockIcon:function(){return Nc},BlockInspector:function(){return vy},BlockList:function(){return Bf},BlockMover:function(){return Up},BlockNavigationDropdown:function(){return mb},BlockPreview:function(){return rd},BlockSelectionClearer:function(){return Dc},BlockSettingsMenu:function(){return Wm},BlockSettingsMenuControls:function(){return Vm},BlockStyles:function(){return vb},BlockTitle:function(){return Tp},BlockToolbar:function(){return Xm},BlockTools:function(){return by},BlockVerticalAlignmentControl:function(){return dr},BlockVerticalAlignmentToolbar:function(){return pr},ButtonBlockAppender:function(){return vp},ButtonBlockerAppender:function(){return hp},ColorPalette:function(){return zb},ColorPaletteControl:function(){return Vb},ContrastChecker:function(){return dg},CopyHandler:function(){return Cm},DefaultBlockAppender:function(){return fp},FontSizePicker:function(){return oh},InnerBlocks:function(){return Ef},Inserter:function(){return mp},InspectorAdvancedControls:function(){return Vo},InspectorControls:function(){return Ho},JustifyContentControl:function(){return gr},JustifyToolbar:function(){return hr},LineHeightControl:function(){return zg},MediaPlaceholder:function(){return m_},MediaReplaceFlow:function(){return a_},MediaUpload:function(){return i_},MediaUploadCheck:function(){return s_},MultiSelectScrollIntoView:function(){return Ey},NavigableToolbar:function(){return Rp},ObserveTyping:function(){return By},PanelColorSettings:function(){return f_},PlainText:function(){return U_},RichText:function(){return V_},RichTextShortcut:function(){return j_},RichTextToolbarButton:function(){return K_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return dy},ToolSelector:function(){return Q_},Typewriter:function(){return Ny},URLInput:function(){return Ok},URLInputButton:function(){return ey},URLPopover:function(){return d_},Warning:function(){return al},WritingFlow:function(){return Yc},__experimentalBlockAlignmentMatrixControl:function(){return Vv},__experimentalBlockContentOverlay:function(){return Uv},__experimentalBlockFullHeightAligmentControl:function(){return zv},__experimentalBlockPatternSetup:function(){return Tb},__experimentalBlockPatternsList:function(){return Id},__experimentalBlockVariationPicker:function(){return kb},__experimentalBlockVariationTransforms:function(){return Mb},__experimentalBorderRadiusControl:function(){return Hf},__experimentalBorderStyleControl:function(){return Ob},__experimentalColorGradientControl:function(){return gg},__experimentalColorGradientSettingsDropdown:function(){return $b},__experimentalDateFormatPicker:function(){return Ub},__experimentalDuotoneControl:function(){return $h},__experimentalFontAppearanceControl:function(){return Fg},__experimentalFontFamilyControl:function(){return Yg},__experimentalGetBorderClassesAndStyles:function(){return sv},__experimentalGetColorClassesAndStyles:function(){return cv},__experimentalGetGradientClass:function(){return ig},__experimentalGetGradientObjectByGradientValue:function(){return ag},__experimentalGetMatchingVariation:function(){return Ly},__experimentalGetSpacingClassesAndStyles:function(){return pv},__experimentalImageEditingProvider:function(){return kk},__experimentalImageEditor:function(){return Tk},__experimentalImageSizeControl:function(){return Pk},__experimentalImageURLInputUI:function(){return ay},__experimentalLayoutStyle:function(){return Rr},__experimentalLetterSpacingControl:function(){return wh},__experimentalLibrary:function(){return ky},__experimentalLinkControl:function(){return o_},__experimentalLinkControlSearchInput:function(){return Yk},__experimentalLinkControlSearchItem:function(){return Vk},__experimentalLinkControlSearchResults:function(){return Uk},__experimentalListView:function(){return db},__experimentalPanelColorGradientSettings:function(){return Jb},__experimentalPreviewOptions:function(){return cy},__experimentalResponsiveBlockControl:function(){return $_},__experimentalTextDecorationControl:function(){return mh},__experimentalTextTransformControl:function(){return yh},__experimentalToolsPanelColorDropdown:function(){return hg},__experimentalUnitControl:function(){return Z_},__experimentalUseBlockPreview:function(){return ld},__experimentalUseBorderProps:function(){return av},__experimentalUseColorProps:function(){return dv},__experimentalUseCustomSides:function(){return Jo},__experimentalUseGradient:function(){return ug},__experimentalUseNoRecursiveRenders:function(){return Ry},__experimentalUseResizeCanvas:function(){return uy},__unstableBlockNameContext:function(){return Zm},__unstableBlockSettingsMenuFirstItem:function(){return Tm},__unstableBlockToolbarLastItem:function(){return vm},__unstableEditorStyles:function(){return ed},__unstableIframe:function(){return Xc},__unstableInserterMenuExtension:function(){return np},__unstablePresetDuotoneFilter:function(){return tv},__unstableRichTextInputEvent:function(){return q_},__unstableUseBlockSelectionClearer:function(){return Ac},__unstableUseClipboardHandler:function(){return Em},__unstableUseMouseMoveTypingReset:function(){return Sy},__unstableUseTypewriter:function(){return Ty},__unstableUseTypingObserver:function(){return wy},createCustomColorsHOC:function(){return vv},getColorClassName:function(){return $f},getColorObjectByAttributeValues:function(){return Uf},getColorObjectByColorValue:function(){return Wf},getFontSize:function(){return eh},getFontSizeClass:function(){return nh},getFontSizeObjectByValue:function(){return th},getGradientSlugByValue:function(){return cg},getGradientValueBySlug:function(){return sg},getPxFromCssUnit:function(){return Wy},store:function(){return Qn},storeConfig:function(){return Yn},transformStyles:function(){return Zu},useBlockDisplayInformation:function(){return Ip},useBlockEditContext:function(){return eo},useBlockProps:function(){return kc},useCachedTruthy:function(){return mv},useInnerBlocksProps:function(){return yf},useSetting:function(){return To},withColorContext:function(){return Fb},withColors:function(){return bv},withFontSizes:function(){return _v}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return zt},__experimentalGetAllowedBlocks:function(){return kt},__experimentalGetAllowedPatterns:function(){return Ct},__experimentalGetBlockListSettingsForBlocks:function(){return Tt},__experimentalGetDirectInsertBlock:function(){return _t},__experimentalGetGlobalBlocksByName:function(){return te},__experimentalGetLastBlockAttributeChanges:function(){return Mt},__experimentalGetParsedPattern:function(){return yt},__experimentalGetPatternTransformItems:function(){return wt},__experimentalGetPatternsByBlockTypes:function(){return St},__experimentalGetReusableBlockTitle:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return q},__unstableGetClientIdWithClientIdsTree:function(){return Q},__unstableGetClientIdsTree:function(){return Z},__unstableGetSelectedBlocksWithPartialSelection:function(){return Le},__unstableIsFullySelected:function(){return Pe},__unstableIsLastBlockChangeIgnored:function(){return Pt},__unstableIsSelectionCollapsed:function(){return Me},__unstableIsSelectionMergeable:function(){return Re},areInnerBlocksControlled:function(){return Ft},canEditBlock:function(){return ct},canInsertBlockType:function(){return ot},canInsertBlocks:function(){return rt},canLockBlockType:function(){return ut},canMoveBlock:function(){return st},canMoveBlocks:function(){return at},canRemoveBlock:function(){return lt},canRemoveBlocks:function(){return it},didAutomaticChange:function(){return Dt},getAdjacentBlockClientId:function(){return ve},getBlock:function(){return K},getBlockAttributes:function(){return j},getBlockCount:function(){return oe},getBlockHierarchyRootClientId:function(){return ge},getBlockIndex:function(){return De},getBlockInsertionPoint:function(){return Qe},getBlockListSettings:function(){return Bt},getBlockMode:function(){return Ue},getBlockName:function(){return W},getBlockOrder:function(){return Ae},getBlockParents:function(){return me},getBlockParentsByBlockName:function(){return fe},getBlockRootClientId:function(){return pe},getBlockSelectionEnd:function(){return se},getBlockSelectionStart:function(){return ie},getBlockTransformItems:function(){return vt},getBlocks:function(){return Y},getBlocksByClientId:function(){return ne},getClientIdsOfDescendants:function(){return X},getClientIdsWithDescendants:function(){return J},getDraggedBlockClientIds:function(){return je},getFirstMultiSelectedBlockClientId:function(){return Se},getGlobalBlockCount:function(){return ee},getInserterItems:function(){return ht},getLastMultiSelectedBlockClientId:function(){return we},getLowestCommonAncestorWithSelectedBlock:function(){return he},getMultiSelectedBlockClientIds:function(){return Ee},getMultiSelectedBlocks:function(){return Ce},getMultiSelectedBlocksEndClientId:function(){return Ne},getMultiSelectedBlocksStartClientId:function(){return Te},getNextBlockClientId:function(){return ke},getPreviousBlockClientId:function(){return be},getSelectedBlock:function(){return de},getSelectedBlockClientId:function(){return ue},getSelectedBlockClientIds:function(){return ye},getSelectedBlockCount:function(){return ae},getSelectedBlocksInitialCaretPosition:function(){return _e},getSelectionEnd:function(){return le},getSelectionStart:function(){return re},getSettings:function(){return It},getTemplate:function(){return Je},getTemplateLock:function(){return et},hasBlockMovingClientId:function(){return At},hasInserterItems:function(){return bt},hasMultiSelection:function(){return Ve},hasSelectedBlock:function(){return ce},hasSelectedInnerBlock:function(){return Fe},isAncestorBeingDragged:function(){return qe},isAncestorMultiSelected:function(){return xe},isBlockBeingDragged:function(){return Ke},isBlockHighlighted:function(){return Ot},isBlockInsertionPointVisible:function(){return Ze},isBlockMultiSelected:function(){return Ie},isBlockSelected:function(){return Oe},isBlockValid:function(){return $},isBlockWithinSelection:function(){return ze},isCaretWithinFormattedText:function(){return Ye},isDraggingBlocks:function(){return $e},isFirstMultiSelectedBlock:function(){return Be},isLastBlockChangePersistent:function(){return xt},isMultiSelecting:function(){return He},isNavigationMode:function(){return Lt},isSelectionEnabled:function(){return Ge},isTyping:function(){return We},isValidTemplate:function(){return Xe},wasBlockJustInserted:function(){return Vt}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return vn},__unstableExpandSelection:function(){return kn},__unstableMarkAutomaticChange:function(){return zn},__unstableMarkLastChangeAsPersistent:function(){return On},__unstableMarkNextChangeAsNotPersistent:function(){return Fn},__unstableSaveReusableBlock:function(){return Dn},__unstableSplitSelection:function(){return bn},clearSelectedBlock:function(){return en},duplicateBlocks:function(){return Gn},enterFormattedText:function(){return Nn},exitFormattedText:function(){return Pn},flashBlock:function(){return jn},hideInsertionPoint:function(){return fn},insertAfterBlock:function(){return Wn},insertBeforeBlock:function(){return Un},insertBlock:function(){return dn},insertBlocks:function(){return pn},insertDefaultBlock:function(){return Rn},mergeBlocks:function(){return yn},moveBlockToPosition:function(){return un},moveBlocksDown:function(){return sn},moveBlocksToPosition:function(){return cn},moveBlocksUp:function(){return an},multiSelect:function(){return Jt},receiveBlocks:function(){return $t},removeBlock:function(){return Cn},removeBlocks:function(){return En},replaceBlock:function(){return rn},replaceBlocks:function(){return on},replaceInnerBlocks:function(){return Sn},resetBlocks:function(){return Gt},resetSelection:function(){return Wt},selectBlock:function(){return qt},selectNextBlock:function(){return Qt},selectPreviousBlock:function(){return Yt},selectionChange:function(){return Mn},setBlockMovingClientId:function(){return Hn},setHasControlledInnerBlocks:function(){return Kn},setNavigationMode:function(){return Vn},setTemplateValidity:function(){return gn},showInsertionPoint:function(){return mn},startDraggingBlocks:function(){return xn},startMultiSelect:function(){return Zt},startTyping:function(){return Bn},stopDraggingBlocks:function(){return Tn},stopMultiSelect:function(){return Xt},stopTyping:function(){return In},synchronizeTemplate:function(){return hn},toggleBlockHighlight:function(){return $n},toggleBlockMode:function(){return wn},toggleSelection:function(){return tn},updateBlock:function(){return Kt},updateBlockAttributes:function(){return jt},updateBlockListSettings:function(){return Ln},updateSettings:function(){return An},validateBlocksToTemplate:function(){return Ut}});var 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}).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}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(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)}function _(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,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(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 I(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 x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(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=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(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=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(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:!w(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,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);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=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){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}var N,P,M=(0,m.combineReducers)({blocks:x,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:T(r.selectionStart,l),selectionEnd:T(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;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,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,m.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(e,t){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 null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode: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_NAVIGATION_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"START_TYPING":case"STOP_TYPING":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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(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 D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(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(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(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,V=window.wp.deprecated,H=n.n(V);function G(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const U=[];function W(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 $(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function j(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function K(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const q=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:j(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function Y(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)||U}const Q=D(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Q(e,t)))}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...X(e,[t]));return n}),(e=>[e.blocks.order])),J=D((e=>{const t=[];for(const n of Ae(e))t.push(n,...X(e,[n]));return t}),(e=>[e.blocks.order])),ee=D(((e,t)=>{const n=J(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),te=D(((e,t)=>{if(!t)return U;const n=J(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:U}),(e=>[e.blocks.order,e.blocks.byClientId])),ne=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>K(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function oe(e,t){return Ae(e,t).length}function re(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function ie(e){return e.selection.selectionStart.clientId}function se(e){return e.selection.selectionEnd.clientId}function ae(e){return Ee(e).length||(e.selection.selectionStart.clientId?1:0)}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ue(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function de(e){const t=ue(e);return t?K(e,t):null}function pe(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const me=D((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])),fe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=me(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:W(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=ue(e),o=[...me(e,t),t],r=[...me(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 ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ue(e)),void 0===t&&(t=n<0?Se(e):we(e)),!t)return null;const o=pe(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 be(e,t){return ve(e,t,-1)}function ke(e,t){return ve(e,t,1)}function _e(e){return e.initialPosition}const ye=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return U;if(t.clientId===n.clientId)return[t.clientId];const o=pe(e,t.clientId);if(null===o)return U;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 Ee(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?U:ye(e)}const Ce=D((e=>{const t=Ee(e);return t.length?t.map((t=>K(e,t))):U}),(e=>[...ye.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Se(e){return(0,u.first)(Ee(e))||null}function we(e){return(0,u.last)(Ee(e))||null}function Be(e,t){return Se(e)===t}function Ie(e,t){return-1!==Ee(e).indexOf(t)}const xe=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=pe(e,n),o=Ie(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Pe(e){const t=re(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Me(e){const t=re(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Re(e,t){const n=re(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 l=pe(e,n.clientId);if(l!==pe(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=K(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=K(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Le=e=>{const t=re(e),n=le(e);if(t.clientId===n.clientId)return U;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return U;const o=pe(e,t.clientId);if(o!==pe(e,n.clientId))return U;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=K(e,a.clientId),d=(0,r.getBlockType)(u.name),p=K(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...G(h)}),k=(0,z.create)({html:g,...G(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,...G(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...G(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||U}function De(e,t){return Ae(e,pe(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Ie(e,t)||n&&Fe(e,t,n)))}function ze(e,t){if(!t)return!1;const n=Ee(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=me(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return H()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=pe(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:null}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,f=W(e,o),g=tt(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...me(e,o)];h=(0,u.some)(t,(t=>tt(v,W(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:K.bind(null,e),getBlockParentsByBlockName:fe.bind(null,e)}):b},ot=D(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,W(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=j(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ft(r,l)}},ft=(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}},gt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(ne(e,J(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ft(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}}},ht=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(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=F;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=ft(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)?Rt(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,Rt(e),(0,r.getBlockTypes)()])),vt=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=gt(e,{buildScope:"transform"}),s=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(i),a=(0,u.mapKeys)(s,(e=>{let{name:t}=e;return t}));a["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=a[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(a["*"]):a[null==t?void 0:t.name]&&e.push(a[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>a[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=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Rt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,r.getBlockTypes)()])),kt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),_t=D((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(K(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=D(((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=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(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)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;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=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ft(e,n)})))return U;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=D((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=D(((e,t)=>{var n;const o=(0,u.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 Mt(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:U}function Lt(e){return e.isNavigationMode}function At(e){return e.hasBlockMovingClientId}function Dt(e){return!!e.automaticChangeStatus}function Ot(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const zt=D(((e,t)=>{if(!t.length)return null;const n=ue(e);if(t.includes(W(e,n)))return n;const o=Ee(e),r=fe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Vt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ht=window.wp.a11y;const Gt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ut(e))},Ut=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 Wt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function $t(e){return H()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Kt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function qt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Zt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Jt=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,Ht.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function en(){return{type:"CLEAR_SELECTED_BLOCK"}}function tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function nn(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 on=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=(0,u.castArray)(e),t=nn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));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 rn(e,t){return on(e,t)}const ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},sn=ln("MOVE_BLOCKS_DOWN"),an=ln("MOVE_BLOCKS_UP"),cn=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 un(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 cn([e],t,n,o)}function dn(e,t,n,o,r){return pn([e],t,n,o,0,r)}const pn=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;(0,u.isObject)(r)&&(l=r,r=0,H()("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=nn((0,u.castArray)(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 mn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function fn(){return{type:"HIDE_INSERTION_POINT"}}function gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hn=()=>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)},vn=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 d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...G(S)}),I=(0,z.create)({html:C,...G(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...G(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...G(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf(""))),L=M[R],A=(0,z.create)({html:L,...G(g.attributes[R])}),D=A.text.indexOf(""),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...G(g.attributes[R])});M[R]=F;const V=o.getSelectedBlockClientIds(),H=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(V,H,0,o.getSelectedBlocksInitialCaretPosition())}))},bn=()=>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),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...G(b)}),y=(0,z.create)({html:v,...G(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:_,...G(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...G(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},kn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},yn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?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 g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...G(v)}),"",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...G(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],n=(0,z.create)({html:t,...G(d.attributes[e])}),o=n.text.indexOf(""),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...G(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},En=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=(0,u.castArray)(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 Cn(e,t){return En([e],t)}function Sn(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 wn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Bn(){return{type:"START_TYPING"}}function In(){return{type:"STOP_TYPING"}}function xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Tn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Nn(){return H()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Pn(){return H()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Mn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Rn=(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 Ln(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function An(e){return{type:"UPDATE_SETTINGS",settings:e}}function Dn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function On(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Fn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const zn=()=>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"})}))},Vn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ht.speak)((0,g.__)("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.")):(0,Ht.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Hn=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,Ht.speak)((0,g.__)("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."))}},Gn=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((0,u.some)(i,(e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Un=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)},Wn=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 $n(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const jn=e=>async t=>{let{dispatch:n}=t;n($n(e,!0)),await new Promise((e=>setTimeout(e,150))),n($n(e,!1))};function Kn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const qn="core/block-editor",Yn={reducer:M,selectors:e,actions:t},Qn=(0,m.createReduxStore)(qn,{...Yn,persist:["preferences"]});(0,m.registerStore)(qn,{...Yn,persist:["preferences"]});const Zn={name:"",isSelected:!1},Xn=(0,s.createContext)(Zn),{Provider:Jn}=Xn;function eo(){return(0,s.useContext)(Xn)}function to(){const{isSelected:e,clientId:t,name:n}=eo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function no(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=to(),{clientId:o}=eo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function oo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const ro=no;ro.Slot=oo;const lo=e=>(0,s.createElement)(no,i({group:"inline"},e));lo.Slot=e=>(0,s.createElement)(oo,i({group:"inline"},e));var io=ro,so=(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"})),ao=(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"})),co=(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"})),uo=(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"})),po=(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"})),mo=(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"})),fo=(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"})),go=(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"})),ho=(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"})),vo=(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"})),bo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),ko=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function _o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const yo=(0,s.createContext)({refs:new Map,callbacks:new Map});function Eo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(yo.Provider,{value:n},t)}function Co(e){const{refs:t,callbacks:n}=(0,s.useContext)(yo),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function So(e){const{refs:t}=(0,s.useContext)(yo),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function wo(e){const{callbacks:t}=(0,s.useContext)(yo),n=So(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const Bo=["color","border","typography","spacing"],Io={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0: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=>void 0===e.fontSizes?void 0: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},xo={"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 To(e){const{name:t}=eo();return(0,m.useSelect)((n=>{var o;if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Qn).getSettings(),i=(e=>xo[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=Io[i]?Io[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var No={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Po(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=to(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Mo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Mo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Ro(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Lo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Ro(c.attributes,e,t)})}))})),c}function Ao(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 Do(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Qn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Mo(r.style)},t[n]=r})),r(n,t,!0)}),[Mo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Oo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Fo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=No[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Do,{group:n,label:o},(0,s.createElement)(Oo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const zo=Po;zo.Slot=Fo;const Vo=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Vo.Slot=e=>(0,s.createElement)(Fo,i({},e,{__experimentalGroup:"advanced"})),Vo.slotName="InspectorAdvancedControls";var Ho=zo;function Go(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.margin)}function Uo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!er(e,"margin");return!Go(e)||t||n}function Wo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=Jo(n,"margin"),a=i&&i.some((e=>Qo.includes(e)));return Uo(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Mo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Mo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function $o(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.padding)}function jo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!er(e,"padding");return!$o(e)||t||n}function Ko(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=Jo(n,"padding"),a=i&&i.some((e=>Qo.includes(e)));return jo(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Mo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Mo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const qo="spacing",Yo=["top","right","bottom","left"],Qo=["vertical","horizontal"];function Zo(e){const t=or(e),n=jo(e),o=Uo(e),l=Xo(e),i=(a=e.name,"web"===s.Platform.OS&&(tr(a)||$o(a)||Go(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[qo,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(Ho,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Ko,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Wo,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{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,g.__)("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:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(rr,e)))}const Xo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=or(e),n=jo(e),o=Uo(e);return t&&n&&o};function Jo(e,t){const n=(0,r.getBlockSupport)(e,qo);if(n&&"boolean"!=typeof n[t])return n[t]}function er(e,t){const n=Jo(e,t);return!(n&&n.some((e=>Yo.includes(e)))&&n.some((e=>Qo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function tr(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.blockGap)}function nr(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 or(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.blockGap");return!tr(e)||t}function rr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),a=Jo(r,"blockGap"),c=So(n);if(or(e))return null;const u=a&&a.some((e=>Qo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...nr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Mo(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;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=nr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const lr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),ir=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),sr={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:ir,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:lr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ar=["top","center","bottom"],cr={isAlternate:!0};var ur=function(e){let{value:t,onChange:n,controls:o=ar,isCollapsed:r=!0,isToolbar:l}=e;const a=sr[t],c=sr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:cr,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...sr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const dr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!1})),pr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!0})),mr={left:fo,center:go,right:ho,"space-between":vo};var fr=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?mr[r]:mr.left,d=[{name:"left",icon:fo,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:vo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const gr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!1})),hr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!0})),vr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},br={left:"flex-start",right:"flex-end",center:"center"},kr={top:"flex-start",center:"center",bottom:"flex-end"},_r=["wrap","nowrap"];var yr={name:"flex",label:(0,g.__)("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)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Cr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(wr,{layout:t,onChange:n}))),(0,s.createElement)(Sr,{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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Cr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Er,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==To("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Ao(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=nr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=vr[r.justifyContent]||vr.left,p=_r.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${kr[r.verticalAlignment]||kr.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${br[r.justifyContent]||br.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${_o(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${_o(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Er(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=kr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(dr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Cr(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)(gr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:fo,label:(0,g.__)("Justify items left")},{value:"center",icon:go,label:(0,g.__)("Justify items center")},{value:"right",icon:ho,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:vo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Sr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function wr(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:bo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:ko,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Br=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Ir=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("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)(p.__experimentalUnitControl,{label:(0,g.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(Br,{icon:co})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Br,{icon:po}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==To("spacing.blockGap"),u=nr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Ao(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${_o(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${_o(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${_o(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${_o(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${_o(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${_o(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${_o(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${_o(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(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,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),o}(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}},yr];function xr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Ir.find((t=>t.name===e))}const Tr={type:"default"},Nr=(0,s.createContext)(Tr),Pr=Nr.Provider;function Mr(){return(0,s.useContext)(Nr)}function Rr(e){let{layout:t={},...n}=e;const o=xr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Lr=["none","left","center","right","wide","full"],Ar=["wide","full"];function Dr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Mr(),r=xr(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)return[];const{alignments:i=Lr}=o,s=e.filter((e=>(o.alignments||t||!Ar.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Or={none:{icon:so,title:(0,g._x)("None","Alignment option")},left:{icon:ao,title:(0,g.__)("Align left")},center:{icon:co,title:(0,g.__)("Align center")},right:{icon:uo,title:(0,g.__)("Align right")},wide:{icon:po,title:(0,g.__)("Wide width")},full:{icon:mo,title:(0,g.__)("Full width")}},Fr={isAlternate:!0};var zr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Dr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Or[t],m=Or.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Fr,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Or[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Or[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.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)(f,i({},h,v))};const Vr=e=>(0,s.createElement)(zr,i({},e,{isToolbar:!1})),Hr=e=>(0,s.createElement)(zr,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?(0,u.without)(t,...Ur):t}const $r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Dr(Wr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Vr,{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:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),jr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Dr(Wr((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){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Gr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",jr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",$r),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Wr((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){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Kr=/[\s#]/g,qr={type:"string",source:"attribute",attribute:"id",selector:"*"},Yr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("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)(Ho,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Ho,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:qr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Yr),(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 Qr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Ho,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");function Zr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Qr),(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=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Xr=[{name:"margin",generate:(e,t)=>Zr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Zr(e,t,["spacing","padding"],"padding")}];function Jr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var el=window.wp.dom;const tl=(0,s.createContext)({});function nl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(tl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(tl.Provider,{value:r,children:n})}var ol=tl;const rl={};var ll=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(ol),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):rl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function il(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Jn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(ll,e))}var sl=(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"})),al=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(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)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:sl,label:(0,g.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},cl=n(1973);function ul(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,el.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var dl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,cl.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ul,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(ul,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const pl=e=>(0,r.rawHandler)({HTML:e.originalContent});var ml=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Qn);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,pl(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)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
+
title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(al,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
10 |
+
(0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(dl,{block:i,onKeep:t,onConvert:n,convertor:pl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const fl=(0,s.createElement)(al,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var gl=()=>fl;class hl 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}}var vl=hl,bl=n(773),kl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(bl.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 _l=Al();const yl=e=>Pl(e,_l);let El=Al();yl.write=e=>Pl(e,El);let Cl=Al();yl.onStart=e=>Pl(e,Cl);let Sl=Al();yl.onFrame=e=>Pl(e,Sl);let wl=Al();yl.onFinish=e=>Pl(e,wl);let Bl=[];yl.setTimeout=(e,t)=>{let n=yl.now()+t,o=()=>{let e=Bl.findIndex((e=>e.cancel==o));~e&&Bl.splice(e,1),Ol.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Bl.splice(Il(n),0,r),Ol.count+=1,Ml(),r};let Il=e=>~(~Bl.findIndex((t=>t.time>e))||~Bl.length);yl.cancel=e=>{_l.delete(e),El.delete(e)},yl.sync=e=>{Nl=!0,yl.batchedUpdates(e),Nl=!1},yl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,yl.onStart(n)}return o.handler=e,o.cancel=()=>{Cl.delete(n),t=null},o};let xl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};yl.use=e=>xl=e,yl.now="undefined"!=typeof performance?()=>performance.now():Date.now,yl.batchedUpdates=e=>e(),yl.catch=console.error,yl.frameLoop="always",yl.advance=()=>{"demand"!==yl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ll()};let Tl=-1,Nl=!1;function Pl(e,t){Nl?(t.delete(e),e(0)):(t.add(e),Ml())}function Ml(){Tl<0&&(Tl=0,"demand"!==yl.frameLoop&&xl(Rl))}function Rl(){~Tl&&(xl(Rl),yl.batchedUpdates(Ll))}function Ll(){let e=Tl;Tl=yl.now();let t=Il(Tl);t&&(Dl(Bl.splice(0,t),(e=>e.handler())),Ol.count-=t),Cl.flush(),_l.flush(e?Math.min(64,Tl-e):16.667),Sl.flush(),El.flush(),wl.flush()}function Al(){let e=new Set,t=e;return{add(n){Ol.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ol.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ol.count-=t.size,Dl(t,(t=>t(n)&&e.add(t))),Ol.count+=e.size,t=e)}}}function Dl(e,t){e.forEach((e=>{try{t(e)}catch(e){yl.catch(e)}}))}const Ol={count:0,clear(){Tl=-1,Bl=[],Cl=Al(),_l=Al(),Sl=Al(),El=Al(),wl=Al(),Ol.count=0}};var Fl=n(9196),zl=n.n(Fl);function Vl(){}const Hl={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 Gl(e,t){if(Hl.arr(e)){if(!Hl.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 Ul=(e,t)=>e.forEach(t);function Wl(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const $l=e=>Hl.und(e)?[]:Hl.arr(e)?e:[e];function jl(e,t){if(e.size){const n=Array.from(e);e.clear(),Ul(n,t)}}const Kl=(e,...t)=>jl(e,(e=>e(...t)));let ql,Yl,Ql=null,Zl=!1,Xl=Vl;var Jl=Object.freeze({__proto__:null,get createStringInterpolator(){return ql},get to(){return Yl},get colors(){return Ql},get skipAnimation(){return Zl},get willAdvance(){return Xl},assign:e=>{e.to&&(Yl=e.to),e.now&&(yl.now=e.now),void 0!==e.colors&&(Ql=e.colors),null!=e.skipAnimation&&(Zl=e.skipAnimation),e.createStringInterpolator&&(ql=e.createStringInterpolator),e.requestAnimationFrame&&yl.use(e.requestAnimationFrame),e.batchedUpdates&&(yl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Xl=e.willAdvance),e.frameLoop&&(yl.frameLoop=e.frameLoop)}});const ei=new Set;let ti=[],ni=[],oi=0;const ri={get idle(){return!ei.size&&!ti.length},start(e){oi>e.priority?(ei.add(e),yl.onStart(li)):(ii(e),yl(ai))},advance:ai,sort(e){if(oi)yl.onFrame((()=>ri.sort(e)));else{const t=ti.indexOf(e);~t&&(ti.splice(t,1),si(e))}},clear(){ti=[],ei.clear()}};function li(){ei.forEach(ii),ei.clear(),yl(ai)}function ii(e){ti.includes(e)||si(e)}function si(e){ti.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ti),0,e)}function ai(e){const t=ni;for(let n=0;n<ti.length;n++){const o=ti[n];oi=o.priority,o.idle||(Xl(o),o.advance(e),o.idle||t.push(o))}return oi=0,ni=ti,ni.length=0,ti=t,ti.length>0}const ci="[-+]?\\d*\\.?\\d+",ui=ci+"%";function di(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const pi=new RegExp("rgb"+di(ci,ci,ci)),mi=new RegExp("rgba"+di(ci,ci,ci,ci)),fi=new RegExp("hsl"+di(ci,ui,ui)),gi=new RegExp("hsla"+di(ci,ui,ui,ci)),hi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,bi=/^#([0-9a-fA-F]{6})$/,ki=/^#([0-9a-fA-F]{8})$/;function _i(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 yi(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=_i(r,o,e+1/3),i=_i(r,o,e),s=_i(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Ei(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ci(e){return(parseFloat(e)%360+360)%360/360}function Si(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function wi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Bi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=bi.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ql&&void 0!==Ql[e]?Ql[e]:(t=pi.exec(e))?(Ei(t[1])<<24|Ei(t[2])<<16|Ei(t[3])<<8|255)>>>0:(t=mi.exec(e))?(Ei(t[1])<<24|Ei(t[2])<<16|Ei(t[3])<<8|Si(t[4]))>>>0:(t=hi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ki.exec(e))?parseInt(t[1],16)>>>0:(t=vi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=fi.exec(e))?(255|yi(Ci(t[1]),wi(t[2]),wi(t[3])))>>>0:(t=gi.exec(e))?(yi(Ci(t[1]),wi(t[2]),wi(t[3]))|Si(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 Ii=(e,t,n)=>{if(Hl.fun(e))return e;if(Hl.arr(e))return Ii({range:e,output:t,extrapolate:n});if(Hl.str(e.output[0]))return ql(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 xi(){return(xi=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}).apply(this,arguments)}const Ti=Symbol.for("FluidValue.get"),Ni=Symbol.for("FluidValue.observers"),Pi=e=>Boolean(e&&e[Ti]),Mi=e=>e&&e[Ti]?e[Ti]():e,Ri=e=>e[Ni]||null;function Li(e,t){let n=e[Ni];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ai{constructor(e){if(this[Ti]=void 0,this[Ni]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Di(this,e)}}const Di=(e,t)=>zi(e,Ti,t);function Oi(e,t){if(e[Ti]){let n=e[Ni];n||zi(e,Ni,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Fi(e,t){let n=e[Ni];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ni]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const zi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Vi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Hi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Gi;const Ui=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Wi=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,$i=e=>{Gi||(Gi=Ql?new RegExp(`(${Object.keys(Ql).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Mi(e).replace(Hi,Bi).replace(Gi,Bi))),n=t.map((e=>e.match(Vi).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]})))).map((t=>Ii(xi({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Vi,(()=>String(o[n++](e)))).replace(Ui,Wi)}},ji="react-spring: ",Ki=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ji}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},qi=Ki(console.warn),Yi=Ki(console.warn);function Qi(e){return Hl.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Ql||{}))}const Zi=e=>(0,Fl.useEffect)(e,Xi),Xi=[];function Ji(){const e=(0,Fl.useState)()[1],t=(0,Fl.useState)(es)[0];return Zi(t.unmount),()=>{t.current&&e({})}}function es(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ts(e){const t=(0,Fl.useRef)();return(0,Fl.useEffect)((()=>{t.current=e})),t.current}const ns="undefined"!=typeof window&&window.document&&window.document.createElement?Fl.useLayoutEffect:Fl.useEffect,os=Symbol.for("Animated:node"),rs=e=>e&&e[os],ls=(e,t)=>{return n=e,o=os,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},is=e=>e&&e[os]&&e[os].getPayload();class ss{constructor(){this.payload=void 0,ls(this,this)}getPayload(){return this.payload||[]}}class as extends ss{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,Hl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new as(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Hl.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,Hl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class cs extends as{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Ii({output:[e,e]})}static create(e){return new cs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Hl.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=Ii({output:[this.getValue(),e]})),this._value=0,super.reset()}}const us={dependencies:null};class ds extends ss{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Wl(this.source,((n,o)=>{var r;(r=n)&&r[os]===r?t[o]=n.getValue(e):Pi(n)?t[o]=Mi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ul(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Wl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){us.dependencies&&Pi(e)&&us.dependencies.add(e);const t=is(e);t&&Ul(t,(e=>this.add(e)))}}class ps extends ds{constructor(e){super(e)}static create(e){return new ps(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(ms)),!0)}}function ms(e){return(Qi(e)?cs:as).create(e)}function fs(e){const t=rs(e);return t?t.constructor:Hl.arr(e)?ps:Qi(e)?cs:as}function gs(){return(gs=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}).apply(this,arguments)}const hs=(e,t)=>{const n=!Hl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Fl.forwardRef)(((o,r)=>{const l=(0,Fl.useRef)(null),i=n&&(0,Fl.useCallback)((e=>{l.current=function(e,t){return e&&(Hl.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return us.dependencies=n,e.style&&(e=gs({},e,{style:t.createAnimatedStyle(e.style)})),e=new ds(e),us.dependencies=null,[e,n]}(o,t),c=Ji(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new vs(u,a),p=(0,Fl.useRef)();ns((()=>{const e=p.current;p.current=d,Ul(a,(e=>Oi(e,d))),e&&(Ul(e.deps,(t=>Fi(t,e))),yl.cancel(e.update))})),(0,Fl.useEffect)(u,[]),Zi((()=>()=>{const e=p.current;Ul(e.deps,(t=>Fi(t,e)))}));const m=t.getComponentProps(s.getValue());return Fl.createElement(e,gs({},m,{ref:i}))}))};class vs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&yl.write(this.update)}}const bs=Symbol.for("AnimatedComponent"),ks=e=>Hl.str(e)?e:e&&Hl.str(e.displayName)?e.displayName:Hl.fun(e)&&e.name||null;function _s(){return(_s=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}).apply(this,arguments)}function ys(e,...t){return Hl.fun(e)?e(...t):e}const Es=(e,t)=>!0===e||!!(t&&e&&(Hl.fun(e)?e(t):$l(e).includes(t))),Cs=(e,t)=>Hl.obj(e)?t&&e[t]:e,Ss=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ws=e=>e,Bs=(e,t=ws)=>{let n=Is;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);Hl.und(n)||(o[r]=n)}return o},Is=["config","onProps","onStart","onChange","onPause","onResume","onRest"],xs={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 Ts(e){const t=function(e){const t={};let n=0;if(Wl(e,((e,o)=>{xs[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Wl(e,((e,o)=>o in t||(n[o]=e))),n}return _s({},e)}function Ns(e){return e=Mi(e),Hl.arr(e)?e.map(Ns):Qi(e)?Jl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ps(e){for(const t in e)return!0;return!1}function Ms(e){return Hl.fun(e)||Hl.arr(e)&&Hl.obj(e[0])}function Rs(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ls(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const As=_s({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Ds{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,As)}}function Os(e,t){if(Hl.und(t.decay)){const n=!Hl.und(t.tension)||!Hl.und(t.friction);!n&&Hl.und(t.frequency)&&Hl.und(t.damping)&&Hl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Fs=[];class zs{constructor(){this.changed=!1,this.values=Fs,this.toValues=null,this.fromValues=Fs,this.to=void 0,this.from=void 0,this.config=new Ds,this.immediate=!1}}function Vs(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Es(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Hl.und(n.pause)||(r.paused=Es(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Es(e,t)),c=ys(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-yl.now()}function m(){c>0?(u=yl.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(_s({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Hs=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Ws(e.get()):t.every((e=>e.noop))?Gs(e.get()):Us(e.get(),t.every((e=>e.finished))),Gs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Us=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ws=e=>({value:e,cancelled:!0,finished:!1});function $s(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=Bs(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)&&Ws(o)||r!==n.asyncId&&Us(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ks,i=new qs;return(async()=>{if(Jl.skipAnimation)throw js(n),i.result=Us(o,!1),d(i),i;m(l);const s=Hl.obj(e)?_s({},e):_s({},t,{to:e});s.parentId=r,Wl(c,((e,t)=>{Hl.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 g;if(Jl.skipAnimation)return js(n),Us(o,!1);try{let t;t=Hl.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Us(o.get(),!0,!1)}catch(e){if(e instanceof Ks)g=e.result;else{if(!(e instanceof qs))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Hl.fun(i)&&yl.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function js(e,t){jl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ks 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 qs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ys=e=>e instanceof Zs;let Qs=1;class Zs extends Ai{constructor(...e){super(...e),this.id=Qs++,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=rs(this);return e&&e.getValue()}to(...e){return Jl.to(this,e)}interpolate(...e){return qi(`${ji}The "interpolate" function is deprecated in v9 (use "to" instead)`),Jl.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){Li(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ri.sort(this),Li(this,{type:"priority",parent:this,priority:e})}}const Xs=Symbol.for("SpringPhase"),Js=e=>(1&e[Xs])>0,ea=e=>(2&e[Xs])>0,ta=e=>(4&e[Xs])>0,na=(e,t)=>t?e[Xs]|=3:e[Xs]&=-3,oa=(e,t)=>t?e[Xs]|=4:e[Xs]&=-5;class ra extends Zs{constructor(e,t){if(super(),this.key=void 0,this.animation=new zs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Hl.und(e)||!Hl.und(t)){const n=Hl.obj(e)?_s({},e):_s({},t,{from:e});Hl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ea(this)||this._state.asyncTo)||ta(this)}get goal(){return Mi(this.animation.to)}get velocity(){const e=rs(this);return e instanceof as?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Js(this)}get isAnimating(){return ea(this)}get isPaused(){return ta(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=is(o.to);!i&&Pi(o.to)&&(l=$l(Mi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==cs?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=Hl.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Hl.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)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Hl.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=rs(this),a=s.getValue();if(t){const e=Mi(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 yl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ea(this)){const{to:e,config:t}=this.animation;yl.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 Hl.und(e)?(n=this.queue||[],this.queue=[]):n=[Hl.obj(e)?e:_s({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Hs(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),js(this._state,e&&this._lastCallId),yl.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=Hl.obj(n)?n[t]:n,(null==n||Ms(n))&&(n=void 0),o=Hl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Js(this)||(e.reverse&&([n,o]=[o,n]),o=Mi(o),Hl.und(o)?rs(this)||this._set(n):this._set(o)),r}_update(e,t){let n=_s({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Bs(n,((e,t)=>/^on/.test(t)?Cs(e,o):e))),da(this,n,"onProps"),pa(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 Vs(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ta(this)||(oa(this,!0),Kl(i.pauseQueue),pa(this,"onPause",Us(this,la(this,this.animation.to)),this))},resume:()=>{ta(this)&&(oa(this,!1),ea(this)&&this._resume(),Kl(i.resumeQueue),pa(this,"onResume",Us(this,la(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ia(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ws(this));const o=!Hl.und(e.to),r=!Hl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Ws(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&&!Hl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Gl(d,c);p&&(s.from=d),d=Mi(d);const m=!Gl(u,a);m&&this._focus(u);const f=Ms(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Os(n=_s({},n),t),t=_s({},n,t)),Os(e,t),Object.assign(e,t);for(const t in As)null==e[t]&&(e[t]=As[t]);let{mass:o,frequency:r,damping:l}=e;Hl.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)}(g,ys(t.config,l),t.config!==i.config?ys(i.config,l):void 0);let b=rs(this);if(!b||Hl.und(u))return n(Us(this,!0));const k=Hl.und(t.reset)?r&&!t.default:!Hl.und(d)&&Es(t.reset,l),_=k?d:this.get(),y=Ns(u),E=Hl.num(y)||Hl.arr(y)||Qi(y),C=!f&&(!E||Es(i.immediate||t.immediate,l));if(m){const e=fs(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=Pi(u),B=!1;if(!w){const e=k||!Js(this)&&p;(m||e)&&(B=Gl(Ns(_),y),w=!B),(Gl(s.immediate,C)||C)&&Gl(g.decay,h)&&Gl(g.velocity,v)||(w=!0)}if(B&&ea(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Pi(a))&&(s.values=b.getPayload(),s.toValues=Pi(u)?null:S==cs?[1]:$l(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Ul(ua,(e=>da(this,t,e)));const o=Us(this,la(this,a));Kl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&yl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?ys(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n($s(t.to,t,this._state,this)):w?this._start():ea(this)&&!m?this._pendingCalls.add(n):n(Gs(_))}_focus(e){const t=this.animation;e!==t.to&&(Ri(this)&&this._detach(),t.to=e,Ri(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Pi(t)&&(Oi(t,this),Ys(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Pi(e)&&Fi(e,this)}_set(e,t=!0){const n=Mi(e);if(!Hl.und(n)){const e=rs(this);if(!e||!Gl(n,e.getValue())){const o=fs(n);e&&e.constructor==o?e.setValue(n):ls(this,o.create(n)),e&&yl.batchedUpdates((()=>{this._onChange(n,t)}))}}return rs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,pa(this,"onStart",Us(this,la(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ys(this.animation.onChange,e,this)),ys(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;rs(this).reset(Mi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ea(this)||(na(this,!0),ta(this)||this._resume())}_resume(){Jl.skipAnimation?this.finish():ri.start(this)}_stop(e,t){if(ea(this)){na(this,!1);const n=this.animation;Ul(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Li(this,{type:"idle",parent:this});const o=t?Ws(this.get()):Us(this.get(),la(this,null!=e?e:n.to));Kl(this._pendingCalls,o),n.changed&&(n.changed=!1,pa(this,"onRest",o,this))}}}function la(e,t){const n=Ns(t);return Gl(Ns(e.get()),n)}function ia(e,t=e.loop,n=e.to){let o=ys(t);if(o){const r=!0!==o&&Ts(o),l=(r||e).reverse,i=!r||r.reset;return sa(_s({},e,{loop:t,default:!1,pause:void 0,to:!l||Ms(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function sa(e){const{to:t,from:n}=e=Ts(e),o=new Set;return Hl.obj(t)&&ca(t,o),Hl.obj(n)&&ca(n,o),e.keys=o.size?Array.from(o):null,e}function aa(e){const t=sa(e);return Hl.und(t.default)&&(t.default=Bs(t)),t}function ca(e,t){Wl(e,((e,n)=>null!=e&&t.add(n)))}const ua=["onStart","onRest","onChange","onPause","onResume"];function da(e,t,n){e.animation[n]=t[n]!==Ss(t,n)?Cs(t[n],e.key):void 0}function pa(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 ma=["onStart","onChange","onRest"];let fa=1;class ga{constructor(e,t){this.id=fa++,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(_s({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];Hl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(sa(e)),this}start(e){let{queue:t}=this;return e?t=$l(e).map(sa):this.queue=[],this._flush?this._flush(this,t):(Ea(this,t),ha(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ul($l(t),(t=>n[t].stop(!!e)))}else js(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Hl.und(e))this.start({pause:!0});else{const t=this.springs;Ul($l(e),(e=>t[e].pause()))}return this}resume(e){if(Hl.und(e))this.start({pause:!1});else{const t=this.springs;Ul($l(e),(e=>t[e].resume()))}return this}each(e){Wl(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,jl(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&&jl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,jl(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)}yl.onFrame(this._onFrame)}}function ha(e,t){return Promise.all(t.map((t=>va(e,t)))).then((t=>Hs(e,t)))}async function va(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Hl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Hl.arr(r)||Hl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ul(ma,(n=>{const o=t[n];if(Hl.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,Kl(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===Ss(t,"cancel");(u||m&&d.asyncId)&&p.push(Vs(++e._lastAsyncId,{props:t,state:d,actions:{pause:Vl,resume:Vl,start(t,n){m?(js(d,e._lastAsyncId),n(Ws(e))):(t.onRest=s,n($s(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Hs(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=ia(t,i,r);if(n)return Ea(e,[n]),va(e,n,!0)}return a&&yl.batchedUpdates((()=>a(f,e,e.item))),f}function ba(e,t){const n=_s({},e.springs);return t&&Ul($l(t),(e=>{Hl.und(e.keys)&&(e=sa(e)),Hl.obj(e.to)||(e=_s({},e,{to:void 0})),ya(n,e,(e=>_a(e)))})),ka(e,n),n}function ka(e,t){Wl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Oi(t,e))}))}function _a(e,t){const n=new ra;return n.key=e,t&&Oi(n,t),n}function ya(e,t,n){t.keys&&Ul(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ea(e,t){Ul(t,(t=>{ya(e.springs,t,(t=>_a(t,e)))}))}const Ca=["children"],Sa=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,Ca);const o=(0,Fl.useContext)(wa),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Fl.useState)((()=>({inputs:t,result:e()}))),o=(0,Fl.useRef)(),r=o.current;let l=r;return l?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))||(l={inputs:t,result:e()}):l=n,(0,Fl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=wa;return Fl.createElement(i,{value:n},t)},wa=(Ba=Sa,Ia={},Object.assign(Ba,Fl.createContext(Ia)),Ba.Provider._context=Ba,Ba.Consumer._context=Ba,Ba);var Ba,Ia;Sa.Provider=wa.Provider,Sa.Consumer=wa.Consumer;const xa=()=>{const e=[],t=function(t){Yi(`${ji}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 Ul(e,((e,r)=>{if(Hl.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 Ul(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Ul(e,(e=>e.resume(...arguments))),this},t.set=function(t){Ul(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Ul(e,((e,o)=>{if(Hl.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 Ul(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Ul(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Hl.fun(e)?e(n,t):e};return t._getProps=n,t};function Ta(e,t,n){const o=Hl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Fl.useMemo)((()=>o||3==arguments.length?xa():void 0),[]),l=(0,Fl.useRef)(0),i=Ji(),s=(0,Fl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=ba(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ha(e,t):new Promise((o=>{ka(e,n),s.queue.push((()=>{o(ha(e,t))})),i()}))}})),[]),a=(0,Fl.useRef)([...s.ctrls]),c=[],u=ts(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ga(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=aa(n))}}(0,Fl.useMemo)((()=>{Ul(a.current.slice(e,u),(e=>{Rs(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Fl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>ba(e,c[t]))),m=(0,Fl.useContext)(Sa),f=ts(m),g=m!==f&&Ps(m);ns((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Ul(e,(e=>e()))),Ul(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Ls(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Zi((()=>()=>{Ul(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>_s({},e)));return r?[h,r]:h}let Na;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Na||(Na={}));class Pa extends Zs{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Ii(...t);const n=this._get(),o=fs(n);ls(this,o.create(n))}advance(e){const t=this._get();Gl(t,this.get())||(rs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ra(this._active)&&La(this)}_get(){const e=Hl.arr(this.source)?this.source.map(Mi):$l(Mi(this.source));return this.calc(...e)}_start(){this.idle&&!Ra(this._active)&&(this.idle=!1,Ul(is(this),(e=>{e.done=!1})),Jl.skipAnimation?(yl.batchedUpdates((()=>this.advance())),La(this)):ri.start(this))}_attach(){let e=1;Ul($l(this.source),(t=>{Pi(t)&&Oi(t,this),Ys(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ul($l(this.source),(e=>{Pi(e)&&Fi(e,this)})),this._active.clear(),La(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=$l(this.source).reduce(((e,t)=>Math.max(e,(Ys(t)?t.priority:0)+1)),0))}}function Ma(e){return!1!==e.idle}function Ra(e){return!e.size||Array.from(e).every(Ma)}function La(e){e.idle||(e.idle=!0,Ul(is(e),(e=>{e.done=!0})),Li(e,{type:"idle",parent:e}))}Jl.assign({createStringInterpolator:$i,to:(e,t)=>new Pa(e,t)}),ri.advance;var Aa=window.ReactDOM;function Da(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 Oa=["style","children","scrollTop","scrollLeft"],Fa=/^--/;function za(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Fa.test(e)||Ha.hasOwnProperty(e)&&Ha[e]?(""+t).trim():t+"px"}const Va={};let Ha={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 Ga=["Webkit","Ms","Moz","O"];Ha=Object.keys(Ha).reduce(((e,t)=>(Ga.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ha);const Ua=["x","y","z"],Wa=/^(matrix|translate|scale|rotate|skew)/,$a=/^(translate)/,ja=/^(rotate|skew)/,Ka=(e,t)=>Hl.num(e)&&0!==e?e+t:e,qa=(e,t)=>Hl.arr(e)?e.every((e=>qa(e,t))):Hl.num(e)?e===t:parseFloat(e)===t;class Ya extends ds{constructor(e){let{x:t,y:n,z:o}=e,r=Da(e,Ua);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Ka(e,"px"))).join(",")})`,qa(e,0)]))),Wl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Wa.test(t)){if(delete r[t],Hl.und(e))return;const n=$a.test(t)?"px":ja.test(t)?"deg":"";l.push($l(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ka(r,n)})`,qa(r,0)]:e=>[`${t}(${e.map((e=>Ka(e,n))).join(",")})`,qa(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Qa(l,i)),super(r)}}class Qa extends Ai{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 Ul(this.inputs,((n,o)=>{const r=Mi(n[0]),[l,i]=this.transforms[o](Hl.arr(r)?r:n.map(Mi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Ul(this.inputs,(e=>Ul(e,(e=>Pi(e)&&Oi(e,this)))))}observerRemoved(e){0==e&&Ul(this.inputs,(e=>Ul(e,(e=>Pi(e)&&Fi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Li(this,e)}}const Za=["scrollTop","scrollLeft"];Jl.assign({batchedUpdates:Aa.unstable_batchedUpdates,createStringInterpolator:$i,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 Xa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ds(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ks(e)||"Anonymous";return(e=Hl.str(e)?l[e]||(l[e]=hs(e,r)):e[bs]||(e[bs]=hs(e,r))).displayName=`Animated(${t})`,e};return Wl(e,((t,n)=>{Hl.arr(e)&&(n=ks(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=Da(o,Oa),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Va[t]||(Va[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=za(t,r[t]);Fa.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 Ya(e),getComponentProps:e=>Da(e,Za)}).animated,Ja=e=>e+1,ec=e=>({top:e.offsetTop,left:e.offsetLeft});var tc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Ja,0),[u,p]=(0,s.useReducer)(Ja,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?ec(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,el.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]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=ec(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Hl.fun(e),[[o],r]=Ta(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const nc=".block-editor-block-list__block",oc=".block-list-appender",rc=".block-editor-button-block-appender";function lc(e,t){return t.closest([nc,oc,rc].join(","))===e}function ic(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(nc);return t?t.id.slice("block-".length):void 0}function sc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Qn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=el.focus.tabbable.find(t.current).filter((e=>(0,el.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(lc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=el.focus.tabbable.findNext(t.current);if(e&&lc(t.current,e)&&(0,el.isFormElement)(e))return void e.focus()}(0,el.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function ac(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function cc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ac),t.addEventListener("mouseover",ac),()=>{t.removeEventListener("mouseout",ac),t.removeEventListener("mouseover",ac),t.classList.remove("is-hovered")}}),[e])}function uc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Qn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function dc(e){return(0,m.useSelect)((t=>{const n=t(Qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function pc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Qn),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 mc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Qn);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 fc(e){const{isBlockSelected:t}=(0,m.useSelect)(Qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):lc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var gc=window.wp.keycodes;function hc(e){const t=(0,m.useSelect)((t=>t(Qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==gc.ENTER&&s!==gc.BACKSPACE&&s!==gc.DELETE||a!==i||(0,el.isTextField)(a)||(t.preventDefault(),s===gc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function vc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function bc(){const e=(0,s.useContext)(Sf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function kc(){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)(_c),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Qn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,sc(n),Co(n),fc(n),hc(n),vc(n),cc(),bc(),tc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=eo();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,uc(n),dc(n),pc(n),mc(n)),style:{...l.style,...e.style}}}kc.save=r.__unstableGetBlockProps;const _c=(0,s.createContext)();function yc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",kc(o,{__unstableIsHtml:n}),t)}const Ec=(0,m.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(Qn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Cc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Qn),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Qn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Qn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Sc=(0,d.compose)(d.pure,Ec,Cc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Qn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(il,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(yc,{isHtml:!0},(0,s.createElement)(kl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(yc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(yc,{className:"has-warning"},(0,s.createElement)(ml,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,el.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(_c.Provider,{value:M},(0,s.createElement)(vl,{fallback:(0,s.createElement)(yc,{className:"has-warning"},(0,s.createElement)(gl,null))},N))})),wc=window.wp.htmlEntities,Bc=(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"}));const Ic=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var xc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ic.length));return(0,s.createElement)(p.Tip,null,Ic[e])},Tc=(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"})),Nc=(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:Tc});const l=(0,s.createElement)(p.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)})),Pc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(H()("`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)(Nc,{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)))};function Mc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Qn),{getBlockName:h,getBlocks:v}=a.select(Qn),b=(0,m.useSelect)((e=>!t||e(Qn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(Qn);let s=v(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=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}var Rc=(0,d.createHigherOrderComponent)((e=>(0,m.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,m.createRegistry)({},o);e.registerStore(qn,Yn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o(n)}),[n]),Mc(e),(0,s.createElement)(Eo,null,t)}));function Lc(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(Bf,null)))}function Ac(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Qn),{clearSelectedBlock:n}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Dc(e){return(0,s.createElement)("div",i({ref:Ac()},e))}function Oc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Fc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Oc,[]),i=So(r),s=So((0,u.first)(n)),a=So((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function zc(e,t,n,o){let r,l=el.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!el.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 Vc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===gc.UP,p=c===gc.DOWN,m=c===gc.LEFT,f=c===gc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?el.isVerticalEdge:el.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,el.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===gc.UP||t===gc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,el.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=zc(e,t,i);return!n||!function(e,t){return e.closest(nc)===t.closest(nc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,el.isVerticalEdge)(u,g)&&!w){const e=zc(u,g,i,!0);e&&((0,el.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,el.isHorizontalEdge)(u,S)&&!w){const e=zc(u,S,i);(0,el.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Hc=window.wp.keyboardShortcuts;function Gc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Qn),{multiSelect:o}=(0,m.useDispatch)(Qn),r=(0,Hc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,el.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function Uc(e,t){e.contentEditable=t,t&&e.focus()}function Wc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Uc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Uc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function $c(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Qn),{getBlockParents:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:l}=r;function i(){const r=l.getSelection();if(!r.rangeCount||r.isCollapsed)return void function(e,t){e.contentEditable=false}(n);const i=ic(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(r)),s=ic(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(r));if(i===s)t(i);else{const t=[...o(i),i],n=[...o(s),s],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){r.addEventListener("selectionchange",i),l.addEventListener("mouseup",i)}function a(){r.removeEventListener("selectionchange",i),l.removeEventListener("mouseup",i)}function c(){a(),s()}return s(),n.addEventListener("focusin",c),()=>{a(),n.removeEventListener("focusin",c)}}),[e,t,n,o])}function jc(){const{multiSelect:e,selectBlock:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,getBlockParents:o,getBlockSelectionStart:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((e=>{function o(o){if(!n()||0!==o.button)return;const i=r(),s=ic(o.target);o.shiftKey?i!==s&&(e.contentEditable=!0,e.focus()):l()&&t(s)}return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[e,t,n,o,r,l])}function Kc(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===gc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===gc.BACKSPACE||d.keyCode===gc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===gc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===gc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function qc(){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,m.useSelect)(Qn),{setNavigationMode:a}=(0,m.useDispatch)(Qn),c=(0,m.useSelect)((e=>e(Qn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";el.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===gc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==gc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,el.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,el.isFormElement)(el.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==gc.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=el.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Kc(),Wc(),$c(),jc(),Fc(),Gc(),Vc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var Yc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=qc();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)}));const Qc="editor-styles-wrapper";function Zc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Xc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Zc(null==a?void 0:a.styles),_=Zc(null==a?void 0:a.scripts),y=Ac(),[E,C,S]=qc(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(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)}(t),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.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((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,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&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${Qc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Qc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Jc={grad:.9,turn:360,rad:360/(2*Math.PI)},eu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},tu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},nu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},ou=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ru=function(e){return{r:nu(e.r,0,255),g:nu(e.g,0,255),b:nu(e.b,0,255),a:nu(e.a)}},lu=function(e){return{r:tu(e.r),g:tu(e.g),b:tu(e.b),a:tu(e.a,3)}},iu=/^#([0-9a-f]{3,8})$/i,su=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},au=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}},cu=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}},uu=function(e){return{h:ou(e.h),s:nu(e.s,0,100),l:nu(e.l,0,100),a:nu(e.a)}},du=function(e){return{h:tu(e.h),s:tu(e.s),l:tu(e.l),a:tu(e.a,3)}},pu=function(e){return cu((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},mu=function(e){return{h:(t=au(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},fu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bu={string:[[function(e){var t=iu.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?tu(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?tu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hu.exec(e)||vu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ru({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=fu.exec(e)||gu.exec(e);if(!t)return null;var n,o,r=uu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Jc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return pu(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 eu(t)&&eu(n)&&eu(o)?ru({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(!eu(t)||!eu(n)||!eu(o))return null;var i=uu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return pu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!eu(t)||!eu(n)||!eu(o))return null;var i=function(e){return{h:ou(e.h),s:nu(e.s,0,100),v:nu(e.v,0,100),a:nu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return cu(i)},"hsv"]]},ku=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]},_u=function(e,t){var n=mu(e);return{h:n.h,s:nu(n.s+100*t,0,100),l:n.l,a:n.a}},yu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Eu=function(e,t){var n=mu(e);return{h:n.h,s:n.s,l:nu(n.l+100*t,0,100),a:n.a}},Cu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?ku(e.trim(),bu.string):"object"==typeof e&&null!==e?ku(e,bu.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 tu(yu(this.rgba),2)},e.prototype.isDark=function(){return yu(this.rgba)<.5},e.prototype.isLight=function(){return yu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=lu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?su(tu(255*r)):"","#"+su(t)+su(n)+su(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return lu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=lu(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 du(mu(this.rgba))},e.prototype.toHslString=function(){return t=(e=du(mu(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=au(this.rgba),{h:tu(e.h),s:tu(e.s),v:tu(e.v),a:tu(e.a,3)};var e},e.prototype.invert=function(){return Su({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),Su(_u(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Su(_u(this.rgba,-e))},e.prototype.grayscale=function(){return Su(_u(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Su(Eu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Su(Eu(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?Su({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):tu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=mu(this.rgba);return"number"==typeof e?Su({h:e,s:t.s,l:t.l,a:t.a}):tu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Su(e).toHex()},e}(),Su=function(e){return e instanceof Cu?e:new Cu(e)},wu=[],Bu=function(e){e.forEach((function(e){wu.indexOf(e)<0&&(e(Cu,bu),wu.push(e))}))};function Iu(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 xu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Tu=function(e){return.2126*xu(e.r)+.7152*xu(e.g)+.0722*xu(e.b)};function Nu(e){e.prototype.luminance=function(){return e=Tu(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=Tu(l))>(a=Tu(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 Pu=n(3124),Mu=n.n(Pu);const Ru=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Lu(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(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(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 f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return Au(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=Au(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ru,""),value:n?Au(n[0]).replace(Ru,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:a("missing '}'")}function k(){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 _=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=f();for(;r=k();)i.push(r),i=i.concat(f());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=Au(t[1]);if(!c())return a("@media missing '{'");const o=f().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:Au(t[1]),media:Au(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Au(t[1]);if(!c())return a("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Au(t[1]),o=Au(t[2]);if(!c())return a("@document missing '{'");const r=f().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=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());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=f().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=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Du(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Au(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Du(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){Du(e,o)})):n&&"object"==typeof n&&Du(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ou=n(8575),Fu=n.n(Ou),zu=Vu;function Vu(e){this.options=e||{}}Vu.prototype.emit=function(e){return e},Vu.prototype.visit=function(e){return this[e.type](e)},Vu.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};var Hu=Gu;function Gu(e){zu.call(this,e)}Fu()(Gu,zu),Gu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Gu.prototype.comment=function(e){return this.emit("",e.position)},Gu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Gu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.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("}")},Gu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Gu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Gu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Gu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Gu.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("}")},Gu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Gu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Gu.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("}"):""},Gu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Uu=Wu;function Wu(e){e=e||{},zu.call(this,e),this.indentation=e.indent}Fu()(Wu,zu),Wu.prototype.compile=function(e){return this.stylesheet(e)},Wu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Wu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Wu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Wu.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}")},Wu.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}")},Wu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Wu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Wu.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}")},Wu.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)+"}")},Wu.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")},Wu.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}")},Wu.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}")},Wu.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}")},Wu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Wu.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()+"}"):""},Wu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Wu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var $u=function(e,t){try{const r=Lu(e);return n=Mu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Hu(o):new Uu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ju(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 Ku(e,t){return new URL(e,t).toString()}var qu=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]};ju(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Ku(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};const Yu=/^(body|html|:root).*$/;var Qu=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(Yu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Zu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Qu(t)),o&&r.push(qu(o)),r.length?$u(n,(0,d.compose)(r)):n}))};const Xu=".editor-styles-wrapper";function Ju(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Xu);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=Su(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function ed(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Zu(t,Xu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Ju(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let td;Bu([Iu,Nu]);const nd=2e3;var od=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);td=td||(0,d.pure)(Bf);const g=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:a*g,maxHeight:a>nd?nd*g:void 0,minHeight:o}},(0,s.createElement)(Xc,{head:(0,s.createElement)(ed,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:nd,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(td,{renderAppender:!1}))))},rd=(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,m.useSelect)((e=>e(Qn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Rc,{value:d,settings:c},r?(0,s.createElement)(Lc,{onClick:l}):(0,s.createElement)(od,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function ld(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Rc,{value:p,settings:a},(0,s.createElement)(xf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var id=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(rd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Pc,{title:i,icon:a,description:c}))},sd=(0,s.createContext)(),ad=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(sd);return(0,s.createElement)(p.__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)(p.Button,t,r)}))})),cd=(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 ud(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(Nc,{icon:n}):(0,g.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
+
(0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Nc,{icon:cd})))))}var dd=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(ud,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function pd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var md=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(dd,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(ad,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,pd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===gc.ENTER&&(e.preventDefault(),l(o,pd()?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:m},(0,s.createElement)(Nc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),fd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ht.speak)((0,g.__)("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))})),gd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(sd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),hd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(fd,{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)(gd,{key:t},e.map(((e,l)=>(0,s.createElement)(md,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},vd=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)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},bd=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Qn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},kd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(sd.Provider,{value:n},t)};const _d=[];var yd=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=bd(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:_d);return(0,s.createElement)(kd,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(vd,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(hd,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(vd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(hd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(vd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(hd,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(vd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(hd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Ed=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,g.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Cd=window.wp.notices,Sd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Cd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
+
(0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function wd(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(wd)}`;return(0,s.createElement)(dd,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(rd,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Bd(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Id=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(wd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Bd,{key:e.name}))))};function xd(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Td(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Nd=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Td,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(xd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Pd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Br,{className:"block-editor-inserter__no-results-icon",icon:Tc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},Md=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Qn),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Qn),k=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
|
15 |
+
(0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Rd=e=>e.name||"",Ld=e=>e.title,Ad=e=>e.description||"",Dd=e=>e.keywords||[],Od=e=>e.category,Fd=()=>null;function zd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Vd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(zd(e))},Hd=(e,t)=>(0,u.differenceWith)(e,Vd(t),((e,t)=>t.includes(e))),Gd=(e,t,n,o)=>0===Vd(o).length?e:Ud(e,o,{getCategory:e=>{var n;return null===(n=(0,u.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}}),Ud=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=Vd(t);if(0===o.length)return e;const r=e.map((e=>[e,Wd(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function Wd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rd,getTitle:r=Ld,getDescription:l=Ad,getKeywords:i=Dd,getCategory:s=Od,getCollection:a=Fd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=zd(t),v=zd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===Hd(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function $d(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,g.sprintf)(
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
+
(0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var jd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ht.speak,500),[l,i]=Md({shouldFocusBlock:!0}),[a,,c]=Sd(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ud(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.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,g.sprintf)(
|
18 |
/* translators: %d: number of results. */
|
19 |
+
(0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)($d,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(kd,null,!f&&(0,s.createElement)(Pd,null),f&&(0,s.createElement)(Id,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Kd(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Nd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(jd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var qd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Kd,n))};function Yd(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Sd(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Id,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var Qd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Sd(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ed,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Yd,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(qd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Zd=window.wp.url;function Xd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=bd(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Pd,null):(0,s.createElement)(vd,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(hd,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var Jd=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xd,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,Zd.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:ep,Slot:tp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");ep.Slot=tp;var np=ep;const op=[];var rp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ht.speak,500),[_,y]=Md({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=bd(_,y),[B,,I]=Sd(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ud(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=Gd((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,g.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:op),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,s.createElement)(vd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(hd,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,s.createElement)(vd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Id,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,s.createElement)(kd,null,!f&&!R&&(0,s.createElement)(Pd,null),b?A:L,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(np.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(Pd,null))))};const lp={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
+
title:(0,g.__)("Blocks")},ip={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
+
title:(0,g.__)("Patterns")},sp={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,g.__)("Reusable")};var ap=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[lp];return n&&e.push(ip),o&&e.push(sp),e}),[lp,n,ip,o,sp]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},cp=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=Md({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(yd,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(xc,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Qd,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(Jd,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(rp,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(ap,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(id,{item:v}))}));function up(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=Md({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=bd(a,u),[f]=Sd(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Qn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(rp,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const dp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
28 |
+
(0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Bc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class pp extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=dp}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(up,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(cp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var mp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Qn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(Qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Qn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Qn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
|
29 |
+
(0,g.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(pp),fp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Qn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Qn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,wc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{gc.ENTER!==e.keyCode&&gc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(mp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function gp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(mp,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Br,{icon:Bc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const hp=(0,s.forwardRef)(((e,t)=>(H()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),gp(e,t))));var vp=(0,s.forwardRef)(gp),bp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Qn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(fp,{rootClientId:n}):(0,s.createElement)(vp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)})),kp=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};(0,s.createContext)();var _p=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d}=(0,m.useSelect)((e=>{var n;const{getBlockListSettings:o,getBlockRootClientId:r}=e(Qn),l=r(t);return{orientation:(null===(n=o(l))||void 0===n?void 0:n.orientation)||"vertical",rootClientId:l}}),[t]),f=wo(t),h=wo(n),v="vertical"===u,b=(0,s.useMemo)((()=>{if(!f&&!h)return{};const e=f?f.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;if(v)return{width:f?f.offsetWidth:h.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:h.offsetHeight}}),[f,h,v]),k=(0,s.useCallback)((()=>{if(!f&&!h)return{};const{ownerDocument:e}=f||h,t=f?f.getBoundingClientRect():null,n=h?h.getBoundingClientRect():null;return v?(0,g.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,g.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[f,h]),_=kp(l);return f&&h?(0,s.createElement)(p.Popover,i({ref:_,noArrow:!0,animate:!1,getAnchorRect:k,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className)}),(0,s.createElement)("div",{style:b},o)):null};const yp=(0,s.createContext)();function Ep(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Qn),l=(0,s.useContext)(yp),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Qn),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:h?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(_p,{previousClientId:u,nextClientId:f,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),h&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(mp,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Cp(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Qn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(yp.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(Ep,n),t)}function Sp(){const e=(0,s.useContext)(yp),t=(0,m.useSelect)((e=>e(Qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const wp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Bp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ip(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Qn),{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 xp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Qn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=Ip(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Tp(e){let{clientId:t,maximumLength:n}=e;return xp(t,n)}var Np=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Qn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=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,el.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,m.useDispatch)(Qn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(ud,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Pp=function(e){let{clientId:t,rootClientId:n}=e;const o=Ip(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Qn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:f,orientation:h}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Qn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,h);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Nc,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Np,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:cd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===gc.UP,r=n===gc.DOWN,l=n===gc.LEFT,i=n===gc.RIGHT,s=n===gc.TAB,a=n===gc.ESCAPE,c=n===gc.ENTER,u=n===gc.SPACE,d=e.shiftKey;if(n===gc.BACKSPACE||n===gc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),f=T(m||p),g=N(m||p),h=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(h)y=f;else if(v)y=g;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(R(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(v||h||k||_)if(y)e.preventDefault(),M(y);else if(s&&p){let t;if(v){t=E;do{t=el.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=el.focus.tabbable.findNext(t))}else t=el.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),R())}},label:y,className:"block-selection-button_select-button"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35})))))};function Mp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Rp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!el.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||H()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=el.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,Hc.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=Mp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Mp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},Lp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Ap=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Dp=(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"})),Op=(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"}));const Fp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Lp:Ap:Dp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Ap:Lp:Op:null,zp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Vp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Vp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Qn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Fp(o,C),label:zp(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)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
33 |
(0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Hp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Vp,i({direction:"up",ref:t},e)))),Gp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Vp,i({direction:"down",ref:t},e))));var Up=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:d}=(0,m.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(Qn),a=(0,u.castArray)(t),c=(0,u.first)(a),d=s((0,u.first)(a)),p=o(c),m=o((0,u.last)(a)),f=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===f.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const f=(0,g.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(Np,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:cd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:f,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Hp,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Gp,i({clientIds:t},e))))))};const{clearTimeout:Wp,setTimeout:$p}=window,jp=200;function Kp(e){let{ref:t,isFocused:n,debounceTimeout:o=jp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&Wp&&Wp(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=$p((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function qp(e){let{ref:t,debounceTimeout:n=jp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Kp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function Yp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Qn),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=Ip(n),c=(0,s.useRef)(),{gestures:u}=qp({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,g.sprintf)(
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
+
(0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Nc,{icon:a.icon})}))}var Qp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 Zp(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)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,g.__)("Preview")),(0,s.createElement)(rd,{viewportWidth:500,blocks:t})))))}var Xp=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Transform to"),className:t},i&&(0,s.createElement)(Zp,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(Nc,{icon:n,showColors:!0}),l)})))},Jp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),em=window.wp.tokenList,tm=n.n(em);function nm(e,t,n){const o=new(tm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function om(e){return(0,u.find)(e,"isDefault")}function rm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Qn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Qn),d=function(e){return e&&0!==e.length?om(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(tm())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,a),f=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=nm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function lm(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=rm({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?Jp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function im(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(lm,{clientId:o,onSwitch:n}))}const sm=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=sm(e,t,n);if(o)return o}}},am=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function cm(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)(p.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,g.__)("Preview")),(0,s.createElement)(um,{patterns:t,onSelect:n})))))}function um(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(dm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function dm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(dm,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(rd,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}var pm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=sm(r,t.name,o);if(n){e=!0,o.add(n.clientId),am(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)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(cm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Lp},(0,g.__)("Patterns"))):null};const mm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Qn),l=Ip(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:Qp;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Nc,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)(
|
48 |
/* translators: %s: block title. */
|
49 |
(0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
|
50 |
/* translators: %d: number of blocks. */
|
51 |
+
(0,g._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Nc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(pm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Xp,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(im,{hoveredBlock:n[0],onSwitch:l}))})))))};var fm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(mm,{clientIds:t,blocks:n})};const{Fill:gm,Slot:hm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");gm.Slot=hm;var vm=gm,bm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),km=window.wp.blob;function _m(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;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function ym(){const{getBlockName:e}=(0,m.useSelect)(Qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Cd.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
52 |
(0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
53 |
(0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
|
54 |
(0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
|
55 |
+
(0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Em(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(Qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(Qn),h=ym();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,el.documentHasUncollapsedSelection)(t):(0,el.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();else if("paste"===m.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,el.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!_m(r,o)&&(o=r.map((e=>`<img src="${(0,km.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}var Cm=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Em()},t)};function Sm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Qn),T=ym();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var wm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Qn),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(Qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Bm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Qn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Im,Slot:xm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Im.Slot=xm;var Tm=Im;function Nm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Qn);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Pm(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(Qn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}var Mm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),Rm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"}));function Lm(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(Qn),a=s(e),c=n(e),u=o(e,a),d=r(e,a);return{canEdit:c,canMove:u,canRemove:d,canLock:l(i(e)),isLocked:!c||!u||!d}}),[e])}function Am(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Lm(t),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Qn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Qn),h=Ip(t),v=(0,d.useInstanceId)(Am,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
|
56 |
/* translators: %s: Name of the block. */
|
57 |
+
(0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Rm:Mm})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Rm:Mm})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Rm:Mm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function Dm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Lm(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?Mm:Rm,onClick:l},i),r&&(0,s.createElement)(Am,{clientId:t,onClose:l}))}const{Fill:Om,Slot:Fm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function zm(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Om,t))}zm.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),a=1===r.length,c=Pm(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,s.createElement)(Fm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!a?null:(0,s.createElement)(p.MenuGroup,null,a&&(0,s.createElement)(Dm,{clientId:r[0]}),e,g&&(0,s.createElement)(Nm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var Vm=zm;const Hm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Gm(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var Um=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Qn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Hc.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:C,toggleBlockHighlight:S}=(0,m.useDispatch)(Qn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=xp(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)(
|
58 |
/* translators: %s: block name */
|
59 |
+
(0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=qp({ref:N,onChange(e){e&&h||S(f,e)}});return(0,s.createElement)(Sm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:bm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Hm,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Tm.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Nc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)(
|
60 |
/* translators: %s: Name of the block's parent. */
|
61 |
+
(0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Bm,{clientId:d}),(0,s.createElement)(Gm,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,w),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(wm,{clientId:d,onToggle:l})),(0,s.createElement)(Vm.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))},Wm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Um,i({clientIds:t,toggleProps:e},n)))))};function $m(e){let{clientId:t}=e;const n=Ip(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Lm(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:Rm,label:(0,g.sprintf)(
|
62 |
/* translators: %s: block name */
|
63 |
+
(0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Am,{clientId:t,onClose:c})):null}var jm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),Km=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),qm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const Ym={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Qm=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Pm(),{replaceBlocks:l}=(0,m.useDispatch)(Qn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(Qn);return{canRemove:n(t)}}),[t]),a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=Ym[o],l(t,i))};return o&&i?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:jm,label:(0,g._x)("Group","verb"),onClick:a}),(0,s.createElement)(p.ToolbarButton,{icon:Km,label:(0,g._x)("Row","single horizontal line"),onClick:()=>a("row")}),(0,s.createElement)(p.ToolbarButton,{icon:qm,label:(0,g._x)("Stack","verb"),onClick:()=>a("stack")})):null},Zm=(0,s.createContext)(""),Xm=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Qn),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:h}=(0,m.useDispatch)(Qn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=qp({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(Yp,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(fm,{clientIds:n}),!C&&(0,s.createElement)($m,{clientId:n[0]}),(0,s.createElement)(Up,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(Qm,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(io.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Zm.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(vm.Slot,null))),(0,s.createElement)(Wm,{clientIds:n}))},Jm=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(Qn),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(Rp,i({focusOnMount:t,className:d
|
64 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Xm,{hideDragHandle:n}))};function ef(e){let{clientId:t,bottomClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const u=wo(t),d=wo(null!=n?n:t),m=kp(l);if(!u||n&&!d)return null;const f={top:u,bottom:d},{ownerDocument:g}=u,h=g.defaultView.frameElement||(0,el.getScrollContainer)(u)||g.body;return(0,s.createElement)(p.Popover,i({ref:m,noArrow:!0,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:f,__unstableStickyBoundaryElement:h,__unstableSlotName:r||null,__unstableBoundaryParent:!0,__unstableObserveElement:u,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==l?void 0:l.current},a,{className:c()("block-editor-block-popover",a.className)}),o)}function tf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function nf(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:f,lastClientId:g}=(0,m.useSelect)(tf,[]),h=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Qn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),[k,_]=(0,s.useState)(!1),{stopTyping:y}=(0,m.useDispatch)(Qn),E=a,C=!a&&!f&&v&&!u&&!(!p&&!a&&o)&&!p,S=!(a||C||f||o);(0,Hc.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,y(!0)}),{isDisabled:!S}),(0,s.useEffect)((()=>{b.current=!1}));const w=(0,s.useRef)();return E||C?(0,s.createElement)(ef,{clientId:r||t,bottomClientId:g,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":h}),__unstablePopoverSlot:l,__unstableContentRef:i},C&&(0,s.createElement)("div",{onFocus:function(){_(!0)},onBlur:function(){_(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":k})},(0,s.createElement)(mp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),C&&(0,s.createElement)(Jm,{focusOnMount:b.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),E&&(0,s.createElement)(Pp,{clientId:t,rootClientId:n})):null}function of(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Qn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),f=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:f}}function rf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(of,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(nf,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function lf(e){let{children:t}=e;const n=(0,s.useContext)(yp),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(H()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Cp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(rf,{__unstablePopoverSlot:"block-toolbar"}),t))}var sf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=eo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),af=sf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(vp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),cf=(0,d.compose)([sf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(fp,{rootClientId:t})})),uf=window.wp.isShallowEqual,df=n.n(uf);const pf=new WeakMap;function mf(e,t){const n=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Qn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Qn),d=function(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 n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,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,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,el.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function ff(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 gf(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=ff(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function hf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=gf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function vf(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Qn),a=mf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=hf(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function bf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Qn).getBlockRootClientId(e);return{blockListSettings:t(Qn).getBlockListSettings(e),parentLock:t(Qn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=xr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),df()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Qn),a=(0,m.useSelect)((t=>t(Qn).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(Qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){pf.has(t)||pf.set(t,new WeakMap);const n=pf.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(nl,{value:k},(0,s.createElement)(xf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function kf(e){return Mc(e),(0,s.createElement)(bf,e)}const _f=(0,s.forwardRef)(((e,t)=>{const n=yf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function yf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=eo(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(Qn),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,vf({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?kf:bf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(xf,t)}}yf.save=r.__unstableGetInnerBlocksProps,_f.DefaultBlockAppender=cf,_f.ButtonBlockAppender=af,_f.Content=()=>yf.save().children;var Ef=_f;const Cf=(0,s.createContext)(),Sf=(0,s.createContext)();function wf(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=yf({ref:(0,d.useMergeRefs)([Ac(),Sp(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Cf.Provider,{value:o},(0,s.createElement)("div",p))}function Bf(e){return function(){const e=(0,m.useSelect)((e=>e(Qn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Qn).__experimentalGetParsedPattern(e[n].name),t=wp(o))};return t=wp(o),()=>Bp(t)}),[e])}(),(0,s.createElement)(lf,null,(0,s.createElement)(Jn,{value:Zn},(0,s.createElement)(wf,e)))}function If(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Tr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Pr,{value:l},(0,s.createElement)(Sf.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Sc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(bp,{tagName:r,rootClientId:n,renderAppender:o}))}function xf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(If,e))}function Tf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Nf(){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,p.__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=Tf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Pf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Nf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Mf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Rf(e){let{onChange:t,values:n,...o}=e;const r=Nf(n),l=Mf(n)&&Pf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}Bf.__unstableElementContext=Cf;const Lf={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Af(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(Lf).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Df=(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"})),Of=(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 Ff(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Df:Of,iconSize:16,"aria-label":o})))}const zf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Vf={px:100,em:20,rem:20};function Hf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Mf(n)||!Pf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Tf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Nf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Vf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Af,{min:0,onChange:t,values:n||zf,units:l}),(0,s.createElement)(Ff,{onClick:()=>r(!o),isLinked:o})))}function Gf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Hf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Mo(t)),o({style:t})}})}Bu([Iu,Nu]);const Uf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Wf=(e,t)=>(0,u.find)(e,{color:t});function $f(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function jf(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Kf(){const e=jf(),t=To("color.palette.custom"),n=To("color.palette.theme"),o=To("color.palette.default"),r=To("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=To("color.gradients.custom"),i=To("color.gradients.theme"),a=To("color.gradients.default"),c=To("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const qf="__experimentalBorder",Yf=["top","right","bottom","left"],Qf=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}}}},Zf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Xf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Zf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Zf(t,"color",o)||{color:o}};function Jf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function eg(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Kf(),a=tg(e.name),c=To("border.color")&&tg(e.name,"color"),u=To("border.radius")&&tg(e.name,"radius"),d=To("border.style")&&tg(e.name,"style"),m=To("border.width")&&tg(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const f=(0,r.getBlockSupport)(e.name,[qf,"__experimentalDefaultControls"]),h=(null==f?void 0:f.color)||(null==f?void 0:f.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Xf({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Yf.forEach((e=>{var n;const o=Jf(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Xf({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Ho,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,g.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Mo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:Qf,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Yf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Xf({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=Xf({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Mo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverClassNames:{linked:"block-editor__border-box-control__popover",top:"block-editor__border-box-control__popover-top",right:"block-editor__border-box-control__popover-right",bottom:"block-editor__border-box-control__popover-bottom",left:"block-editor__border-box-control__popover-left"},showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(p.__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,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ng(o,"radius")})}(e),isShownByDefault:null==f?void 0:f.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)(Gf,e)))}function tg(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,qf);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 ng(e,t){return Mo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function og(e,t,n){if(!tg(t,"color")||Ao(t,qf,"color"))return e;const o=rg(n),r=c()(e.className,o);return e.className=r||void 0,e}function rg(e){var t;const{borderColor:n,style:o}=e,r=$f("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 lg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=Kf();if(!tg(m,"color")||Ao(m,qf,"color"))return(0,s.createElement)(e,t);const{color:b}=Xf({colors:v,namedColor:g}),{color:k}=Xf({colors:v,namedColor:Jf(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Xf({colors:v,namedColor:Jf(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Xf({colors:v,namedColor:Jf(null==h||null===(a=h.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Xf({colors:v,namedColor:Jf(null==h||null===(u=h.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 ig(e){if(e)return`has-${e}-gradient-background`}function sg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function ag(e,t){return(0,u.find)(e,["gradient",t])}function cg(e,t){const n=ag(e,t);return n&&n.slug}function ug(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=eo(),o=To("color.gradients.custom"),r=To("color.gradients.theme"),l=To("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Qn),d=(0,s.useCallback)((o=>{const r=cg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=ig(a);let f;return f=a?sg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return tg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",og),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!tg(e,"color")||Ao(e,qf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),og(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",lg),Bu([Iu,Nu]);var dg=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 m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Su(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Su(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
65 |
(0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
66 |
+
(0,g.__)("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,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};const pg=["colors","disableCustomColors","gradients","disableCustomGradients"];function mg(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function fg(e){const t={};return t.colors=To("color.palette"),t.gradients=To("color.gradients"),t.disableCustomColors=!To("color.custom"),t.disableCustomGradients=!To("color.customGradient"),(0,s.createElement)(mg,i({},t,e))}var gg=function(e){return(0,u.every)(pg,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(mg,e):(0,s.createElement)(fg,e)};function hg(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Kf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(gg,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function vg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=So(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(vg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(vg(t).color);let n=p.current,o=vg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vg(n).backgroundColor;i(o)})),(0,s.createElement)(Ho,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(hg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(dg,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const kg="color",_g=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yg=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,kg);return(0,u.isObject)(t)&&!!t.link},Eg=e=>{const t=(0,r.getBlockSupport)(e,kg);return(0,u.isObject)(t)&&!!t.gradients},Cg=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&!1!==t.background},Sg=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&!1!==t.text},wg=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Bg=(e,t)=>Mo(Ro(t,e,void 0)),Ig=e=>({textColor:void 0,style:Bg(["color","text"],e.style)}),xg=e=>({style:Bg(["elements","link","color","text"],e.style)}),Tg=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 Ng(e,t,n){var o,r,l,i,s,a;if(!_g(t)||Ao(t,kg))return e;const u=Eg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Ao(t,kg,e),h=g("text")?$f("color",p):void 0,v=g("gradients")?ig(m):void 0,b=g("background")?$f("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Pg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Uf(e,n[1]).color:t};function Mg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=To("color.palette.custom"),h=To("color.palette.theme"),v=To("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=To("color.gradients.custom"),_=To("color.gradients.theme"),y=To("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=To("color.custom"),S=To("color.customGradient"),w=To("color.background"),B=To("color.link"),I=To("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!_g(p))return null;const P=yg(p)&&B&&x,M=Sg(p)&&I&&x,R=Cg(p)&&w&&x,L=Eg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=sg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Wf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:Mo(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[kg,"__experimentalDefaultControls"]);return(0,s.createElement)(bg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Uf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>wg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Bg(["color","text"],t.style)})})(e),resetAllFilter:Ig}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Uf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=cg(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Mo(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Mo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>wg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Tg(t))})(e),resetAllFilter:Tg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Wf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Mo(Ro(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Pg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>wg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Bg(["elements","link","color","text"],t.style)})})(e),resetAllFilter:xg}]:[]]})}const Rg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=To("color.palette.custom")||[],u=To("color.palette.theme")||[],d=To("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_g(o)||Ao(o,kg))return(0,s.createElement)(e,t);const m={};var f,g;a&&!Ao(o,kg,"text")&&(m.color=null===(f=Uf(p,a))||void 0===f?void 0:f.color),l&&!Ao(o,kg,"background")&&(m.backgroundColor=null===(g=Uf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Lg={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return _g(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Eg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Ng),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_g(e)||Ao(e,kg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ng(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Rg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Lo({linkColor:yg(r),textColor:Sg(r),backgroundColor:Cg(r),gradient:Eg(r)},Lg,e,t,n,o)}));const Ag=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Dg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Og=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function Fg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Og(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Ag.forEach((t=>{let{name:n,value:o}=t;Dg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
67 |
/* translators: 1: Font weight name. 2: Font style name. */
|
68 |
+
(0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Ag.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return Dg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
|
69 |
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
70 |
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
|