Gutenberg - Version 13.9.0

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 13.9.0
Comparing to
See all releases

Code changes from version 13.8.2 to 13.9.0

build/block-directory/index.js CHANGED
@@ -1373,9 +1373,9 @@ function DownloadableBlocksNoResults() {
1373
  icon: block_default
1374
  }), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))), (0,external_wp_element_namespaceObject.createElement)("div", {
1375
  className: "block-editor-inserter__tips"
1376
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tip, null, (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
1377
  href: "https://developer.wordpress.org/block-editor/"
1378
- }, (0,external_wp_i18n_namespaceObject.__)('Get started here'), ".")))));
1379
  }
1380
 
1381
  /* harmony default export */ const no_results = (DownloadableBlocksNoResults);
1373
  icon: block_default
1374
  }), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('No results found.'))), (0,external_wp_element_namespaceObject.createElement)("div", {
1375
  className: "block-editor-inserter__tips"
1376
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tip, null, (0,external_wp_i18n_namespaceObject.__)('Interested in creating your own block?'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
1377
  href: "https://developer.wordpress.org/block-editor/"
1378
+ }, (0,external_wp_i18n_namespaceObject.__)('Get started here'), "."))));
1379
  }
1380
 
1381
  /* harmony default export */ const no_results = (DownloadableBlocksNoResults);
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' => 'c7a796652b40cd005ba8');
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' => '6d4a80b6e2e44c727538');
build/block-directory/index.min.js CHANGED
@@ -7,7 +7,7 @@
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,a.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,a.createElement)(le,{block:l}):(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},_||(0,U.decodeEntities)(r)),b&&!(m||k)&&(0,a.createElement)(z.VisuallyHidden,null,(0,v.__)("Install block")))))},ae=()=>{},re=function(e){let{items:t,onHover:l=ae,onSelect:n}=e;const o=(0,z.__unstableUseCompositeState)(),{installBlockType:r}=(0,c.useDispatch)($);return t.length?(0,a.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,a.createElement)(oe,{key:e.id,composite:o,onClick:()=>{(0,i.getBlockType)(e.name)?n(e):r(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},se=window.wp.a11y,ie=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,a.useEffect)((()=>{(0,se.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,a.createElement)(a.Fragment,null,!n&&(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,a.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},ce=(0,a.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.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"})),de=function(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(G,{className:"block-editor-inserter__no-results-icon",icon:ce}),(0,a.createElement)("p",null,(0,v.__)("No results found."))),(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(z.Tip,null,(0,a.createElement)("div",null,(0,a.createElement)("p",null,(0,v.__)("Interested in creating your own block?")),(0,a.createElement)(z.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,v.__)("Get started here"),".")))))},ue=(0,Y.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:a}=e($),{canInsertBlockType:r}=e(p.store),s=e(j.store).canUser("read","block-directory/search");return{downloadableItems:s?o(l).filter((e=>r(e,n,!0))):[],hasPermission:s,isLoading:a(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:r,isLoading:s,isTyping:i}=e;return void 0===r||s||i?(0,a.createElement)(a.Fragment,null,r&&!o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,a.createElement)(z.Spinner,null))):!1===r?o?null:(0,a.createElement)(de,null):t.length?(0,a.createElement)(ie,{downloadableItems:t,hasLocalBlocks:o},(0,a.createElement)(re,{items:t,onSelect:l,onHover:n})):!o&&(0,a.createElement)(de,null)})),me=function(){const[e,t]=(0,a.useState)(""),l=(0,u.debounce)(t,400);return(0,a.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:r,hasItems:s,rootClientId:i}=t;return e!==r&&l(r),e?(0,a.createElement)(ue,{onSelect:n,onHover:o,rootClientId:i,filterValue:e,hasLocalBlocks:s,isTyping:r!==e}):null}))},pe=window.wp.editPost;function ke(e){let{items:t}=e;return t.length?(0,a.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,a.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,a.createElement)(te,{icon:t,title:n}),(0,a.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,a.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,a.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 be(){const e=(0,c.useSelect)((e=>e($).getNewBlockTypes()),[]);return e.length?(0,a.createElement)(pe.PluginPrePublishPanel,{icon:ce,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,a.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,a.createElement)(ke,{items:e})):null}function _e(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e($).isInstalling(l.id)),[l.id]),{installBlockType:r}=(0,c.useDispatch)($),{replaceBlock:s}=(0,c.useDispatch)(p.store);return(0,a.createElement)(z.Button,{onClick:()=>r(l).then((e=>{if(e){const e=(0,i.getBlockType)(l.name),[o]=(0,i.parse)(t.originalContent);o&&e&&s(n,(0,i.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(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,a.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,a.createElement)(le,{block:l}):(0,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},_||(0,U.decodeEntities)(r)),b&&!(m||k)&&(0,a.createElement)(z.VisuallyHidden,null,(0,v.__)("Install block")))))},ae=()=>{},re=function(e){let{items:t,onHover:l=ae,onSelect:n}=e;const o=(0,z.__unstableUseCompositeState)(),{installBlockType:r}=(0,c.useDispatch)($);return t.length?(0,a.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,a.createElement)(oe,{key:e.id,composite:o,onClick:()=>{(0,i.getBlockType)(e.name)?n(e):r(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},se=window.wp.a11y,ie=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,a.useEffect)((()=>{(0,se.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,a.createElement)(a.Fragment,null,!n&&(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,a.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},ce=(0,a.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.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"})),de=function(){return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(G,{className:"block-editor-inserter__no-results-icon",icon:ce}),(0,a.createElement)("p",null,(0,v.__)("No results found."))),(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(z.Tip,null,(0,v.__)("Interested in creating your own block?"),(0,a.createElement)("br",null),(0,a.createElement)(z.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,v.__)("Get started here"),"."))))},ue=(0,Y.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:a}=e($),{canInsertBlockType:r}=e(p.store),s=e(j.store).canUser("read","block-directory/search");return{downloadableItems:s?o(l).filter((e=>r(e,n,!0))):[],hasPermission:s,isLoading:a(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:r,isLoading:s,isTyping:i}=e;return void 0===r||s||i?(0,a.createElement)(a.Fragment,null,r&&!o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,a.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,a.createElement)(z.Spinner,null))):!1===r?o?null:(0,a.createElement)(de,null):t.length?(0,a.createElement)(ie,{downloadableItems:t,hasLocalBlocks:o},(0,a.createElement)(re,{items:t,onSelect:l,onHover:n})):!o&&(0,a.createElement)(de,null)})),me=function(){const[e,t]=(0,a.useState)(""),l=(0,u.debounce)(t,400);return(0,a.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:r,hasItems:s,rootClientId:i}=t;return e!==r&&l(r),e?(0,a.createElement)(ue,{onSelect:n,onHover:o,rootClientId:i,filterValue:e,hasLocalBlocks:s,isTyping:r!==e}):null}))},pe=window.wp.editPost;function ke(e){let{items:t}=e;return t.length?(0,a.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,a.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,a.createElement)(te,{icon:t,title:n}),(0,a.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,a.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,a.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 be(){const e=(0,c.useSelect)((e=>e($).getNewBlockTypes()),[]);return e.length?(0,a.createElement)(pe.PluginPrePublishPanel,{icon:ce,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,a.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,a.createElement)(ke,{items:e})):null}function _e(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e($).isInstalling(l.id)),[l.id]),{installBlockType:r}=(0,c.useDispatch)($),{replaceBlock:s}=(0,c.useDispatch)(p.store);return(0,a.createElement)(z.Button,{onClick:()=>r(l).then((e=>{if(e){const e=(0,i.getBlockType)(l.name),[o]=(0,i.parse)(t.originalContent);o&&e&&s(n,(0,i.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
build/block-directory/index.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"./build/block-directory/index.min.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,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,OC2GpD,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,KCxGF,EAA+BH,OAAW,GAAe,YCShD,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,MAAM,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,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,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,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,cAsBD,SApBMR,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,cFrEzBhB,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,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,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,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,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,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,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,GC1QK,MAAMY,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,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,SCPS0H,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,MAAM,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA7C,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,MAAM,EAA+BtJ,OAAW,GAAgB,aCwBhE,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,EAA+B5J,OAAW,GAAc,WCW9D,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,GAoGF,SAhGA,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,uBAAEM,EAAwB3B,aAAc0L,GAC7CrK,EAAQyG,GACH6D,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,sBCrIT4G,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAEzJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAOgF,EAAMlM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf6G,EAAM7F,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,MAIb8M,EAAS,OAEVA,QAAUA,EACV9M,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,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,oLC0BV,GA1BA,WACC,OACC,oCACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKrH,EAAAA,EAAAA,IAAI,wBAEV,0BAAKoE,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACC,+BACC,6BACGtH,EAAAA,EAAAA,IAAI,4CAEP,mBAAC,EAAAuH,aAAD,CAAcnK,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,UCgDN,IAAewH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAErM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAegO,EAAe,MAAY,EAC/D,MAAM,sBAAE1M,EAAF,+BAAyBD,GAC9BK,EAAQyG,IACH,mBAAE8F,GAAuBvM,EAAQE,EAAAA,OAEjCsM,EAAgBxM,EAAQyM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB5M,EAMiBtB,GANaO,QAAU+C,GAC9C2K,EAAoB3K,EAAO0K,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBhN,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjCwN,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBvM,QAC3B,mBAAC,GAAD,CACCuM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHpN,EAHG,SAIH6O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBvO,GAC7B0O,EAAyB1O,GAGnBuO,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfhO,YAAcuO,EACdd,eAAiBoB,EACjBP,SAAWtO,IAAgBuO,IAVrB,SClCN,GAA+B7O,OAAW,GAAY,SCU7C,SAASoP,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMlM,QAKZ,yBAAIyJ,UAAU,gCACXyC,EAAM7F,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,SAASoD,KACvB,MAAMC,GAAgB3G,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOwN,EAAc/N,QAKpB,mBAAC,GAAAgO,sBAAD,CACC7F,KAAOuE,GACPjH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAc/N,QAEf+N,EAAc/N,QAEfiO,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAc/N,UAGhB,mBAAC6N,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc9L,EAAd,SAAqB+L,GAAa,EACxE,MAAMC,GAAoBjH,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEoH,IAAiBrH,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,OAC9B+O,IAAkBjK,EAAAA,EAAAA,OACzB6J,EAAWK,iBAEPD,GAAiBhP,GACrB+O,EACCF,GACAK,EAAAA,EAAAA,aACClP,EAAUC,KACV+O,EAAcJ,WACdI,EAAcpO,kBAOpBsL,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENlJ,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMkJ,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,GAA+BxG,EAAM8F,YACrD,aAAEG,IAAiBrH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCmO,IAAgBD,EAChBE,GAAenE,EAAAA,EAAAA,cAAc,aAEnC,IAAIoE,GAAcxJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDkJ,EAAc9I,OAASmJ,GAExB,MAAMhI,EAAU,EACf,mBAACsH,GAAD,CACCvQ,IAAI,UACJ0E,MAAQkM,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcxJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDkJ,EAAc9I,OAASmJ,GAExBhI,EAAQqI,MACP,mBAAC,EAAA5D,OAAD,CAAQ1N,IAAI,UAAU8M,QArCF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDrJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU8J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASxI,QAAUA,GAAYoI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACvI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC8G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUjQ,KACX,MAAc,iBAATA,IAGLiQ,EAASC,MDZiBC,ECYSF,EAASC,KDZOrH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAE9L,EAAF,cAAS4K,IAAkB7F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWuO,GACVtP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBoP,IAAiBpP,KAC3C,MAAO,CACNyN,cAAexM,EAAQyM,EAAAA,OAAYC,QAClC,OACA,0BAED9K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE6O,IAIH,OAAO3B,GAAmB5K,GAInB,mBAACsM,GAAD,KAAsBtG,EAAtB,CAA8BkG,cAAgBlM,MAH7C,mBAACsN,EAAuBtH,MCbvBoH,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 = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (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 = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (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};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __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","const __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","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __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 =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\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 =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\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","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __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}","const __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","const __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 { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( 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 * 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\nconst noop = () => {};\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","const __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';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</div>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\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 { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( 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","const __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","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","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":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,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,OC2GpD,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,KCxGF,EAA+BH,OAAW,GAAe,YCShD,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,MAAM,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,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,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,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,cAsBD,SApBMR,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,cFrEzBhB,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,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,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,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,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,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,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,GC1QK,MAAMY,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,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,SCPS0H,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,MAAM,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA7C,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,MAAM,EAA+BtJ,OAAW,GAAgB,aCwBhE,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,EAA+B5J,OAAW,GAAc,WCW9D,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,GAoGF,SAhGA,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,uBAAEM,EAAwB3B,aAAc0L,GAC7CrK,EAAQyG,GACH6D,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,sBCrIT4G,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAEzJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAOgF,EAAMlM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf6G,EAAM7F,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,MAIb8M,EAAS,OAEVA,QAAUA,EACV9M,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,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,oLCuBV,GAvBA,WACC,OACC,oCACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKrH,EAAAA,EAAAA,IAAI,wBAEV,0BAAKoE,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACGtH,EAAAA,EAAAA,IAAI,2CACN,+BACA,mBAAC,EAAAuH,aAAD,CAAcnK,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,SCkDL,IAAewH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAErM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAegO,EAAe,MAAY,EAC/D,MAAM,sBAAE1M,EAAF,+BAAyBD,GAC9BK,EAAQyG,IACH,mBAAE8F,GAAuBvM,EAAQE,EAAAA,OAEjCsM,EAAgBxM,EAAQyM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB5M,EAMiBtB,GANaO,QAAU+C,GAC9C2K,EAAoB3K,EAAO0K,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBhN,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjCwN,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBvM,QAC3B,mBAAC,GAAD,CACCuM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHpN,EAHG,SAIH6O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBvO,GAC7B0O,EAAyB1O,GAGnBuO,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfhO,YAAcuO,EACdd,eAAiBoB,EACjBP,SAAWtO,IAAgBuO,IAVrB,SClCN,GAA+B7O,OAAW,GAAY,SCU7C,SAASoP,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMlM,QAKZ,yBAAIyJ,UAAU,gCACXyC,EAAM7F,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,SAASoD,KACvB,MAAMC,GAAgB3G,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOwN,EAAc/N,QAKpB,mBAAC,GAAAgO,sBAAD,CACC7F,KAAOuE,GACPjH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAc/N,QAEf+N,EAAc/N,QAEfiO,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAc/N,UAGhB,mBAAC6N,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc9L,EAAd,SAAqB+L,GAAa,EACxE,MAAMC,GAAoBjH,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEoH,IAAiBrH,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,OAC9B+O,IAAkBjK,EAAAA,EAAAA,OACzB6J,EAAWK,iBAEPD,GAAiBhP,GACrB+O,EACCF,GACAK,EAAAA,EAAAA,aACClP,EAAUC,KACV+O,EAAcJ,WACdI,EAAcpO,kBAOpBsL,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENlJ,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMkJ,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,GAA+BxG,EAAM8F,YACrD,aAAEG,IAAiBrH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCmO,IAAgBD,EAChBE,GAAenE,EAAAA,EAAAA,cAAc,aAEnC,IAAIoE,GAAcxJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDkJ,EAAc9I,OAASmJ,GAExB,MAAMhI,EAAU,EACf,mBAACsH,GAAD,CACCvQ,IAAI,UACJ0E,MAAQkM,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcxJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDkJ,EAAc9I,OAASmJ,GAExBhI,EAAQqI,MACP,mBAAC,EAAA5D,OAAD,CAAQ1N,IAAI,UAAU8M,QArCF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDrJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU8J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASxI,QAAUA,GAAYoI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACvI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC8G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUjQ,KACX,MAAc,iBAATA,IAGLiQ,EAASC,MDZiBC,ECYSF,EAASC,KDZOrH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAE9L,EAAF,cAAS4K,IAAkB7F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWuO,GACVtP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBoP,IAAiBpP,KAC3C,MAAO,CACNyN,cAAexM,EAAQyM,EAAAA,OAAYC,QAClC,OACA,0BAED9K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE6O,IAIH,OAAO3B,GAAmB5K,GAInB,mBAACsM,GAAD,KAAsBtG,EAAtB,CAA8BkG,cAAgBlM,MAH7C,mBAACsN,EAAuBtH,MCbvBoH,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 = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (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 = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (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};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __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","const __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","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __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 =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\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 =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\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","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __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}","const __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","const __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 { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( 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 * 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\nconst noop = () => {};\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","const __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';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\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 { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( 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","const __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","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","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
@@ -2240,6 +2240,7 @@ __webpack_require__.d(__webpack_exports__, {
2240
  "__experimentalPanelColorGradientSettings": () => (/* reexport */ panel_color_gradient_settings),
2241
  "__experimentalPreviewOptions": () => (/* reexport */ PreviewOptions),
2242
  "__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
 
2243
  "__experimentalResponsiveBlockControl": () => (/* reexport */ responsive_block_control),
2244
  "__experimentalTextDecorationControl": () => (/* reexport */ TextDecorationControl),
2245
  "__experimentalTextTransformControl": () => (/* reexport */ TextTransformControl),
@@ -2250,8 +2251,8 @@ __webpack_require__.d(__webpack_exports__, {
2250
  "__experimentalUseColorProps": () => (/* reexport */ useColorProps),
2251
  "__experimentalUseCustomSides": () => (/* reexport */ useCustomSides),
2252
  "__experimentalUseGradient": () => (/* reexport */ __experimentalUseGradient),
 
2253
  "__experimentalUseMultipleOriginColorsAndGradients": () => (/* reexport */ useMultipleOriginColorsAndGradients),
2254
- "__experimentalUseNoRecursiveRenders": () => (/* reexport */ useNoRecursiveRenders),
2255
  "__experimentalUseResizeCanvas": () => (/* reexport */ useResizeCanvas),
2256
  "__unstableBlockNameContext": () => (/* reexport */ block_name_context),
2257
  "__unstableBlockSettingsMenuFirstItem": () => (/* reexport */ block_settings_menu_first_item),
@@ -19034,11 +19035,13 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
19034
 
19035
  onMerge(forward) {
19036
  const {
19037
- clientId
 
19038
  } = ownProps;
19039
  const {
19040
  getPreviousBlockClientId,
19041
- getNextBlockClientId
 
19042
  } = select(store);
19043
 
19044
  if (forward) {
@@ -19052,6 +19055,14 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
19052
 
19053
  if (previousBlockClientId) {
19054
  mergeBlocks(previousBlockClientId, clientId);
 
 
 
 
 
 
 
 
19055
  }
19056
  }
19057
  },
@@ -20034,11 +20045,8 @@ function getClosestTabbable(target, isReverse, containerElement, onlyVertical) {
20034
  }
20035
  function useArrowNav() {
20036
  const {
20037
- getSelectedBlockClientId,
20038
  getMultiSelectedBlocksStartClientId,
20039
  getMultiSelectedBlocksEndClientId,
20040
- getPreviousBlockClientId,
20041
- getNextBlockClientId,
20042
  getSettings,
20043
  hasMultiSelection,
20044
  __unstableIsFullySelected
@@ -20055,22 +20063,10 @@ function useArrowNav() {
20055
  function onMouseDown() {
20056
  verticalRect = null;
20057
  }
20058
- /**
20059
- * Returns true if the given target field is the last in its block which
20060
- * can be considered for tab transition. For example, in a block with
20061
- * two text fields, this would return true when reversing from the first
20062
- * of the two fields, but false when reversing from the second.
20063
- *
20064
- * @param {Element} target Currently focused text field.
20065
- * @param {boolean} isReverse True if considering as the first field.
20066
- *
20067
- * @return {boolean} Whether field is at edge for tab transition.
20068
- */
20069
-
20070
 
20071
- function isTabbableEdge(target, isReverse) {
20072
  const closestTabbable = getClosestTabbable(target, isReverse, node);
20073
- return !closestTabbable || !isInSameBlock(target, closestTabbable);
20074
  }
20075
 
20076
  function onKeyDown(event) {
@@ -20162,15 +20158,9 @@ function useArrowNav() {
20162
  const {
20163
  keepCaretInsideBlock
20164
  } = getSettings();
20165
- const selectedBlockClientId = getSelectedBlockClientId();
20166
 
20167
  if (isShift) {
20168
- const selectionEndClientId = getMultiSelectedBlocksEndClientId();
20169
- const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
20170
- const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
20171
-
20172
- if ( // Ensure that there is a target block.
20173
- (isReverse && selectionBeforeEndClientId || !isReverse && selectionAfterEndClientId) && isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse)) {
20174
  node.contentEditable = true; // Firefox doesn't automatically move focus.
20175
 
20176
  node.focus();
@@ -20225,7 +20215,8 @@ function useSelectAll() {
20225
  getBlockRootClientId
20226
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
20227
  const {
20228
- multiSelect
 
20229
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
20230
  const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
20231
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
@@ -20253,6 +20244,7 @@ function useSelectAll() {
20253
  const lastClientId = (0,external_lodash_namespaceObject.last)(blockClientIds);
20254
 
20255
  if (firstClientId === lastClientId) {
 
20256
  return;
20257
  }
20258
 
@@ -20302,7 +20294,8 @@ function useDragSelection() {
20302
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
20303
  const {
20304
  isSelectionEnabled,
20305
- hasMultiSelection
 
20306
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
20307
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20308
  const {
@@ -20352,8 +20345,14 @@ function useDragSelection() {
20352
  target
20353
  } = _ref;
20354
 
20355
- // The primary button must be pressed to initiate selection.
 
 
 
 
20356
  // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
 
 
20357
  if (buttons !== 1) {
20358
  return;
20359
  } // Check the attribute, not the contentEditable attribute. All
@@ -23248,22 +23247,6 @@ const InserterDraggableBlocks = _ref => {
23248
 
23249
 
23250
 
23251
- /**
23252
- * Return true if platform is MacOS.
23253
- *
23254
- * @param {Object} _window window object by default; used for DI testing.
23255
- *
23256
- * @return {boolean} True if MacOS; false otherwise.
23257
- */
23258
-
23259
- function isAppleOS() {
23260
- let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
23261
-
23262
- const {
23263
- platform
23264
- } = _window.navigator;
23265
- return platform.indexOf('Mac') !== -1 || ['iPad', 'iPhone'].includes(platform);
23266
- }
23267
 
23268
  function InserterListItem(_ref) {
23269
  let {
@@ -23317,7 +23300,7 @@ function InserterListItem(_ref) {
23317
  disabled: item.isDisabled,
23318
  onClick: event => {
23319
  event.preventDefault();
23320
- onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey);
23321
  onHover(null);
23322
  },
23323
  onKeyDown: event => {
@@ -23327,7 +23310,7 @@ function InserterListItem(_ref) {
23327
 
23328
  if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
23329
  event.preventDefault();
23330
- onSelect(item, isAppleOS() ? event.metaKey : event.ctrlKey);
23331
  onHover(null);
23332
  }
23333
  },
@@ -23470,7 +23453,7 @@ function BlockTypesList(_ref) {
23470
  className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(item.id),
23471
  onSelect: onSelect,
23472
  onHover: onHover,
23473
- isDraggable: isDraggable,
23474
  isFirst: i === 0 && j === 0
23475
  })))), children);
23476
  }
@@ -26070,7 +26053,7 @@ function BlockPopoverInbetween(_ref) {
26070
  ,
26071
  key: nextClientId + '--' + rootClientId
26072
  }, props, {
26073
- className: classnames_default()('block-editor-block-popover', props.className),
26074
  __unstableForcePosition: true
26075
  }), (0,external_wp_element_namespaceObject.createElement)("div", {
26076
  style: style
@@ -29105,7 +29088,15 @@ function shouldDismissPastedFiles(files, html
29105
  // other elements found, like <figure>, but we assume that the user's
29106
  // intention is to paste the actual image file.
29107
  const IMAGE_TAG = /<\s*img\b/gi;
29108
- return ((_html$match = html.match(IMAGE_TAG)) === null || _html$match === void 0 ? void 0 : _html$match.length) !== 1;
 
 
 
 
 
 
 
 
29109
  }
29110
 
29111
  return false;
@@ -32484,7 +32475,9 @@ function BorderRadiusControl(_ref) {
32484
 
32485
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
32486
  className: "components-border-radius-control"
32487
- }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Radius')), (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
32488
  className: "components-border-radius-control__wrapper"
32489
  }, isLinked ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AllInputControl, {
32490
  className: "components-border-radius-control__unit-control",
@@ -32684,12 +32677,16 @@ function getColorClassName(colorContextName, colorSlug) {
32684
 
32685
  function getMostReadableColor(colors, colorValue) {
32686
  const colordColor = w(colorValue);
32687
- return (0,external_lodash_namespaceObject.maxBy)(colors, _ref => {
 
32688
  let {
32689
  color
32690
  } = _ref;
32691
  return colordColor.contrast(color);
32692
- }).color;
 
 
 
32693
  }
32694
 
32695
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js
@@ -33474,7 +33471,7 @@ function __experimentalUseGradient() {
33474
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
33475
  const TAB_COLOR = {
33476
  name: 'color',
33477
- title: 'Solid color',
33478
  value: 'color'
33479
  };
33480
  const TAB_GRADIENT = {
@@ -33536,6 +33533,11 @@ function ColorGradientControlInner(_ref) {
33536
  clearable: clearable
33537
  })
33538
  };
 
 
 
 
 
33539
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
33540
  __nextHasNoMarginBottom: true,
33541
  className: classnames_default()('block-editor-color-gradient-control', className)
@@ -33549,9 +33551,7 @@ function ColorGradientControlInner(_ref) {
33549
  className: "block-editor-color-gradient-control__tabs",
33550
  tabs: TABS_SETTINGS,
33551
  initialTabName: gradientValue ? TAB_GRADIENT.value : !!canChooseAColor && TAB_COLOR.value
33552
- }, tab => (0,external_wp_element_namespaceObject.createElement)("div", {
33553
- className: "block-editor-color-gradient-control__tab-panel"
33554
- }, tabPanels[tab.value])), !canChooseAGradient && tabPanels[TAB_COLOR.value], !canChooseAColor && tabPanels[TAB_GRADIENT.value])));
33555
  }
33556
 
33557
  function ColorGradientControlSelect(props) {
@@ -33635,7 +33635,10 @@ const LabeledColorIndicator = _ref2 => {
33635
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
33636
  className: "block-editor-panel-color-gradient-settings__color-indicator",
33637
  colorValue: colorValue
33638
- }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, label));
 
 
 
33639
  }; // Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`
33640
  // or as a `Button` if it isn't e.g. the controls are being rendered in
33641
  // a `ToolsPanel`.
@@ -33726,7 +33729,7 @@ function ColorGradientSettingsDropdown(_ref4) {
33726
  className: "block-editor-tools-panel-color-gradient-settings__dropdown",
33727
  renderToggle: renderToggle(toggleSettings),
33728
  renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, {
33729
- paddingSize: "medium"
33730
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
33731
  className: "block-editor-panel-color-gradient-settings__dropdown-content"
33732
  }, (0,external_wp_element_namespaceObject.createElement)(control, controlProps)))
@@ -34423,6 +34426,7 @@ function color_addTransforms(result, source, index, results) {
34423
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/font-appearance-control/index.js
34424
 
34425
 
 
34426
  /**
34427
  * WordPress dependencies
34428
  */
@@ -34500,7 +34504,8 @@ function FontAppearanceControl(props) {
34500
  value: {
34501
  fontStyle,
34502
  fontWeight
34503
- }
 
34504
  } = props;
34505
  const hasStylesOrWeights = hasFontStyles || hasFontWeights;
34506
  const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights);
@@ -34612,7 +34617,7 @@ function FontAppearanceControl(props) {
34612
  (0,external_wp_i18n_namespaceObject.__)('Currently selected font appearance: %s'), currentSelection.name);
34613
  };
34614
 
34615
- return hasStylesOrWeights && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
34616
  className: "components-font-appearance-control",
34617
  label: label,
34618
  describedBy: getDescribedBy(),
@@ -34623,8 +34628,9 @@ function FontAppearanceControl(props) {
34623
  selectedItem
34624
  } = _ref5;
34625
  return onChange(selectedItem.style);
34626
- }
34627
- });
 
34628
  }
34629
 
34630
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/line-height-control/utils.js
@@ -34657,6 +34663,7 @@ function isLineHeightDefined(lineHeight) {
34657
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/line-height-control/index.js
34658
 
34659
 
 
34660
  /**
34661
  * WordPress dependencies
34662
  */
@@ -34676,7 +34683,8 @@ const LineHeightControl = _ref => {
34676
 
34677
  /** Start opting into the new margin-free styles that will become the default in a future version. */
34678
  __nextHasNoMarginBottom = false,
34679
- __unstableInputWidth = '60px'
 
34680
  } = _ref;
34681
  const isDefined = isLineHeightDefined(lineHeight);
34682
 
@@ -34745,7 +34753,7 @@ const LineHeightControl = _ref => {
34745
  return (0,external_wp_element_namespaceObject.createElement)("div", {
34746
  className: "block-editor-line-height-control",
34747
  style: deprecatedStyles
34748
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
34749
  __unstableInputWidth: __unstableInputWidth,
34750
  __unstableStateReducer: stateReducer,
34751
  onChange: onChange,
@@ -34754,7 +34762,7 @@ const LineHeightControl = _ref => {
34754
  step: STEP,
34755
  value: value,
34756
  min: 0
34757
- }));
34758
  };
34759
  /**
34760
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md
@@ -35695,7 +35703,9 @@ function TextDecorationControl(_ref) {
35695
  } = _ref;
35696
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
35697
  className: "block-editor-text-decoration-control"
35698
- }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Decoration')), (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
35699
  className: "block-editor-text-decoration-control__buttons"
35700
  }, TEXT_DECORATIONS.map(textDecoration => {
35701
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
@@ -35901,7 +35911,9 @@ function TextTransformControl(_ref) {
35901
  } = _ref;
35902
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
35903
  className: "block-editor-text-transform-control"
35904
- }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Letter case')), (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
35905
  className: "block-editor-text-transform-control__buttons"
35906
  }, TEXT_TRANSFORMS.map(textTransform => {
35907
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
@@ -36026,6 +36038,7 @@ function resetTextTransform(_ref) {
36026
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/letter-spacing-control/index.js
36027
 
36028
 
 
36029
  /**
36030
  * WordPress dependencies
36031
  */
@@ -36051,7 +36064,8 @@ function LetterSpacingControl(_ref) {
36051
  let {
36052
  value,
36053
  onChange,
36054
- __unstableInputWidth = '60px'
 
36055
  } = _ref;
36056
  const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
36057
  availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'],
@@ -36061,13 +36075,13 @@ function LetterSpacingControl(_ref) {
36061
  rem: 0.2
36062
  }
36063
  });
36064
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
36065
  label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
36066
  value: value,
36067
  __unstableInputWidth: __unstableInputWidth,
36068
  units: units,
36069
  onChange: onChange
36070
- });
36071
  }
36072
 
36073
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/letter-spacing.js
@@ -37228,7 +37242,14 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
37228
  name,
37229
  attributes
37230
  } = props;
37231
- const shouldRenderLayoutStyles = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, layoutBlockSupportKey);
 
 
 
 
 
 
 
37232
  const id = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock);
37233
  const defaultThemeLayout = useSetting('layout') || {};
37234
  const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
@@ -37239,7 +37260,7 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
37239
  default: defaultBlockLayout
37240
  } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
37241
  const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {};
37242
- const layoutClasses = shouldRenderLayoutStyles ? useLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
37243
  const selector = `.${(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name)}.wp-container-${id}`;
37244
  const blockGapSupport = useSetting('spacing.blockGap');
37245
  const hasBlockGapSupport = blockGapSupport !== null; // Get CSS string for the current layout type.
@@ -38737,6 +38758,21 @@ function ListViewLeaf(_ref) {
38737
  }, props), children);
38738
  }
38739
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38740
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/expander.js
38741
 
38742
 
@@ -38744,6 +38780,7 @@ function ListViewLeaf(_ref) {
38744
  * WordPress dependencies
38745
  */
38746
 
 
38747
  function ListViewExpander(_ref) {
38748
  let {
38749
  onClick
@@ -38764,7 +38801,7 @@ function ListViewExpander(_ref) {
38764
  }),
38765
  "aria-hidden": "true"
38766
  }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
38767
- icon: chevron_right_small
38768
  }))
38769
  );
38770
  }
@@ -40374,12 +40411,9 @@ function BlockStyles(_ref3) {
40374
  onBlur: () => styleItemHandler(null),
40375
  onClick: () => onSelectStylePreview(style),
40376
  "aria-current": activeStyle.name === style.name
40377
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
40378
- as: "span",
40379
- limit: 12,
40380
- ellipsizeMode: "tail",
40381
- className: "block-editor-block-styles__item-text",
40382
- truncate: true
40383
  }, buttonText));
40384
  })), hoveredStyle && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(BlockStylesPreviewPanelFill, {
40385
  scope: scope,
@@ -42921,6 +42955,7 @@ const image_size_control_noop = () => {};
42921
 
42922
  function ImageSizeControl(_ref) {
42923
  let {
 
42924
  imageWidth,
42925
  imageHeight,
42926
  imageSizeOptions = [],
@@ -42941,7 +42976,8 @@ function ImageSizeControl(_ref) {
42941
  label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
42942
  value: slug,
42943
  options: imageSizeOptions,
42944
- onChange: onChangeImage
 
42945
  }), isResizable && (0,external_wp_element_namespaceObject.createElement)("div", {
42946
  className: "block-editor-image-size-control"
42947
  }, (0,external_wp_element_namespaceObject.createElement)("p", {
@@ -43816,15 +43852,10 @@ function LinkControlSearchResults(_ref) {
43816
  }
43817
 
43818
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/is-url-like.js
43819
- /**
43820
- * External dependencies
43821
- */
43822
-
43823
  /**
43824
  * WordPress dependencies
43825
  */
43826
 
43827
-
43828
  /**
43829
  * Determines whether a given value could be a URL. Note this does not
43830
  * guarantee the value is a URL only that it looks like it might be one. For
@@ -43838,7 +43869,7 @@ function LinkControlSearchResults(_ref) {
43838
  */
43839
 
43840
  function isURLLike(val) {
43841
- const isInternal = (0,external_lodash_namespaceObject.startsWith)(val, '#');
43842
  return (0,external_wp_url_namespaceObject.isURL)(val) || val && val.includes('www.') || isInternal;
43843
  }
43844
 
@@ -43849,11 +43880,6 @@ function isURLLike(val) {
43849
 
43850
 
43851
 
43852
- /**
43853
- * External dependencies
43854
- */
43855
-
43856
-
43857
  /**
43858
  * Internal dependencies
43859
  */
@@ -43874,7 +43900,7 @@ const handleDirectEntry = val => {
43874
  type = TEL_TYPE;
43875
  }
43876
 
43877
- if ((0,external_lodash_namespaceObject.startsWith)(val, '#')) {
43878
  type = INTERNAL_TYPE;
43879
  }
43880
 
@@ -46396,6 +46422,103 @@ function removeCharsetMetaTag(html) {
46396
  return html;
46397
  }
46398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46399
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/prevent-event-discovery.js
46400
  /**
46401
  * WordPress dependencies
@@ -47048,6 +47171,7 @@ function FormatEdit(_ref) {
47048
 
47049
 
47050
 
 
47051
  const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
47052
  const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
47053
  /**
@@ -47317,7 +47441,10 @@ function RichTextWrapper(_ref, forwardedRef) {
47317
  "aria-multiline": !disableLineBreaks,
47318
  "aria-label": placeholder
47319
  }, props, autocompleteProps, {
47320
- ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, autocompleteProps.ref, props.ref, richTextRef, useInputRules({
 
 
 
47321
  value,
47322
  onChange,
47323
  __unstableAllowPrefixTransformations,
@@ -47990,6 +48117,7 @@ const ImageURLInputUI = _ref => {
47990
  rel
47991
  } = _ref;
47992
  const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
 
47993
  const openLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => {
47994
  setIsOpen(true);
47995
  });
@@ -48163,8 +48291,10 @@ const ImageURLInputUI = _ref => {
48163
  className: "components-toolbar__control",
48164
  label: url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'),
48165
  "aria-expanded": isOpen,
48166
- onClick: openLinkUI
 
48167
  }), isOpen && (0,external_wp_element_namespaceObject.createElement)(url_popover, {
 
48168
  onFocusOutside: onFocusOutside(),
48169
  onClose: closeLinkUI,
48170
  renderSettings: () => advancedOptions,
@@ -48232,10 +48362,10 @@ function PreviewOptions(_ref) {
48232
  disabled: !isEnabled,
48233
 
48234
  /* translators: button label text should, if possible, be under 16 characters. */
48235
- children: (0,external_wp_i18n_namespaceObject.__)('Preview')
48236
  };
48237
  const menuProps = {
48238
- 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Preview options')
48239
  };
48240
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
48241
  className: "block-editor-post-preview__dropdown",
@@ -49468,7 +49598,7 @@ const TypewriterOrIEBypass = isIE ? props => props.children : Typewriter;
49468
 
49469
  /* harmony default export */ const typewriter = (TypewriterOrIEBypass);
49470
 
49471
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-no-recursive-renders/index.js
49472
 
49473
 
49474
  /**
@@ -49498,23 +49628,53 @@ function addToBlockType(renderedBlocks, blockName, uniqueId) {
49498
  result[blockName].add(uniqueId);
49499
  return result;
49500
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49501
  /**
49502
  * A React hook for keeping track of blocks previously rendered up in the block
49503
  * tree. Blocks susceptible to recursion can use this hook in their `Edit`
49504
  * function to prevent said recursion.
49505
  *
 
 
 
49506
  * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.
49507
  * @param {string} blockName Optional block name.
49508
  *
49509
- * @return {[boolean, Function]} A tuple of:
49510
- * - a boolean describing whether the provided id
49511
- * has already been rendered;
49512
- * - a React context provider to be used to wrap
49513
- * other elements.
49514
  */
49515
 
49516
-
49517
- function useNoRecursiveRenders(uniqueId) {
49518
  var _previouslyRenderedBl;
49519
 
49520
  let blockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
@@ -49523,17 +49683,7 @@ function useNoRecursiveRenders(uniqueId) {
49523
  name
49524
  } = useBlockEditContext();
49525
  blockName = blockName || name;
49526
- const hasAlreadyRendered = Boolean((_previouslyRenderedBl = previouslyRenderedBlocks[blockName]) === null || _previouslyRenderedBl === void 0 ? void 0 : _previouslyRenderedBl.has(uniqueId));
49527
- const newRenderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]);
49528
- const Provider = (0,external_wp_element_namespaceObject.useCallback)(_ref => {
49529
- let {
49530
- children
49531
- } = _ref;
49532
- return (0,external_wp_element_namespaceObject.createElement)(RenderedRefsContext.Provider, {
49533
- value: newRenderedBlocks
49534
- }, children);
49535
- }, [newRenderedBlocks]);
49536
- return [hasAlreadyRendered, Provider];
49537
  }
49538
 
49539
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
@@ -49767,12 +49917,18 @@ const __experimentalGetElementClassName = element => {
49767
  };
49768
 
49769
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
49770
- /**
49771
- * External dependencies
49772
- */
49773
-
49774
  /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
 
 
 
 
 
 
 
49775
 
 
 
 
49776
  /**
49777
  * Matches the provided block variations with a block's attributes. If no match
49778
  * or more than one matches are found it returns `undefined`. If a single match is
@@ -49786,14 +49942,15 @@ const __experimentalGetElementClassName = element => {
49786
  * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
49787
  */
49788
 
 
49789
  const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
49790
  if (!variations || !blockAttributes) return;
49791
- const matches = variations.filter(_ref => {
49792
  let {
49793
  attributes
49794
- } = _ref;
49795
  if (!attributes || !Object.keys(attributes).length) return false;
49796
- return (0,external_lodash_namespaceObject.isMatch)(blockAttributes, attributes);
49797
  });
49798
  if (matches.length !== 1) return;
49799
  return matches[0];
2240
  "__experimentalPanelColorGradientSettings": () => (/* reexport */ panel_color_gradient_settings),
2241
  "__experimentalPreviewOptions": () => (/* reexport */ PreviewOptions),
2242
  "__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
2243
+ "__experimentalRecursionProvider": () => (/* reexport */ RecursionProvider),
2244
  "__experimentalResponsiveBlockControl": () => (/* reexport */ responsive_block_control),
2245
  "__experimentalTextDecorationControl": () => (/* reexport */ TextDecorationControl),
2246
  "__experimentalTextTransformControl": () => (/* reexport */ TextTransformControl),
2251
  "__experimentalUseColorProps": () => (/* reexport */ useColorProps),
2252
  "__experimentalUseCustomSides": () => (/* reexport */ useCustomSides),
2253
  "__experimentalUseGradient": () => (/* reexport */ __experimentalUseGradient),
2254
+ "__experimentalUseHasRecursion": () => (/* reexport */ useHasRecursion),
2255
  "__experimentalUseMultipleOriginColorsAndGradients": () => (/* reexport */ useMultipleOriginColorsAndGradients),
 
2256
  "__experimentalUseResizeCanvas": () => (/* reexport */ useResizeCanvas),
2257
  "__unstableBlockNameContext": () => (/* reexport */ block_name_context),
2258
  "__unstableBlockSettingsMenuFirstItem": () => (/* reexport */ block_settings_menu_first_item),
19035
 
19036
  onMerge(forward) {
19037
  const {
19038
+ clientId,
19039
+ rootClientId
19040
  } = ownProps;
19041
  const {
19042
  getPreviousBlockClientId,
19043
+ getNextBlockClientId,
19044
+ getBlock
19045
  } = select(store);
19046
 
19047
  if (forward) {
19055
 
19056
  if (previousBlockClientId) {
19057
  mergeBlocks(previousBlockClientId, clientId);
19058
+ } else if (rootClientId) {
19059
+ // Attempt to "unwrap" the block contents when there's no
19060
+ // preceding block to merge with.
19061
+ const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), '*');
19062
+
19063
+ if (replacement && replacement.length) {
19064
+ replaceBlocks(rootClientId, replacement, 0);
19065
+ }
19066
  }
19067
  }
19068
  },
20045
  }
20046
  function useArrowNav() {
20047
  const {
 
20048
  getMultiSelectedBlocksStartClientId,
20049
  getMultiSelectedBlocksEndClientId,
 
 
20050
  getSettings,
20051
  hasMultiSelection,
20052
  __unstableIsFullySelected
20063
  function onMouseDown() {
20064
  verticalRect = null;
20065
  }
 
 
 
 
 
 
 
 
 
 
 
 
20066
 
20067
+ function isClosestTabbableABlock(target, isReverse) {
20068
  const closestTabbable = getClosestTabbable(target, isReverse, node);
20069
+ return closestTabbable && getBlockClientId(closestTabbable);
20070
  }
20071
 
20072
  function onKeyDown(event) {
20158
  const {
20159
  keepCaretInsideBlock
20160
  } = getSettings();
 
20161
 
20162
  if (isShift) {
20163
+ if (isClosestTabbableABlock(target, isReverse) && isNavEdge(target, isReverse)) {
 
 
 
 
 
20164
  node.contentEditable = true; // Firefox doesn't automatically move focus.
20165
 
20166
  node.focus();
20215
  getBlockRootClientId
20216
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
20217
  const {
20218
+ multiSelect,
20219
+ selectBlock
20220
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
20221
  const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
20222
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20244
  const lastClientId = (0,external_lodash_namespaceObject.last)(blockClientIds);
20245
 
20246
  if (firstClientId === lastClientId) {
20247
+ selectBlock(firstClientId);
20248
  return;
20249
  }
20250
 
20294
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
20295
  const {
20296
  isSelectionEnabled,
20297
+ hasMultiSelection,
20298
+ isDraggingBlocks
20299
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
20300
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20301
  const {
20345
  target
20346
  } = _ref;
20347
 
20348
+ // Avoid triggering a multi-selection if the user is already
20349
+ // dragging blocks.
20350
+ if (isDraggingBlocks()) {
20351
+ return;
20352
+ } // The primary button must be pressed to initiate selection.
20353
  // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
20354
+
20355
+
20356
  if (buttons !== 1) {
20357
  return;
20358
  } // Check the attribute, not the contentEditable attribute. All
23247
 
23248
 
23249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23250
 
23251
  function InserterListItem(_ref) {
23252
  let {
23300
  disabled: item.isDisabled,
23301
  onClick: event => {
23302
  event.preventDefault();
23303
+ onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey);
23304
  onHover(null);
23305
  },
23306
  onKeyDown: event => {
23310
 
23311
  if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
23312
  event.preventDefault();
23313
+ onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey);
23314
  onHover(null);
23315
  }
23316
  },
23453
  className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(item.id),
23454
  onSelect: onSelect,
23455
  onHover: onHover,
23456
+ isDraggable: isDraggable && !item.isDisabled,
23457
  isFirst: i === 0 && j === 0
23458
  })))), children);
23459
  }
26053
  ,
26054
  key: nextClientId + '--' + rootClientId
26055
  }, props, {
26056
+ className: classnames_default()('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className),
26057
  __unstableForcePosition: true
26058
  }), (0,external_wp_element_namespaceObject.createElement)("div", {
26059
  style: style
29088
  // other elements found, like <figure>, but we assume that the user's
29089
  // intention is to paste the actual image file.
29090
  const IMAGE_TAG = /<\s*img\b/gi;
29091
+ if (((_html$match = html.match(IMAGE_TAG)) === null || _html$match === void 0 ? void 0 : _html$match.length) !== 1) return true; // Even when there is exactly one <img> tag in the HTML payload, we
29092
+ // choose to weed out local images, i.e. those whose source starts with
29093
+ // "file://". These payloads occur in specific configurations, such as
29094
+ // when copying an entire document from Microsoft Word, that contains
29095
+ // text and exactly one image, and pasting that content using Google
29096
+ // Chrome.
29097
+
29098
+ const IMG_WITH_LOCAL_SRC = /<\s*img\b[^>]*\bsrc="file:\/\//i;
29099
+ if (html.match(IMG_WITH_LOCAL_SRC)) return true;
29100
  }
29101
 
29102
  return false;
32475
 
32476
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
32477
  className: "components-border-radius-control"
32478
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
32479
+ as: "legend"
32480
+ }, (0,external_wp_i18n_namespaceObject.__)('Radius')), (0,external_wp_element_namespaceObject.createElement)("div", {
32481
  className: "components-border-radius-control__wrapper"
32482
  }, isLinked ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(AllInputControl, {
32483
  className: "components-border-radius-control__unit-control",
32677
 
32678
  function getMostReadableColor(colors, colorValue) {
32679
  const colordColor = w(colorValue);
32680
+
32681
+ const getColorContrast = _ref => {
32682
  let {
32683
  color
32684
  } = _ref;
32685
  return colordColor.contrast(color);
32686
+ };
32687
+
32688
+ const maxContrast = Math.max(...colors.map(getColorContrast));
32689
+ return colors.find(color => getColorContrast(color) === maxContrast).color;
32690
  }
32691
 
32692
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js
33471
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
33472
  const TAB_COLOR = {
33473
  name: 'color',
33474
+ title: 'Solid',
33475
  value: 'color'
33476
  };
33477
  const TAB_GRADIENT = {
33533
  clearable: clearable
33534
  })
33535
  };
33536
+
33537
+ const renderPanelType = type => (0,external_wp_element_namespaceObject.createElement)("div", {
33538
+ className: "block-editor-color-gradient-control__panel"
33539
+ }, tabPanels[type]);
33540
+
33541
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
33542
  __nextHasNoMarginBottom: true,
33543
  className: classnames_default()('block-editor-color-gradient-control', className)
33551
  className: "block-editor-color-gradient-control__tabs",
33552
  tabs: TABS_SETTINGS,
33553
  initialTabName: gradientValue ? TAB_GRADIENT.value : !!canChooseAColor && TAB_COLOR.value
33554
+ }, tab => renderPanelType(tab.value)), !canChooseAGradient && renderPanelType(TAB_COLOR.value), !canChooseAColor && renderPanelType(TAB_GRADIENT.value))));
 
 
33555
  }
33556
 
33557
  function ColorGradientControlSelect(props) {
33635
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
33636
  className: "block-editor-panel-color-gradient-settings__color-indicator",
33637
  colorValue: colorValue
33638
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, {
33639
+ className: "block-editor-panel-color-gradient-settings__color-name",
33640
+ title: label
33641
+ }, label));
33642
  }; // Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`
33643
  // or as a `Button` if it isn't e.g. the controls are being rendered in
33644
  // a `ToolsPanel`.
33729
  className: "block-editor-tools-panel-color-gradient-settings__dropdown",
33730
  renderToggle: renderToggle(toggleSettings),
33731
  renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, {
33732
+ paddingSize: "none"
33733
  }, (0,external_wp_element_namespaceObject.createElement)("div", {
33734
  className: "block-editor-panel-color-gradient-settings__dropdown-content"
33735
  }, (0,external_wp_element_namespaceObject.createElement)(control, controlProps)))
34426
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/font-appearance-control/index.js
34427
 
34428
 
34429
+
34430
  /**
34431
  * WordPress dependencies
34432
  */
34504
  value: {
34505
  fontStyle,
34506
  fontWeight
34507
+ },
34508
+ ...otherProps
34509
  } = props;
34510
  const hasStylesOrWeights = hasFontStyles || hasFontWeights;
34511
  const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights);
34617
  (0,external_wp_i18n_namespaceObject.__)('Currently selected font appearance: %s'), currentSelection.name);
34618
  };
34619
 
34620
+ return hasStylesOrWeights && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, _extends({}, otherProps, {
34621
  className: "components-font-appearance-control",
34622
  label: label,
34623
  describedBy: getDescribedBy(),
34628
  selectedItem
34629
  } = _ref5;
34630
  return onChange(selectedItem.style);
34631
+ },
34632
+ __nextUnconstrainedWidth: true
34633
+ }));
34634
  }
34635
 
34636
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/line-height-control/utils.js
34663
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/line-height-control/index.js
34664
 
34665
 
34666
+
34667
  /**
34668
  * WordPress dependencies
34669
  */
34683
 
34684
  /** Start opting into the new margin-free styles that will become the default in a future version. */
34685
  __nextHasNoMarginBottom = false,
34686
+ __unstableInputWidth = '60px',
34687
+ ...otherProps
34688
  } = _ref;
34689
  const isDefined = isLineHeightDefined(lineHeight);
34690
 
34753
  return (0,external_wp_element_namespaceObject.createElement)("div", {
34754
  className: "block-editor-line-height-control",
34755
  style: deprecatedStyles
34756
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, _extends({}, otherProps, {
34757
  __unstableInputWidth: __unstableInputWidth,
34758
  __unstableStateReducer: stateReducer,
34759
  onChange: onChange,
34762
  step: STEP,
34763
  value: value,
34764
  min: 0
34765
+ })));
34766
  };
34767
  /**
34768
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md
35703
  } = _ref;
35704
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
35705
  className: "block-editor-text-decoration-control"
35706
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
35707
+ as: "legend"
35708
+ }, (0,external_wp_i18n_namespaceObject.__)('Decoration')), (0,external_wp_element_namespaceObject.createElement)("div", {
35709
  className: "block-editor-text-decoration-control__buttons"
35710
  }, TEXT_DECORATIONS.map(textDecoration => {
35711
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
35911
  } = _ref;
35912
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
35913
  className: "block-editor-text-transform-control"
35914
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
35915
+ as: "legend"
35916
+ }, (0,external_wp_i18n_namespaceObject.__)('Letter case')), (0,external_wp_element_namespaceObject.createElement)("div", {
35917
  className: "block-editor-text-transform-control__buttons"
35918
  }, TEXT_TRANSFORMS.map(textTransform => {
35919
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
36038
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/letter-spacing-control/index.js
36039
 
36040
 
36041
+
36042
  /**
36043
  * WordPress dependencies
36044
  */
36064
  let {
36065
  value,
36066
  onChange,
36067
+ __unstableInputWidth = '60px',
36068
+ ...otherProps
36069
  } = _ref;
36070
  const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
36071
  availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem'],
36075
  rem: 0.2
36076
  }
36077
  });
36078
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, otherProps, {
36079
  label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'),
36080
  value: value,
36081
  __unstableInputWidth: __unstableInputWidth,
36082
  units: units,
36083
  onChange: onChange
36084
+ }));
36085
  }
36086
 
36087
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/letter-spacing.js
37242
  name,
37243
  attributes
37244
  } = props;
37245
+ const hasLayoutBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, layoutBlockSupportKey);
37246
+ const disableLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)(select => {
37247
+ const {
37248
+ getSettings
37249
+ } = select(store);
37250
+ return !!getSettings().disableLayoutStyles;
37251
+ });
37252
+ const shouldRenderLayoutStyles = hasLayoutBlockSupport && !disableLayoutStyles;
37253
  const id = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock);
37254
  const defaultThemeLayout = useSetting('layout') || {};
37255
  const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
37260
  default: defaultBlockLayout
37261
  } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
37262
  const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {};
37263
+ const layoutClasses = hasLayoutBlockSupport ? useLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
37264
  const selector = `.${(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name)}.wp-container-${id}`;
37265
  const blockGapSupport = useSetting('spacing.blockGap');
37266
  const hasBlockGapSupport = blockGapSupport !== null; // Get CSS string for the current layout type.
38758
  }, props), children);
38759
  }
38760
 
38761
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/chevron-left-small.js
38762
+
38763
+
38764
+ /**
38765
+ * WordPress dependencies
38766
+ */
38767
+
38768
+ const chevronLeftSmall = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
38769
+ xmlns: "http://www.w3.org/2000/svg",
38770
+ viewBox: "0 0 24 24"
38771
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
38772
+ d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"
38773
+ }));
38774
+ /* harmony default export */ const chevron_left_small = (chevronLeftSmall);
38775
+
38776
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/expander.js
38777
 
38778
 
38780
  * WordPress dependencies
38781
  */
38782
 
38783
+
38784
  function ListViewExpander(_ref) {
38785
  let {
38786
  onClick
38801
  }),
38802
  "aria-hidden": "true"
38803
  }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
38804
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small
38805
  }))
38806
  );
38807
  }
40411
  onBlur: () => styleItemHandler(null),
40412
  onClick: () => onSelectStylePreview(style),
40413
  "aria-current": activeStyle.name === style.name
40414
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
40415
+ numberOfLines: 1,
40416
+ className: "block-editor-block-styles__item-text"
 
 
 
40417
  }, buttonText));
40418
  })), hoveredStyle && !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(BlockStylesPreviewPanelFill, {
40419
  scope: scope,
42955
 
42956
  function ImageSizeControl(_ref) {
42957
  let {
42958
+ imageSizeHelp,
42959
  imageWidth,
42960
  imageHeight,
42961
  imageSizeOptions = [],
42976
  label: (0,external_wp_i18n_namespaceObject.__)('Image size'),
42977
  value: slug,
42978
  options: imageSizeOptions,
42979
+ onChange: onChangeImage,
42980
+ help: imageSizeHelp
42981
  }), isResizable && (0,external_wp_element_namespaceObject.createElement)("div", {
42982
  className: "block-editor-image-size-control"
42983
  }, (0,external_wp_element_namespaceObject.createElement)("p", {
43852
  }
43853
 
43854
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/link-control/is-url-like.js
 
 
 
 
43855
  /**
43856
  * WordPress dependencies
43857
  */
43858
 
 
43859
  /**
43860
  * Determines whether a given value could be a URL. Note this does not
43861
  * guarantee the value is a URL only that it looks like it might be one. For
43869
  */
43870
 
43871
  function isURLLike(val) {
43872
+ const isInternal = val === null || val === void 0 ? void 0 : val.startsWith('#');
43873
  return (0,external_wp_url_namespaceObject.isURL)(val) || val && val.includes('www.') || isInternal;
43874
  }
43875
 
43880
 
43881
 
43882
 
 
 
 
 
 
43883
  /**
43884
  * Internal dependencies
43885
  */
43900
  type = TEL_TYPE;
43901
  }
43902
 
43903
+ if (val !== null && val !== void 0 && val.startsWith('#')) {
43904
  type = INTERNAL_TYPE;
43905
  }
43906
 
46422
  return html;
46423
  }
46424
 
46425
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-before-input-rules.js
46426
+ /**
46427
+ * WordPress dependencies
46428
+ */
46429
+
46430
+
46431
+
46432
+
46433
+
46434
+ /**
46435
+ * Internal dependencies
46436
+ */
46437
+
46438
+
46439
+ /**
46440
+ * When typing over a selection, the selection will we wrapped by a matching
46441
+ * character pair. The second character is optional, it defaults to the first
46442
+ * character.
46443
+ *
46444
+ * @type {string[]} Array of character pairs.
46445
+ */
46446
+
46447
+ const wrapSelectionSettings = ['`', '"', "'", '“”', '‘’'];
46448
+ function useBeforeInputRules(props) {
46449
+ const {
46450
+ __unstableMarkLastChangeAsPersistent,
46451
+ __unstableMarkAutomaticChange
46452
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
46453
+ const propsRef = (0,external_wp_element_namespaceObject.useRef)(props);
46454
+ propsRef.current = props;
46455
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
46456
+ function onInput(event) {
46457
+ const {
46458
+ inputType,
46459
+ data
46460
+ } = event;
46461
+ const {
46462
+ value,
46463
+ onChange
46464
+ } = propsRef.current; // Only run the rules when inserting text.
46465
+
46466
+ if (inputType !== 'insertText') {
46467
+ return;
46468
+ }
46469
+
46470
+ if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) {
46471
+ return;
46472
+ }
46473
+
46474
+ const pair = (0,external_wp_hooks_namespaceObject.applyFilters)('blockEditor.wrapSelectionSettings', wrapSelectionSettings).find(_ref => {
46475
+ let [startChar, endChar] = _ref;
46476
+ return startChar === data || endChar === data;
46477
+ });
46478
+
46479
+ if (!pair) {
46480
+ return;
46481
+ }
46482
+
46483
+ const [startChar, endChar = startChar] = pair;
46484
+ const start = value.start;
46485
+ const end = value.end + startChar.length;
46486
+ let newValue = (0,external_wp_richText_namespaceObject.insert)(value, startChar, start, start);
46487
+ newValue = (0,external_wp_richText_namespaceObject.insert)(newValue, endChar, end, end);
46488
+
46489
+ __unstableMarkLastChangeAsPersistent();
46490
+
46491
+ onChange(newValue);
46492
+
46493
+ __unstableMarkAutomaticChange();
46494
+
46495
+ const init = {};
46496
+
46497
+ for (const key in event) {
46498
+ init[key] = event[key];
46499
+ }
46500
+
46501
+ init.data = endChar;
46502
+ const {
46503
+ ownerDocument
46504
+ } = element;
46505
+ const {
46506
+ defaultView
46507
+ } = ownerDocument;
46508
+ const newEvent = new defaultView.InputEvent('input', init); // Dispatch an input event with the new data. This will trigger the
46509
+ // input rules.
46510
+
46511
+ event.target.dispatchEvent(newEvent);
46512
+ event.preventDefault();
46513
+ }
46514
+
46515
+ element.addEventListener('beforeinput', onInput);
46516
+ return () => {
46517
+ element.removeEventListener('beforeinput', onInput);
46518
+ };
46519
+ }, []);
46520
+ }
46521
+
46522
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/prevent-event-discovery.js
46523
  /**
46524
  * WordPress dependencies
47171
 
47172
 
47173
 
47174
+
47175
  const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
47176
  const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
47177
  /**
47441
  "aria-multiline": !disableLineBreaks,
47442
  "aria-label": placeholder
47443
  }, props, autocompleteProps, {
47444
+ ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([forwardedRef, autocompleteProps.ref, props.ref, richTextRef, useBeforeInputRules({
47445
+ value,
47446
+ onChange
47447
+ }), useInputRules({
47448
  value,
47449
  onChange,
47450
  __unstableAllowPrefixTransformations,
48117
  rel
48118
  } = _ref;
48119
  const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
48120
+ const buttonRef = (0,external_wp_element_namespaceObject.useRef)(null);
48121
  const openLinkUI = (0,external_wp_element_namespaceObject.useCallback)(() => {
48122
  setIsOpen(true);
48123
  });
48291
  className: "components-toolbar__control",
48292
  label: url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'),
48293
  "aria-expanded": isOpen,
48294
+ onClick: openLinkUI,
48295
+ ref: buttonRef
48296
  }), isOpen && (0,external_wp_element_namespaceObject.createElement)(url_popover, {
48297
+ anchorRef: buttonRef,
48298
  onFocusOutside: onFocusOutside(),
48299
  onClose: closeLinkUI,
48300
  renderSettings: () => advancedOptions,
48362
  disabled: !isEnabled,
48363
 
48364
  /* translators: button label text should, if possible, be under 16 characters. */
48365
+ children: (0,external_wp_i18n_namespaceObject.__)('View')
48366
  };
48367
  const menuProps = {
48368
+ 'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options')
48369
  };
48370
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
48371
  className: "block-editor-post-preview__dropdown",
49598
 
49599
  /* harmony default export */ const typewriter = (TypewriterOrIEBypass);
49600
 
49601
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/recursion-provider/index.js
49602
 
49603
 
49604
  /**
49628
  result[blockName].add(uniqueId);
49629
  return result;
49630
  }
49631
+ /**
49632
+ * A React context provider for use with the `useHasRecursion` hook to prevent recursive
49633
+ * renders.
49634
+ *
49635
+ * Wrap block content with this provider and provide the same `uniqueId` prop as used
49636
+ * with `useHasRecursion`.
49637
+ *
49638
+ * @param {Object} props
49639
+ * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance.
49640
+ * @param {string} props.blockName Optional block name.
49641
+ * @param {JSX.Element} props.children React children.
49642
+ *
49643
+ * @return {JSX.Element} A React element.
49644
+ */
49645
+
49646
+
49647
+ function RecursionProvider(_ref) {
49648
+ let {
49649
+ children,
49650
+ uniqueId,
49651
+ blockName = ''
49652
+ } = _ref;
49653
+ const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext);
49654
+ const {
49655
+ name
49656
+ } = useBlockEditContext();
49657
+ blockName = blockName || name;
49658
+ const newRenderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]);
49659
+ return (0,external_wp_element_namespaceObject.createElement)(RenderedRefsContext.Provider, {
49660
+ value: newRenderedBlocks
49661
+ }, children);
49662
+ }
49663
  /**
49664
  * A React hook for keeping track of blocks previously rendered up in the block
49665
  * tree. Blocks susceptible to recursion can use this hook in their `Edit`
49666
  * function to prevent said recursion.
49667
  *
49668
+ * Use this with the `RecursionProvider` component, using the same `uniqueId` value
49669
+ * for both the hook and the provider.
49670
+ *
49671
  * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.
49672
  * @param {string} blockName Optional block name.
49673
  *
49674
+ * @return {boolean} A boolean describing whether the provided id has already been rendered.
 
 
 
 
49675
  */
49676
 
49677
+ function useHasRecursion(uniqueId) {
 
49678
  var _previouslyRenderedBl;
49679
 
49680
  let blockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
49683
  name
49684
  } = useBlockEditContext();
49685
  blockName = blockName || name;
49686
+ return Boolean((_previouslyRenderedBl = previouslyRenderedBlocks[blockName]) === null || _previouslyRenderedBl === void 0 ? void 0 : _previouslyRenderedBl.has(uniqueId));
 
 
 
 
 
 
 
 
 
 
49687
  }
49688
 
49689
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/close-small.js
49917
  };
49918
 
49919
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
 
 
 
 
49920
  /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
49921
+ function matchesAttributes(blockAttributes, variation) {
49922
+ return Object.entries(variation).every(_ref => {
49923
+ let [key, value] = _ref;
49924
+
49925
+ if (typeof value === 'object' && typeof blockAttributes[key] === 'object') {
49926
+ return matchesAttributes(blockAttributes[key], value);
49927
+ }
49928
 
49929
+ return blockAttributes[key] === value;
49930
+ });
49931
+ }
49932
  /**
49933
  * Matches the provided block variations with a block's attributes. If no match
49934
  * or more than one matches are found it returns `undefined`. If a single match is
49942
  * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
49943
  */
49944
 
49945
+
49946
  const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
49947
  if (!variations || !blockAttributes) return;
49948
+ const matches = variations.filter(_ref2 => {
49949
  let {
49950
  attributes
49951
+ } = _ref2;
49952
  if (!attributes || !Object.keys(attributes).length) return false;
49953
+ return matchesAttributes(blockAttributes, attributes);
49954
  });
49955
  if (matches.length !== 1) return;
49956
  return matches[0];
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' => '1d7ce6dc82d711ff5290');
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' => '203c8636412142ec1267');
build/block-editor/index.min.js CHANGED
@@ -1,113 +1,113 @@
1
- (()=>{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:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):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:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function 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);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},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:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML="&nbsp;","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:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>fb,AlignmentToolbar:()=>vb,Autocomplete:()=>Ib,BlockAlignmentControl:()=>hl,BlockAlignmentToolbar:()=>fl,BlockBreadcrumb:()=>Mb,BlockColorsStyleSelector:()=>Fb,BlockContextProvider:()=>Tl,BlockControls:()=>po,BlockEdit:()=>Ml,BlockEditorKeyboardShortcuts:()=>yE,BlockEditorProvider:()=>pu,BlockFormatControls:()=>uo,BlockIcon:()=>su,BlockInspector:()=>fE,BlockList:()=>mh,BlockMover:()=>xm,BlockNavigationDropdown:()=>rk,BlockPreview:()=>Ud,BlockSelectionClearer:()=>hu,BlockSettingsMenu:()=>Ag,BlockSettingsMenuControls:()=>Tg,BlockStyles:()=>ck,BlockTitle:()=>mm,BlockToolbar:()=>Ug,BlockTools:()=>vE,BlockVerticalAlignmentControl:()=>kr,BlockVerticalAlignmentToolbar:()=>_r,ButtonBlockAppender:()=>nm,ButtonBlockerAppender:()=>tm,ColorPalette:()=>Bk,ColorPaletteControl:()=>Ik,ContrastChecker:()=>uf,CopyHandler:()=>ug,DefaultBlockAppender:()=>Jp,FontSizePicker:()=>Zf,InnerBlocks:()=>ch,Inserter:()=>Xp,InspectorAdvancedControls:()=>Ho,InspectorControls:()=>Go,JustifyContentControl:()=>Cr,JustifyToolbar:()=>Sr,LineHeightControl:()=>Lf,MediaPlaceholder:()=>cy,MediaReplaceFlow:()=>oy,MediaUpload:()=>J_,MediaUploadCheck:()=>ey,MultiSelectScrollIntoView:()=>EE,NavigableToolbar:()=>vm,ObserveTyping:()=>BE,PanelColorSettings:()=>uy,PlainText:()=>Gy,RichText:()=>zy,RichTextShortcut:()=>$y,RichTextToolbarButton:()=>jy,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>uE,ToolSelector:()=>Yy,Typewriter:()=>NE,URLInput:()=>S_,URLInputButton:()=>Jy,URLPopover:()=>iy,Warning:()=>Al,WritingFlow:()=>Tu,__experimentalBlockAlignmentMatrixControl:()=>Pb,__experimentalBlockFullHeightAligmentControl:()=>Tb,__experimentalBlockPatternSetup:()=>yk,__experimentalBlockPatternsList:()=>pp,__experimentalBlockVariationPicker:()=>dk,__experimentalBlockVariationTransforms:()=>Sk,__experimentalBorderRadiusControl:()=>xh,__experimentalColorGradientControl:()=>rf,__experimentalColorGradientSettingsDropdown:()=>cf,__experimentalDateFormatPicker:()=>Nk,__experimentalDuotoneControl:()=>Fv,__experimentalFontAppearanceControl:()=>Pf,__experimentalFontFamilyControl:()=>Gf,__experimentalGetBorderClassesAndStyles:()=>Zv,__experimentalGetColorClassesAndStyles:()=>Xv,__experimentalGetElementClassName:()=>FE,__experimentalGetGapCSSValue:()=>ur,__experimentalGetGradientClass:()=>Kh,__experimentalGetGradientObjectByGradientValue:()=>Yh,__experimentalGetMatchingVariation:()=>zE,__experimentalGetSpacingClassesAndStyles:()=>tb,__experimentalImageEditingProvider:()=>n_,__experimentalImageEditor:()=>p_,__experimentalImageSizeControl:()=>h_,__experimentalImageURLInputUI:()=>sE,__experimentalInspectorPopoverHeader:()=>AE,__experimentalLayoutStyle:()=>rl,__experimentalLetterSpacingControl:()=>bv,__experimentalLibrary:()=>kE,__experimentalLinkControl:()=>Y_,__experimentalLinkControlSearchInput:()=>V_,__experimentalLinkControlSearchItem:()=>I_,__experimentalLinkControlSearchResults:()=>M_,__experimentalListView:()=>nk,__experimentalPanelColorGradientSettings:()=>Dk,__experimentalPreviewOptions:()=>aE,__experimentalPublishDateTimePicker:()=>DE,__experimentalResponsiveBlockControl:()=>Wy,__experimentalTextDecorationControl:()=>iv,__experimentalTextTransformControl:()=>gv,__experimentalUnitControl:()=>Zy,__experimentalUseBlockOverlayActive:()=>Rb,__experimentalUseBlockPreview:()=>Wd,__experimentalUseBorderProps:()=>Qv,__experimentalUseColorProps:()=>eb,__experimentalUseCustomSides:()=>ir,__experimentalUseGradient:()=>Qh,__experimentalUseMultipleOriginColorsAndGradients:()=>Rh,__experimentalUseNoRecursiveRenders:()=>ME,__experimentalUseResizeCanvas:()=>cE,__unstableBlockNameContext:()=>Gg,__unstableBlockSettingsMenuFirstItem:()=>vg,__unstableBlockToolbarLastItem:()=>rg,__unstableDuotoneFilter:()=>Fd,__unstableDuotoneStylesheet:()=>Dd,__unstableDuotoneUnsetStylesheet:()=>Od,__unstableEditorStyles:()=>Rd,__unstableGetValuesFromColors:()=>Ad,__unstableIframe:()=>Lu,__unstableInserterMenuExtension:()=>Hp,__unstablePresetDuotoneFilter:()=>zd,__unstableRichTextInputEvent:()=>Ky,__unstableUseBlockSelectionClearer:()=>gu,__unstableUseClipboardHandler:()=>cg,__unstableUseMouseMoveTypingReset:()=>SE,__unstableUseTypewriter:()=>TE,__unstableUseTypingObserver:()=>wE,createCustomColorsHOC:()=>ib,getColorClassName:()=>Lh,getColorObjectByAttributeValues:()=>Nh,getColorObjectByColorValue:()=>Ph,getFontSize:()=>Kf,getFontSizeClass:()=>Yf,getFontSizeObjectByValue:()=>qf,getGradientSlugByValue:()=>Zh,getGradientValueBySlug:()=>qh,getPxFromCssUnit:()=>YE,store:()=>to,storeConfig:()=>eo,transformStyles:()=>Pd,useBlockDisplayInformation:()=>dm,useBlockEditContext:()=>lo,useBlockProps:()=>Zc,useCachedTruthy:()=>nb,useInnerBlocksProps:()=>ah,useSetting:()=>To,withColorContext:()=>wk,withColors:()=>sb,withFontSizes:()=>cb});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ft,__experimentalGetAllowedBlocks:()=>bt,__experimentalGetAllowedPatterns:()=>Et,__experimentalGetBlockListSettingsForBlocks:()=>xt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>_t,__experimentalGetPatternTransformItems:()=>St,__experimentalGetPatternsByBlockTypes:()=>Ct,__experimentalGetReusableBlockTitle:()=>Tt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetSelectedBlocksWithPartialSelection:()=>Me,__unstableGetVisibleBlocks:()=>Ht,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,areInnerBlocksControlled:()=>Ot,canEditBlock:()=>at,canInsertBlockType:()=>nt,canInsertBlocks:()=>ot,canLockBlockType:()=>ct,canMoveBlock:()=>it,canMoveBlocks:()=>st,canRemoveBlock:()=>rt,canRemoveBlocks:()=>lt,didAutomaticChange:()=>At,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Ae,getBlockInsertionPoint:()=>Ye,getBlockListSettings:()=>wt,getBlockMode:()=>Ge,getBlockName:()=>U,getBlockOrder:()=>Re,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>ft,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ht,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>_e,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>ke,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>Bt,getTemplate:()=>Xe,getTemplateLock:()=>Je,hasBlockMovingClientId:()=>Rt,hasInserterItems:()=>vt,hasMultiSelection:()=>ze,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>Oe,isAncestorBeingDragged:()=>Ke,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>je,isBlockHighlighted:()=>Dt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,isBlockValid:()=>W,isBlockVisible:()=>Vt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>qe,isDraggingBlocks:()=>We,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>It,isMultiSelecting:()=>Ve,isNavigationMode:()=>Mt,isSelectionEnabled:()=>He,isTyping:()=>Ue,isValidTemplate:()=>Qe,wasBlockJustInserted:()=>zt});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>En,__unstableExpandSelection:()=>Sn,__unstableMarkAutomaticChange:()=>Un,__unstableMarkLastChangeAsPersistent:()=>Hn,__unstableMarkNextChangeAsNotPersistent:()=>Gn,__unstableSaveReusableBlock:()=>Vn,__unstableSplitSelection:()=>Cn,clearSelectedBlock:()=>rn,duplicateBlocks:()=>jn,enterFormattedText:()=>Rn,exitFormattedText:()=>An,flashBlock:()=>Zn,hideInsertionPoint:()=>bn,insertAfterBlock:()=>qn,insertBeforeBlock:()=>Kn,insertBlock:()=>hn,insertBlocks:()=>fn,insertDefaultBlock:()=>On,mergeBlocks:()=>wn,moveBlockToPosition:()=>gn,moveBlocksDown:()=>dn,moveBlocksToPosition:()=>mn,moveBlocksUp:()=>pn,multiSelect:()=>on,receiveBlocks:()=>Yt,removeBlock:()=>In,removeBlocks:()=>Bn,replaceBlock:()=>cn,replaceBlocks:()=>an,replaceInnerBlocks:()=>xn,resetBlocks:()=>jt,resetSelection:()=>qt,selectBlock:()=>Xt,selectNextBlock:()=>en,selectPreviousBlock:()=>Jt,selectionChange:()=>Dn,setBlockMovingClientId:()=>$n,setBlockVisibility:()=>Xn,setHasControlledInnerBlocks:()=>Qn,setNavigationMode:()=>Wn,setTemplateValidity:()=>kn,showInsertionPoint:()=>vn,startDraggingBlocks:()=>Ln,startMultiSelect:()=>tn,startTyping:()=>Nn,stopDraggingBlocks:()=>Mn,stopMultiSelect:()=>nn,stopTyping:()=>Pn,synchronizeTemplate:()=>yn,toggleBlockHighlight:()=>Yn,toggleBlockMode:()=>Tn,toggleSelection:()=>ln,updateBlock:()=>Qt,updateBlockAttributes:()=>Zt,updateBlockListSettings:()=>Fn,updateSettings:()=>zn,validateBlocksToTemplate:()=>Kt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={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")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function 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)}const _=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,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=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]: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=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,m.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;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]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,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"SET_BLOCK_VISIBILITY":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}});var L={};function M(e){return[e]}function R(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||M;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(L)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,l)),s.get(L)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!R(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(R(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),F=window.wp.richText,z=window.wp.deprecated;var V=n.n(z);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ot(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Re(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Re(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Re(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Re(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function ke(e){return e.initialPosition}const _e=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=Re(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:_e(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[..._e.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return(0,u.first)(ye(e))||null}function Se(e){return(0,u.last)(ye(e))||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Re(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=j(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=j(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Me=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Re(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,F.create)({html:g,...H(f)}),k=(0,F.create)({html:h,...H(v)});return b=(0,F.remove)(b,0,a.offset),k=(0,F.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,F.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,F.toHTMLString)({value:k,...H(v)})}}]};function Re(e,t){return e.blocks.order[t||""]||G}function Ae(e,t){return Re(e,de(e,t)).indexOf(t)}function De(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Re(e,t),(t=>De(e,t)||Be(e,t)||n&&Oe(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ve(e){return e.isMultiSelecting}function He(e){return e.isSelectionEnabled}function Ge(e,t){return e.blocksMode[t]||"visual"}function Ue(e){return e.isTyping}function We(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function je(e,t){return e.draggedBlocks.includes(t)}function Ke(e,t){if(!We(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>je(e,t)))}function qe(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ye(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=Ae(e,r.clientId)+1):n=Re(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Je(e,t){if(!t)return e.settings.templateLock;const n=wt(e,t);return n?n.templateLock:null}const et=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},tt=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}=Bt(e),s=et(i,t,!0);if(!s)return!1;const a=!!Je(e,o);if(a)return!1;const c=wt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=et(d,t),m=n.parent,g=U(e,o),h=et(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>et(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},nt=A(tt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}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){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:r}=o,l="all"===Je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ct(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ut(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 dt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&tt(e,t.name,n),pt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ut(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:mt(r,l)}},mt=(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)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=ut(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:mt(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=A((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=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=ut(e,l)||{},c=mt(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=>dt(e,n,t))).map(n),a=tt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=pt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),ft=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>dt(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>dt(e,n,t)));if(n)return!0;const o=tt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>dt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),_t=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),yt=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return _t(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!et(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])),Et=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=yt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return nt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Ct=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Et(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)=>[...Et.getDependants(e,t)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ot(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Ct(e,o,n)}),((e,t)=>[...Ct.getDependants(e,t)]));function wt(e,t){return e.blockListSettings[t]}function Bt(e){return e.settings}function It(e){return e.blocks.isPersistentChange}const xt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Tt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Nt(e){return e.blocks.isIgnoredChange}function Pt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Mt(e){return e.isNavigationMode}function Rt(e){return e.hasBlockMovingClientId}function At(e){return!!e.automaticChangeStatus}function Dt(e,t){return e.highlightedBlock===t}function Ot(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ft=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function zt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Vt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ht=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Gt=window.wp.a11y,Ut="†";function Wt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Ut)}))}const $t=e=>Array.isArray(e)?e:[e],jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Kt(e))},Kt=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 qt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Yt(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Zt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:$t(e),attributes:t,uniqueByBlock:n}}function Qt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function tn(){return{type:"START_MULTI_SELECT"}}function nn(){return{type:"STOP_MULTI_SELECT"}}const on=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,Gt.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
- (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function rn(){return{type:"CLEAR_SELECTED_BLOCK"}}function ln(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sn(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 an=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=$t(e),t=sn($t(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function cn(e,t){return an(e,t)}const un=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:$t(t),rootClientId:n})},dn=un("MOVE_BLOCKS_DOWN"),pn=un("MOVE_BLOCKS_UP"),mn=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 gn(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 mn([e],t,n,o)}function hn(e,t,n,o,r){return fn([e],t,n,o,0,r)}const fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=sn($t(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 vn(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 bn(){return{type:"HIDE_INSERTION_POINT"}}function kn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const yn=()=>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)},En=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,r.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.attributes[f.attributeKey];let w=(0,F.create)({html:y,...H(C)}),B=(0,F.create)({html:E,...H(S)});w=(0,F.remove)(w,h.offset,w.text.length),B=(0,F.insert)(B,Ut,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,F.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(k,{[f.attributeKey]:(0,F.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===k.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Wt(P),M=P[L],R=(0,F.create)({html:M,...H(g.attributes[L])}),A=R.text.indexOf(Ut),D=(0,F.remove)(R,A,A+1),O=(0,F.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const z=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Cn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,F.create)({html:f,...H(b)}),y=(0,F.create)({html:v,...H(k)});_=(0,F.remove)(_,u.offset,_.text.length),y=(0,F.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,F.toHTMLString)({value:_,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,F.toHTMLString)({value:y,...H(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},wn=(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),u=(0,r.getBlockType)(c.name);if(u&&!u.merge)return void l.selectBlock(c.clientId);const d=o.getBlock(a),p=(0,r.getBlockType)(d.name),{clientId:m,attributeKey:g,offset:h}=o.getSelectionStart(),f=(m===s?u:p).attributes[g],v=(m===s||m===a)&&void 0!==g&&void 0!==h&&!!f;f||("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 b=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(d);if(v){const e=m===s?b:k,t=e.attributes[g],n=(0,F.insert)((0,F.create)({html:t,...H(f)}),Ut,h,h);e.attributes[g]=(0,F.toHTMLString)({value:n,...H(f)})}const _=c.name===d.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!_||!_.length)return;const y=u.merge(b.attributes,_[0].attributes);if(v){const e=Wt(y),t=y[e],n=(0,F.create)({html:t,...H(u.attributes[e])}),o=n.text.indexOf(Ut),r=(0,F.remove)(n,o,o+1),i=(0,F.toHTMLString)({value:r,...H(u.attributes[e])});y[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},..._.slice(1)],0)},Bn=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=$t(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 In(e,t){return Bn([e],t)}function xn(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 Tn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Nn(){return{type:"START_TYPING"}}function Pn(){return{type:"STOP_TYPING"}}function Ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Mn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Rn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function An(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Dn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const On=(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 Fn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function zn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Vn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Hn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Gn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Un=()=>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"})}))},Wn=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,Gt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Gt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},$n=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,Gt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=$t(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(u,c+1,s,t),u.length>1&&t&&l.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Kn=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)},qn=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 Yn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Zn=e=>async t=>{let{dispatch:n}=t;n(Yn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Yn(e,!1))};function Qn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Jn="core/block-editor",eo={reducer:P,selectors:e,actions:t},to=(0,m.createReduxStore)(Jn,{...eo,persist:["preferences"]});(0,m.registerStore)(Jn,{...eo,persist:["preferences"]});const no={name:"",isSelected:!1},oo=(0,s.createContext)(no),{Provider:ro}=oo;function lo(){return(0,s.useContext)(oo)}function io(){const{isSelected:e,clientId:t,name:n}=lo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(to);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function so(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=io(),{clientId:o}=lo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(to),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{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 ao(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[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 co=so;co.Slot=ao;const uo=e=>(0,s.createElement)(so,i({group:"inline"},e));uo.Slot=e=>(0,s.createElement)(ao,i({group:"inline"},e));const po=co,mo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),fo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function _o(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${ko(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}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,clientId:n}=lo();return(0,m.useSelect)((o=>{if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>xo[e]||e)(e);[...o(to).getBlockParents(n),n].forEach((e=>{const n=o(to).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(to).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(to).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Io[i]?Io[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const 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=io(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{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 Lo=e=>e,Mo=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Mo),Lo);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 Ao(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 Do(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 Oo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(to),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(to),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 Fo(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 zo(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)(Oo,{group:n,label:o},(0,s.createElement)(Fo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Vo=Po;Vo.Slot=zo;const Ho=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Ho.Slot=e=>(0,s.createElement)(zo,i({},e,{__experimentalGroup:"advanced"})),Ho.slotName="InspectorAdvancedControls";const Go=Vo,Uo=window.wp.isShallowEqual;var Wo=n.n(Uo);const $o=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])};function jo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=wo(t),g=wo(null!=n?n:t),h=$o(u),f=(0,s.useMemo)((()=>m&&g===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,g,r]);if(!m||n&&!g)return null;const v={top:m,bottom:g};return(0,s.createElement)(p.Popover,i({ref:h,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:f},o),!l&&o)}function Ko(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.margin)}function qo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!sr(e,"margin");return!Ko(e)||t||n}function Yo(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=ir(n,"margin"),a=i&&i.some((e=>or.includes(e)));return qo(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)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Zo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Qo(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.padding)}function Xo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!sr(e,"padding");return!Qo(e)||t||n}function Jo(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=ir(n,"padding"),a=i&&i.some((e=>or.includes(e)));return Xo(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)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function er(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const tr="spacing",nr=["top","right","bottom","left"],or=["vertical","horizontal"];function rr(e){const t=dr(e),n=Xo(e),o=qo(e),l=lr(e),i=(a=e.name,"web"===s.Platform.OS&&(ar(a)||Qo(a)||Ko(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[tr,"__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)(s.Fragment,null,(0,s.createElement)(Go,{__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,h.__)("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)(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,h.__)("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)(Yo,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,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(pr,e))),!n&&(0,s.createElement)(er,e),!o&&(0,s.createElement)(Zo,e))}const lr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=dr(e),n=Xo(e),o=qo(e);return t&&n&&o};function ir(e,t){var n;const o=(0,r.getBlockSupport)(e,tr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function sr(e,t){const n=ir(e,t);return!(n&&n.some((e=>nr.includes(e)))&&n.some((e=>or.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function ar(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.blockGap)}function cr(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 ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=cr(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}`}function dr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.blockGap");return!ar(e)||t}function pr(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=ir(r,"blockGap"),c=So(n);if(dr(e))return null;const u=a&&a.some((e=>or.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...cr(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=cr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=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,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const mr=(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"})),gr=(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"})),hr={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,h._x)("Align top","Block vertical alignment setting")},center:{icon:gr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:mr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},fr=["top","center","bottom"],vr={isAlternate:!0},br=function(e){let{value:t,onChange:n,controls:o=fr,isCollapsed:r=!0,isToolbar:l}=e;const a=hr[t],c=hr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:vr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...hr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},kr=e=>(0,s.createElement)(br,i({},e,{isToolbar:!1})),_r=e=>(0,s.createElement)(br,i({},e,{isToolbar:!0})),yr={left:mo,center:go,right:ho,"space-between":fo},Er=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?yr[r]:yr.left,d=[{name:"left",icon:mo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Cr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!1})),Sr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!0})),wr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Br={left:"flex-start",right:"flex-end",center:"center"},Ir={top:"flex-start",center:"center",bottom:"flex-end"},xr=["wrap","nowrap"],Tr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Pr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Mr,{layout:t,onChange:n}))),(0,s.createElement)(Lr,{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)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Nr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Do(i,"spacing","blockGap")?ur(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap):void 0,d=wr[r.justifyContent],p=xr.includes(r.flexWrap)?r.flexWrap:"wrap",m=Ir[r.verticalAlignment],g=Br[r.justifyContent]||Br.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${ko(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=_o(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Nr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=Ir.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(kr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Pr(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)(Cr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,h.__)("Justify items left")},{value:"center",icon:go,label:(0,h.__)("Justify items center")},{value:"right",icon:ho,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Lr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Mr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const Rr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Ar=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),Or="var:";function Fr(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:Vr(r)}]:[]}function zr(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=Vr((0,u.get)(l,[n]));return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",Hr(n)),value:r}),e}),[]);i.push(...e)}return i}function Vr(e){return"string"==typeof e&&e.startsWith(Or)?`var(--wp--${e.slice(Or.length).split("|").join("--")})`:e}function Hr(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const Gr={name:"radius",generate:(e,t)=>zr(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Ur=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return Fr(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return Fr(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return Fr(e,t,n,o)}}],Wr=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?Ur.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${Hr(e)}${Hr(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},$r={name:"borderTop",generate:Wr("top")},jr={name:"borderRight",generate:Wr("right")},Kr={name:"borderBottom",generate:Wr("bottom")},qr={name:"borderLeft",generate:Wr("left")},Yr=[...Ur,Gr,$r,jr,Kr,qr,{name:"text",generate:(e,t)=>Fr(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>Fr(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>Fr(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>zr(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>zr(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontSize",generate:(e,t)=>Fr(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>Fr(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>Fr(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>Fr(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>Fr(e,t,["typography","textTransform"],"textTransform")}];function Zr(e,t){const n=Qr(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,u.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const o=(0,u.groupBy)(n,"selector");return Object.keys(o).reduce(((e,t)=>(e.push(`${t} { ${o[t].map((e=>`${(0,u.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Qr(e,t){const n=[];return Yr.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const Xr=[{name:"default",label:(0,h.__)("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,h.__)("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)(Rr,{icon:Ar})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Rr,{icon:Dr}))),(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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u}=r,d=cr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),p=null!=d&&d.top&&!Do(i,"spacing","blockGap")?null==d?void 0:d.top:"";let m=c||u?`\n\t\t\t\t\t${ko(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: 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(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&Qr(l).forEach((e=>{"paddingRight"===e.key?m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&p&&(m+=_o(o,a,"default",p)),m},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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
- o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}(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}},Tr];function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Xr.find((t=>t.name===e))}const el={type:"default"},tl=(0,s.createContext)(el),nl=tl.Provider;function ol(){return(0,s.useContext)(tl)}function rl(e){let{layout:t={},css:n,...o}=e;const r=Jr(t.type),l=null!==To("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const ll=["none","left","center","right","wide","full"],il=["wide","full"];function sl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=ol(),r=Jr(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=ll}=o,s=e.filter((e=>(o.alignments||t||!il.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const al=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),cl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),ul=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),dl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),pl={none:{icon:al,title:(0,h._x)("None","Alignment option")},left:{icon:cl,title:(0,h.__)("Align left")},center:{icon:Ar,title:(0,h.__)("Align center")},right:{icon:ul,title:(0,h.__)("Align right")},wide:{icon:Dr,title:(0,h.__)("Wide width")},full:{icon:dl,title:(0,h.__)("Full width")}},ml={isAlternate:!0},gl=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=sl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=pl[t],m=pl.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:ml,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...pl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{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}=pl[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)(g,i({},f,v))},hl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!1})),fl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!0})),vl=["left","center","right","wide","full"],bl=["wide","full"];function kl(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)?vl.filter((t=>e.includes(t))):!0===e?[...vl]:[],!o||!0===e&&!n?(0,u.without)(t,...bl):t}const _l=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=sl(kl((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)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(hl,{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"),yl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=sl(kl((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:[...vl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",yl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",_l),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return kl((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 El=/[\s#]/g,Cl={type:"string",source:"attribute",attribute:"id",selector:"*"},Sl=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(El,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Go,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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:Cl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Sl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const wl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:wl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Bl=(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)(Go,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Bl),(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 Il=window.wp.dom,xl=(0,s.createContext)({});function Tl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(xl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(xl.Provider,{value:r,children:n})}const Nl=xl,Pl={},Ll=(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):Pl),[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 Ml(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(ro,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Ll,e))}const Rl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Al=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:Rl,label:(0,h.__)("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))))))))))};var Dl=n(1973);function Ol(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,Il.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const Fl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,Dl.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Ol,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Ol,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},zl=e=>(0,r.rawHandler)({HTML:e.originalContent}),Vl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(to).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(to);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,zl(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)),[]),g=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
  title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Al,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
- (0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Fl,{block:i,onKeep:t,onConvert:n,convertor:zl,convertButtonText:(0,h.__)("Convert to Blocks")})))})),Hl=(0,s.createElement)(Al,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),Gl=()=>Hl;class Ul extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Wl=Ul;var $l=n(773);const jl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(to).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)($l.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=ci();const ql=e=>li(e,Kl);let Yl=ci();ql.write=e=>li(e,Yl);let Zl=ci();ql.onStart=e=>li(e,Zl);let Ql=ci();ql.onFrame=e=>li(e,Ql);let Xl=ci();ql.onFinish=e=>li(e,Xl);let Jl=[];ql.setTimeout=(e,t)=>{let n=ql.now()+t,o=()=>{let e=Jl.findIndex((e=>e.cancel==o));~e&&Jl.splice(e,1),oi-=~e?1:0},r={time:n,handler:e,cancel:o};return Jl.splice(ei(n),0,r),oi+=1,ii(),r};let ei=e=>~(~Jl.findIndex((t=>t.time>e))||~Jl.length);ql.cancel=e=>{Zl.delete(e),Ql.delete(e),Kl.delete(e),Yl.delete(e),Xl.delete(e)},ql.sync=e=>{ri=!0,ql.batchedUpdates(e),ri=!1},ql.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ql.onStart(n)}return o.handler=e,o.cancel=()=>{Zl.delete(n),t=null},o};let ti="undefined"!=typeof window?window.requestAnimationFrame:()=>{};ql.use=e=>ti=e,ql.now="undefined"!=typeof performance?()=>performance.now():Date.now,ql.batchedUpdates=e=>e(),ql.catch=console.error,ql.frameLoop="always",ql.advance=()=>{"demand"!==ql.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ai()};let ni=-1,oi=0,ri=!1;function li(e,t){ri?(t.delete(e),e(0)):(t.add(e),ii())}function ii(){ni<0&&(ni=0,"demand"!==ql.frameLoop&&ti(si))}function si(){~ni&&(ti(si),ql.batchedUpdates(ai))}function ai(){let e=ni;ni=ql.now();let t=ei(ni);t&&(ui(Jl.splice(0,t),(e=>e.handler())),oi-=t),Zl.flush(),Kl.flush(e?Math.min(64,ni-e):16.667),Ql.flush(),Yl.flush(),Xl.flush(),oi||(ni=-1)}function ci(){let e=new Set,t=e;return{add(n){oi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(oi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,oi-=t.size,ui(t,(t=>t(n)&&e.add(t))),oi+=e.size,t=e)}}}function ui(e,t){e.forEach((e=>{try{t(e)}catch(e){ql.catch(e)}}))}var di=n(9196),pi=n.n(di);function mi(){}const gi={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 hi(e,t){if(gi.arr(e)){if(!gi.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 fi=(e,t)=>e.forEach(t);function vi(e,t,n){if(gi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const bi=e=>gi.und(e)?[]:gi.arr(e)?e:[e];function ki(e,t){if(e.size){const n=Array.from(e);e.clear(),fi(n,t)}}const _i=(e,...t)=>ki(e,(e=>e(...t))),yi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Ei,Ci,Si=null,wi=!1,Bi=mi;var Ii=Object.freeze({__proto__:null,get createStringInterpolator(){return Ei},get to(){return Ci},get colors(){return Si},get skipAnimation(){return wi},get willAdvance(){return Bi},assign:e=>{e.to&&(Ci=e.to),e.now&&(ql.now=e.now),void 0!==e.colors&&(Si=e.colors),null!=e.skipAnimation&&(wi=e.skipAnimation),e.createStringInterpolator&&(Ei=e.createStringInterpolator),e.requestAnimationFrame&&ql.use(e.requestAnimationFrame),e.batchedUpdates&&(ql.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Bi=e.willAdvance),e.frameLoop&&(ql.frameLoop=e.frameLoop)}});const xi=new Set;let Ti=[],Ni=[],Pi=0;const Li={get idle(){return!xi.size&&!Ti.length},start(e){Pi>e.priority?(xi.add(e),ql.onStart(Mi)):(Ri(e),ql(Di))},advance:Di,sort(e){if(Pi)ql.onFrame((()=>Li.sort(e)));else{const t=Ti.indexOf(e);~t&&(Ti.splice(t,1),Ai(e))}},clear(){Ti=[],xi.clear()}};function Mi(){xi.forEach(Ri),xi.clear(),ql(Di)}function Ri(e){Ti.includes(e)||Ai(e)}function Ai(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 Di(e){const t=Ni;for(let n=0;n<Ti.length;n++){const o=Ti[n];Pi=o.priority,o.idle||(Bi(o),o.advance(e),o.idle||t.push(o))}return Pi=0,Ni=Ti,Ni.length=0,Ti=t,Ti.length>0}const Oi="[-+]?\\d*\\.?\\d+",Fi=Oi+"%";function zi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Vi=new RegExp("rgb"+zi(Oi,Oi,Oi)),Hi=new RegExp("rgba"+zi(Oi,Oi,Oi,Oi)),Gi=new RegExp("hsl"+zi(Oi,Fi,Fi)),Ui=new RegExp("hsla"+zi(Oi,Fi,Fi,Oi)),Wi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,$i=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ji=/^#([0-9a-fA-F]{6})$/,Ki=/^#([0-9a-fA-F]{8})$/;function qi(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=qi(r,o,e+1/3),i=qi(r,o,e),s=qi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Zi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Qi(e){return(parseFloat(e)%360+360)%360/360}function Xi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ji(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function es(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ji.exec(e))?parseInt(t[1]+"ff",16)>>>0:Si&&void 0!==Si[e]?Si[e]:(t=Vi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|255)>>>0:(t=Hi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|Xi(t[4]))>>>0:(t=Wi.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=$i.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Gi.exec(e))?(255|Yi(Qi(t[1]),Ji(t[2]),Ji(t[3])))>>>0:(t=Ui.exec(e))?(Yi(Qi(t[1]),Ji(t[2]),Ji(t[3]))|Xi(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 ts=(e,t,n)=>{if(gi.fun(e))return e;if(gi.arr(e))return ts({range:e,output:t,extrapolate:n});if(gi.str(e.output[0]))return Ei(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 ns(){return(ns=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 os=Symbol.for("FluidValue.get"),rs=Symbol.for("FluidValue.observers"),ls=e=>Boolean(e&&e[os]),is=e=>e&&e[os]?e[os]():e,ss=e=>e[rs]||null;function as(e,t){let n=e[rs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class cs{constructor(e){if(this[os]=void 0,this[rs]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");us(this,e)}}const us=(e,t)=>ms(e,os,t);function ds(e,t){if(e[os]){let n=e[rs];n||ms(e,rs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ps(e,t){let n=e[rs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[rs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ms=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),gs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fs=new RegExp(`(${gs.source})(%|[a-z]+)`,"i"),vs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ks=e=>{const[t,n]=_s(e);if(!t||yi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&bs.test(n)?ks(n):n||e},_s=e=>{const t=bs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let ys;const Es=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Cs=e=>{ys||(ys=Si?new RegExp(`(${Object.keys(Si).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>is(e).replace(bs,ks).replace(hs,es).replace(ys,es))),n=t.map((e=>e.match(gs).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=>ts(ns({},e,{output:t}))));return e=>{var n;const r=!fs.test(t[0])&&(null==(n=t.find((e=>fs.test(e))))?void 0:n.replace(gs,""));let l=0;return t[0].replace(gs,(()=>`${o[l++](e)}${r||""}`)).replace(vs,Es)}},Ss="react-spring: ",ws=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ss}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Bs=ws(console.warn),Is=ws(console.warn);function xs(e){return gi.str(e)&&("#"==e[0]||/\d/.test(e)||!yi()&&bs.test(e)||e in(Si||{}))}const Ts="undefined"!=typeof window&&window.document&&window.document.createElement?di.useLayoutEffect:di.useEffect;function Ns(){const e=(0,di.useState)()[1],t=(()=>{const e=(0,di.useRef)(!1);return Ts((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ps=e=>(0,di.useEffect)(e,Ls),Ls=[];function Ms(e){const t=(0,di.useRef)();return(0,di.useEffect)((()=>{t.current=e})),t.current}const Rs=Symbol.for("Animated:node"),As=e=>e&&e[Rs],Ds=(e,t)=>{return n=e,o=Rs,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Os=e=>e&&e[Rs]&&e[Rs].getPayload();class Fs{constructor(){this.payload=void 0,Ds(this,this)}getPayload(){return this.payload||[]}}class zs extends Fs{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,gi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new zs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return gi.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,gi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Vs extends zs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ts({output:[e,e]})}static create(e){return new Vs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(gi.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=ts({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Hs={dependencies:null};class Gs extends Fs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return vi(this.source,((n,o)=>{var r;(r=n)&&r[Rs]===r?t[o]=n.getValue(e):ls(n)?t[o]=is(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&fi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return vi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Hs.dependencies&&ls(e)&&Hs.dependencies.add(e);const t=Os(e);t&&fi(t,(e=>this.add(e)))}}class Us extends Gs{constructor(e){super(e)}static create(e){return new Us(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(Ws)),!0)}}function Ws(e){return(xs(e)?Vs:zs).create(e)}function $s(e){const t=As(e);return t?t.constructor:gi.arr(e)?Us:xs(e)?Vs:zs}function js(){return(js=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 Ks=(e,t)=>{const n=!gi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,di.forwardRef)(((o,r)=>{const l=(0,di.useRef)(null),i=n&&(0,di.useCallback)((e=>{l.current=function(e,t){return e&&(gi.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Hs.dependencies=n,e.style&&(e=js({},e,{style:t.createAnimatedStyle(e.style)})),e=new Gs(e),Hs.dependencies=null,[e,n]}(o,t),c=Ns(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new qs(u,a),p=(0,di.useRef)();Ts((()=>(p.current=d,fi(a,(e=>ds(e,d))),()=>{p.current&&(fi(p.current.deps,(e=>ps(e,p.current))),ql.cancel(p.current.update))}))),(0,di.useEffect)(u,[]),Ps((()=>()=>{const e=p.current;fi(e.deps,(t=>ps(t,e)))}));const m=t.getComponentProps(s.getValue());return di.createElement(e,js({},m,{ref:i}))}))};class qs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ql.write(this.update)}}const Ys=Symbol.for("AnimatedComponent"),Zs=e=>gi.str(e)?e:e&&gi.str(e.displayName)?e.displayName:gi.fun(e)&&e.name||null;function Qs(){return(Qs=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 Xs(e,...t){return gi.fun(e)?e(...t):e}const Js=(e,t)=>!0===e||!!(t&&e&&(gi.fun(e)?e(t):bi(e).includes(t))),ea=(e,t)=>gi.obj(e)?t&&e[t]:e,ta=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,na=e=>e,oa=(e,t=na)=>{let n=ra;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);gi.und(n)||(o[r]=n)}return o},ra=["config","onProps","onStart","onChange","onPause","onResume","onRest"],la={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 ia(e){const t=function(e){const t={};let n=0;if(vi(e,((e,o)=>{la[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return vi(e,((e,o)=>o in t||(n[o]=e))),n}return Qs({},e)}function sa(e){return e=is(e),gi.arr(e)?e.map(sa):xs(e)?Ii.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function aa(e){for(const t in e)return!0;return!1}function ca(e){return gi.fun(e)||gi.arr(e)&&gi.obj(e[0])}function ua(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function da(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const pa=Qs({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class ma{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,pa)}}function ga(e,t){if(gi.und(t.decay)){const n=!gi.und(t.tension)||!gi.und(t.friction);!n&&gi.und(t.frequency)&&gi.und(t.damping)&&gi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ha=[];class fa{constructor(){this.changed=!1,this.values=ha,this.toValues=null,this.fromValues=ha,this.to=void 0,this.from=void 0,this.config=new ma,this.immediate=!1}}function va(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Js(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{gi.und(n.pause)||(r.paused=Js(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Js(e,t)),c=Xs(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-ql.now()}function m(){c>0&&!Ii.skipAnimation?(r.delayed=!0,u=ql.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Qs({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const ba=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ya(e.get()):t.every((e=>e.noop))?ka(e.get()):_a(e.get(),t.every((e=>e.finished))),ka=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),_a=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ya=e=>({value:e,cancelled:!0,finished:!1});function Ea(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=oa(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)&&ya(o)||r!==n.asyncId&&_a(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Sa,i=new wa;return(async()=>{if(Ii.skipAnimation)throw Ca(n),i.result=_a(o,!1),d(i),i;m(l);const s=gi.obj(e)?Qs({},e):Qs({},t,{to:e});s.parentId=r,vi(c,((e,t)=>{gi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Ii.skipAnimation)return Ca(n),_a(o,!1);try{let t;t=gi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=_a(o.get(),!0,!1)}catch(e){if(e instanceof Sa)h=e.result;else{if(!(e instanceof wa))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return gi.fun(i)&&ql.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Ca(e,t){ki(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Sa 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 wa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ba=e=>e instanceof xa;let Ia=1;class xa extends cs{constructor(...e){super(...e),this.id=Ia++,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=As(this);return e&&e.getValue()}to(...e){return Ii.to(this,e)}interpolate(...e){return Bs(`${Ss}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ii.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){as(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Li.sort(this),as(this,{type:"priority",parent:this,priority:e})}}const Ta=Symbol.for("SpringPhase"),Na=e=>(1&e[Ta])>0,Pa=e=>(2&e[Ta])>0,La=e=>(4&e[Ta])>0,Ma=(e,t)=>t?e[Ta]|=3:e[Ta]&=-3,Ra=(e,t)=>t?e[Ta]|=4:e[Ta]&=-5;class Aa extends xa{constructor(e,t){if(super(),this.key=void 0,this.animation=new fa,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!gi.und(e)||!gi.und(t)){const n=gi.obj(e)?Qs({},e):Qs({},t,{from:e});gi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Pa(this)||this._state.asyncTo)||La(this)}get goal(){return is(this.animation.to)}get velocity(){const e=As(this);return e instanceof zs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Na(this)}get isAnimating(){return Pa(this)}get isPaused(){return La(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=Os(o.to);!i&&ls(o.to)&&(l=bi(is(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Vs?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=gi.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(gi.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=!gi.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=As(this),a=s.getValue();if(t){const e=is(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 ql.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Pa(this)){const{to:e,config:t}=this.animation;ql.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 gi.und(e)?(n=this.queue||[],this.queue=[]):n=[gi.obj(e)?e:Qs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>ba(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ca(this._state,e&&this._lastCallId),ql.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=gi.obj(n)?n[t]:n,(null==n||ca(n))&&(n=void 0),o=gi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Na(this)||(e.reverse&&([n,o]=[o,n]),o=is(o),gi.und(o)?As(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Qs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,oa(n,((e,t)=>/^on/.test(t)?ea(e,o):e))),Ga(this,n,"onProps"),Ua(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 va(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{La(this)||(Ra(this,!0),_i(i.pauseQueue),Ua(this,"onPause",_a(this,Da(this,this.animation.to)),this))},resume:()=>{La(this)&&(Ra(this,!1),Pa(this)&&this._resume(),_i(i.resumeQueue),Ua(this,"onResume",_a(this,Da(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Oa(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ya(this));const o=!gi.und(e.to),r=!gi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ya(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&&!gi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!hi(d,c);p&&(s.from=d),d=is(d);const m=!hi(u,a);m&&this._focus(u);const g=ca(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(ga(n=Qs({},n),t),t=Qs({},n,t)),ga(e,t),Object.assign(e,t);for(const t in pa)null==e[t]&&(e[t]=pa[t]);let{mass:o,frequency:r,damping:l}=e;gi.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,Xs(t.config,l),t.config!==i.config?Xs(i.config,l):void 0);let b=As(this);if(!b||gi.und(u))return n(_a(this,!0));const k=gi.und(t.reset)?r&&!t.default:!gi.und(d)&&Js(t.reset,l),_=k?d:this.get(),y=sa(u),E=gi.num(y)||gi.arr(y)||xs(y),C=!g&&(!E||Js(i.immediate||t.immediate,l));if(m){const e=$s(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=ls(u),B=!1;if(!w){const e=k||!Na(this)&&p;(m||e)&&(B=hi(sa(_),y),w=!B),(hi(s.immediate,C)||C)&&hi(h.decay,f)&&hi(h.velocity,v)||(w=!0)}if(B&&Pa(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||ls(a))&&(s.values=b.getPayload(),s.toValues=ls(u)?null:S==Vs?[1]:bi(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;fi(Ha,(e=>Ga(this,t,e)));const o=_a(this,Da(this,a));_i(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&ql.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Xs(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(Ea(t.to,t,this._state,this)):w?this._start():Pa(this)&&!m?this._pendingCalls.add(n):n(ka(_))}_focus(e){const t=this.animation;e!==t.to&&(ss(this)&&this._detach(),t.to=e,ss(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ls(t)&&(ds(t,this),Ba(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ls(e)&&ps(e,this)}_set(e,t=!0){const n=is(e);if(!gi.und(n)){const e=As(this);if(!e||!hi(n,e.getValue())){const o=$s(n);e&&e.constructor==o?e.setValue(n):Ds(this,o.create(n)),e&&ql.batchedUpdates((()=>{this._onChange(n,t)}))}}return As(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ua(this,"onStart",_a(this,Da(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Xs(this.animation.onChange,e,this)),Xs(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;As(this).reset(is(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Pa(this)||(Ma(this,!0),La(this)||this._resume())}_resume(){Ii.skipAnimation?this.finish():Li.start(this)}_stop(e,t){if(Pa(this)){Ma(this,!1);const n=this.animation;fi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),as(this,{type:"idle",parent:this});const o=t?ya(this.get()):_a(this.get(),Da(this,null!=e?e:n.to));_i(this._pendingCalls,o),n.changed&&(n.changed=!1,Ua(this,"onRest",o,this))}}}function Da(e,t){const n=sa(t);return hi(sa(e.get()),n)}function Oa(e,t=e.loop,n=e.to){let o=Xs(t);if(o){const r=!0!==o&&ia(o),l=(r||e).reverse,i=!r||r.reset;return Fa(Qs({},e,{loop:t,default:!1,pause:void 0,to:!l||ca(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Fa(e){const{to:t,from:n}=e=ia(e),o=new Set;return gi.obj(t)&&Va(t,o),gi.obj(n)&&Va(n,o),e.keys=o.size?Array.from(o):null,e}function za(e){const t=Fa(e);return gi.und(t.default)&&(t.default=oa(t)),t}function Va(e,t){vi(e,((e,n)=>null!=e&&t.add(n)))}const Ha=["onStart","onRest","onChange","onPause","onResume"];function Ga(e,t,n){e.animation[n]=t[n]!==ta(t,n)?ea(t[n],e.key):void 0}function Ua(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 Wa=["onStart","onChange","onRest"];let $a=1;class ja{constructor(e,t){this.id=$a++,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(Qs({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];gi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Fa(e)),this}start(e){let{queue:t}=this;return e?t=bi(e).map(Fa):this.queue=[],this._flush?this._flush(this,t):(Ja(this,t),Ka(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;fi(bi(t),(t=>n[t].stop(!!e)))}else Ca(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(gi.und(e))this.start({pause:!0});else{const t=this.springs;fi(bi(e),(e=>t[e].pause()))}return this}resume(e){if(gi.und(e))this.start({pause:!1});else{const t=this.springs;fi(bi(e),(e=>t[e].resume()))}return this}each(e){vi(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,ki(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&&ki(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,ki(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)}ql.onFrame(this._onFrame)}}function Ka(e,t){return Promise.all(t.map((t=>qa(e,t)))).then((t=>ba(e,t)))}async function qa(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=gi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=gi.arr(r)||gi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):fi(Wa,(n=>{const o=t[n];if(gi.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,_i(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===ta(t,"cancel");(u||m&&d.asyncId)&&p.push(va(++e._lastAsyncId,{props:t,state:d,actions:{pause:mi,resume:mi,start(t,n){m?(Ca(d,e._lastAsyncId),n(ya(e))):(t.onRest=s,n(Ea(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=ba(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Oa(t,i,r);if(n)return Ja(e,[n]),qa(e,n,!0)}return a&&ql.batchedUpdates((()=>a(g,e,e.item))),g}function Ya(e,t){const n=Qs({},e.springs);return t&&fi(bi(t),(e=>{gi.und(e.keys)&&(e=Fa(e)),gi.obj(e.to)||(e=Qs({},e,{to:void 0})),Xa(n,e,(e=>Qa(e)))})),Za(e,n),n}function Za(e,t){vi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,ds(t,e))}))}function Qa(e,t){const n=new Aa;return n.key=e,t&&ds(n,t),n}function Xa(e,t,n){t.keys&&fi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ja(e,t){fi(t,(t=>{Xa(e.springs,t,(t=>Qa(t,e)))}))}const ec=["children"],tc=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,ec);const o=(0,di.useContext)(nc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,di.useState)((()=>({inputs:t,result:e()}))),o=(0,di.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,di.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=nc;return di.createElement(i,{value:n},t)},nc=(oc=tc,rc={},Object.assign(oc,di.createContext(rc)),oc.Provider._context=oc,oc.Consumer._context=oc,oc);var oc,rc;tc.Provider=nc.Provider,tc.Consumer=nc.Consumer;const lc=()=>{const e=[],t=function(t){Is(`${Ss}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 fi(e,((e,r)=>{if(gi.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 fi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return fi(e,(e=>e.resume(...arguments))),this},t.set=function(t){fi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return fi(e,((e,o)=>{if(gi.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 fi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return fi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return gi.fun(e)?e(n,t):e};return t._getProps=n,t};function ic(e,t,n){const o=gi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,di.useMemo)((()=>o||3==arguments.length?lc():void 0),[]),l=(0,di.useRef)(0),i=Ns(),s=(0,di.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ya(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ka(e,t):new Promise((o=>{Za(e,n),s.queue.push((()=>{o(Ka(e,t))})),i()}))}})),[]),a=(0,di.useRef)([...s.ctrls]),c=[],u=Ms(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ja(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=za(n))}}(0,di.useMemo)((()=>{fi(a.current.slice(e,u),(e=>{ua(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,di.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ya(e,c[t]))),m=(0,di.useContext)(tc),g=Ms(m),h=m!==g&&aa(m);Ts((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],fi(e,(e=>e()))),fi(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(da(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ps((()=>()=>{fi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>Qs({},e)));return r?[f,r]:f}let sc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(sc||(sc={}));class ac extends xa{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ts(...t);const n=this._get(),o=$s(n);Ds(this,o.create(n))}advance(e){const t=this._get();hi(t,this.get())||(As(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&uc(this._active)&&dc(this)}_get(){const e=gi.arr(this.source)?this.source.map(is):bi(is(this.source));return this.calc(...e)}_start(){this.idle&&!uc(this._active)&&(this.idle=!1,fi(Os(this),(e=>{e.done=!1})),Ii.skipAnimation?(ql.batchedUpdates((()=>this.advance())),dc(this)):Li.start(this))}_attach(){let e=1;fi(bi(this.source),(t=>{ls(t)&&ds(t,this),Ba(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){fi(bi(this.source),(e=>{ls(e)&&ps(e,this)})),this._active.clear(),dc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=bi(this.source).reduce(((e,t)=>Math.max(e,(Ba(t)?t.priority:0)+1)),0))}}function cc(e){return!1!==e.idle}function uc(e){return!e.size||Array.from(e).every(cc)}function dc(e){e.idle||(e.idle=!0,fi(Os(e),(e=>{e.done=!0})),as(e,{type:"idle",parent:e}))}Ii.assign({createStringInterpolator:Cs,to:(e,t)=>new ac(e,t)}),Li.advance;const pc=window.ReactDOM;function mc(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 gc=["style","children","scrollTop","scrollLeft"],hc=/^--/;function fc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||hc.test(e)||bc.hasOwnProperty(e)&&bc[e]?(""+t).trim():t+"px"}const vc={};let bc={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 kc=["Webkit","Ms","Moz","O"];bc=Object.keys(bc).reduce(((e,t)=>(kc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),bc);const _c=["x","y","z"],yc=/^(matrix|translate|scale|rotate|skew)/,Ec=/^(translate)/,Cc=/^(rotate|skew)/,Sc=(e,t)=>gi.num(e)&&0!==e?e+t:e,wc=(e,t)=>gi.arr(e)?e.every((e=>wc(e,t))):gi.num(e)?e===t:parseFloat(e)===t;class Bc extends Gs{constructor(e){let{x:t,y:n,z:o}=e,r=mc(e,_c);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Sc(e,"px"))).join(",")})`,wc(e,0)]))),vi(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(yc.test(t)){if(delete r[t],gi.und(e))return;const n=Ec.test(t)?"px":Cc.test(t)?"deg":"";l.push(bi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Sc(r,n)})`,wc(r,0)]:e=>[`${t}(${e.map((e=>Sc(e,n))).join(",")})`,wc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ic(l,i)),super(r)}}class Ic extends cs{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 fi(this.inputs,((n,o)=>{const r=is(n[0]),[l,i]=this.transforms[o](gi.arr(r)?r:n.map(is));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ds(e,this)))))}observerRemoved(e){0==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ps(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),as(this,e)}}const xc=["scrollTop","scrollLeft"];Ii.assign({batchedUpdates:pc.unstable_batchedUpdates,createStringInterpolator:Cs,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 Tc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Gs(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zs(e)||"Anonymous";return(e=gi.str(e)?l[e]||(l[e]=Ks(e,r)):e[Ys]||(e[Ys]=Ks(e,r))).displayName=`Animated(${t})`,e};return vi(e,((t,n)=>{gi.arr(e)&&(n=Zs(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=mc(o,gc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:vc[t]||(vc[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=fc(t,r[t]);hc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Bc(e),getComponentProps:e=>mc(e,xc)}).animated,Nc=e=>e+1,Pc=e=>({top:e.offsetTop,left:e.offsetLeft}),Lc=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)(Nc,0),[u,p]=(0,s.useReducer)(Nc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?Pc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Il.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",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=Pc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=gi.fun(e),[[o],r]=ic(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},Mc=".block-editor-block-list__block",Rc=".block-list-appender",Ac=".block-editor-button-block-appender";function Dc(e,t){return t.closest([Mc,Rc,Ac].join(","))===e}function Oc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Mc);return t?t.id.slice("block-".length):void 0}function Fc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(to);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(to);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=Il.focus.tabbable.find(t.current).filter((e=>(0,Il.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(Dc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Il.focus.tabbable.findNext(t.current);if(e&&Dc(t.current,e)&&(0,Il.isFormElement)(e))return void e.focus()}(0,Il.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function zc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Vc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(to);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",zc),t.addEventListener("mouseover",zc),()=>{t.removeEventListener("mouseout",zc),t.removeEventListener("mouseover",zc),t.classList.remove("is-hovered")}}),[e])}function Hc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p}=t(to),{outlineMode:m}=a(),g=n(e),h=l(e),f=s(e),v=u(e,!0),b=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":b,"is-partially-selected":b&&!p(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(f)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&m&&d()})}),[e])}function Gc(e){return(0,m.useSelect)((t=>{const n=t(to).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Uc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(to),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 Wc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(to);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 $c(e){const{isBlockSelected:t}=(0,m.useSelect)(to),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Dc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const jc=window.wp.keycodes;function Kc(e){const t=(0,m.useSelect)((t=>t(to).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(to),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(to);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!==jc.ENTER&&s!==jc.BACKSPACE&&s!==jc.DELETE||a!==i||(0,Il.isTextField)(a)||(t.preventDefault(),s===jc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function qc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(to),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(to);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 Yc(){const e=(0,s.useContext)(dh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Zc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Qc),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(to),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,Fc(o),Co(o),$c(o),Kc(o),qc(o),Vc(),Yc(),Lc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=lo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Hc(o),Gc(o),Uc(o),Wc(o)),style:{...i.style,...e.style}}}Zc.save=r.__unstableGetBlockProps;const Qc=(0,s.createContext)();function Xc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Zc(o,{__unstableIsHtml:n}),t)}const Jc=(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(to),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),eu=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(to);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(to),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(to),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(to);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)}}})),tu=(0,d.compose)(d.pure,Jc,eu,(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:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(to),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(Ml,{name:h,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)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,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)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Xc,{isHtml:!0},(0,s.createElement)(jl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Xc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Vl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Il.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Qc.Provider,{value:L},(0,s.createElement)(Wl,{fallback:(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Gl,null))},N))})),nu=window.wp.htmlEntities,ou=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),ru=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],lu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*ru.length));return(0,s.createElement)(p.Tip,null,ru[e])},iu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),su=(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:iu});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)})),au=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(su,{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)))},cu=(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(Jn,eo),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),uu=()=>{};function du(e){let{clientId:t=null,value:n,selection:o,onChange:l=uu,onInput:i=uu}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(to),{getBlockName:f,getBlocks:v}=a.select(to),b=(0,m.useSelect)((e=>!t||e(to).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),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(to);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(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])}const pu=cu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o(n)}),[n]),du(e),(0,s.createElement)(Eo,null,t)}));function mu(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)(mh,null)))}function gu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(to),{clearSelectedBlock:n}=(0,m.useDispatch)(to);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 hu(e){return(0,s.createElement)("div",i({ref:gu()},e))}function fu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(to);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function vu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(fu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,s.getSelection().removeAllRanges(),r.focus())}),[o,t,n,r,e,l])}function bu(e,t,n,o){let r,l=Il.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Il.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function ku(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getSettings:l,hasMultiSelection:i,__unstableIsFullySelected:s}=(0,m.useSelect)(to),{selectBlock:a}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((c=>{let u;function d(){u=null}function p(d){const{keyCode:p,target:m}=d,g=p===jc.UP,h=p===jc.DOWN,f=p===jc.LEFT,v=p===jc.RIGHT,b=g||f,k=f||v,_=g||h,y=k||_,E=d.shiftKey,C=E||d.ctrlKey||d.altKey||d.metaKey,S=_?Il.isVerticalEdge:Il.isHorizontalEdge,{ownerDocument:w}=c,{defaultView:B}=w;if(i()){if(!s())return;if(d.defaultPrevented)return;if(!y)return;if(E)return;return d.preventDefault(),void(b?a(t()):a(n(),-1))}if(_?u||(u=(0,Il.computeCaretRect)(B)):u=null,d.defaultPrevented)return;if(!y)return;if(!function(e,t,n){if((t===jc.UP||t===jc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(m,p,C))return;const I=(0,Il.isRTL)(m)?!b:b,{keepCaretInsideBlock:x}=l(),T=e();if(E){const e=n(),t=o(e||T),l=r(e||T);(b&&t||!b&&l)&&function(e,t){const n=bu(e,t,c);return!n||!function(e,t){return e.closest(Mc)===t.closest(Mc)}(e,n)}(m,b)&&S(m,b)&&(c.contentEditable=!0,c.focus())}else if(_&&(0,Il.isVerticalEdge)(m,b)&&!x){const e=bu(m,b,c,!0);e&&((0,Il.placeCaretAtVerticalEdge)(e,b,u),d.preventDefault())}else if(k&&B.getSelection().isCollapsed&&(0,Il.isHorizontalEdge)(m,I)&&!x){const e=bu(m,I,c);(0,Il.placeCaretAtHorizontalEdge)(e,b),d.preventDefault()}}return c.addEventListener("mousedown",d),c.addEventListener("keydown",p),()=>{c.removeEventListener("mousedown",d),c.removeEventListener("keydown",p)}}),[])}const _u=window.wp.keyboardShortcuts;function yu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(to),{multiSelect:o}=(0,m.useDispatch)(to),r=(0,_u.__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,Il.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 Eu(e,t){e.contentEditable=t,t&&e.focus()}function Cu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(to),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(to);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;Eu(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),Eu(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function Su(e,t){e.contentEditable=t,t&&e.focus()}function wu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(to),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Su(n,!1);let c=Oc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=Oc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=Oc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Su(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Bu(){const{selectBlock:e}=(0,m.useDispatch)(to),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=Oc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Iu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(to),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===jc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===jc.BACKSPACE||d.keyCode===jc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===jc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===jc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function xu(){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)(to),{setNavigationMode:a}=(0,m.useDispatch)(to),c=(0,m.useSelect)((e=>e(to).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";Il.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===jc.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==jc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Il.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Il.isFormElement)(Il.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!==jc.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=Il.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(to).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Iu(),Cu(),wu(),Bu(),vu(),yu(),ku(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const Tu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=xu();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)})),Nu="editor-styles-wrapper";function Pu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Lu=(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)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Pu(null==a?void 0:a.styles),_=Pu(null==a?void 0:a.scripts),y=gu(),[E,C,S]=xu(),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),f(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]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${Nu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Nu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var Mu={grad:.9,turn:360,rad:360/(2*Math.PI)},Ru=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Au=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Du=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},Fu=function(e){return{r:Du(e.r,0,255),g:Du(e.g,0,255),b:Du(e.b,0,255),a:Du(e.a)}},zu=function(e){return{r:Au(e.r),g:Au(e.g),b:Au(e.b),a:Au(e.a,3)}},Vu=/^#([0-9a-f]{3,8})$/i,Hu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Gu=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}},Uu=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}},Wu=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),l:Du(e.l,0,100),a:Du(e.a)}},$u=function(e){return{h:Au(e.h),s:Au(e.s),l:Au(e.l),a:Au(e.a,3)}},ju=function(e){return Uu((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},Ku=function(e){return{h:(t=Gu(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},qu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xu={string:[[function(e){var t=Vu.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?Au(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?Au(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Zu.exec(e)||Qu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Fu({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=qu.exec(e)||Yu.exec(e);if(!t)return null;var n,o,r=Wu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Mu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ju(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 Ru(t)&&Ru(n)&&Ru(o)?Fu({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(!Ru(t)||!Ru(n)||!Ru(o))return null;var i=Wu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ju(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Ru(t)||!Ru(n)||!Ru(o))return null;var i=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),v:Du(e.v,0,100),a:Du(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Uu(i)},"hsv"]]},Ju=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]},ed=function(e,t){var n=Ku(e);return{h:n.h,s:Du(n.s+100*t,0,100),l:n.l,a:n.a}},td=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},nd=function(e,t){var n=Ku(e);return{h:n.h,s:n.s,l:Du(n.l+100*t,0,100),a:n.a}},od=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Ju(e.trim(),Xu.string):"object"==typeof e&&null!==e?Ju(e,Xu.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 Au(td(this.rgba),2)},e.prototype.isDark=function(){return td(this.rgba)<.5},e.prototype.isLight=function(){return td(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=zu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Hu(Au(255*r)):"","#"+Hu(t)+Hu(n)+Hu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return zu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=zu(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 $u(Ku(this.rgba))},e.prototype.toHslString=function(){return t=(e=$u(Ku(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=Gu(this.rgba),{h:Au(e.h),s:Au(e.s),v:Au(e.v),a:Au(e.a,3)};var e},e.prototype.invert=function(){return rd({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),rd(ed(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),rd(ed(this.rgba,-e))},e.prototype.grayscale=function(){return rd(ed(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),rd(nd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),rd(nd(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?rd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Au(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ku(this.rgba);return"number"==typeof e?rd({h:e,s:t.s,l:t.l,a:t.a}):Au(t.h)},e.prototype.isEqual=function(e){return this.toHex()===rd(e).toHex()},e}(),rd=function(e){return e instanceof od?e:new od(e)},ld=[],id=function(e){e.forEach((function(e){ld.indexOf(e)<0&&(e(od,Xu),ld.push(e))}))};function sd(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var ad=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},cd=function(e){return.2126*ad(e.r)+.7152*ad(e.g)+.0722*ad(e.b)};function ud(e){e.prototype.luminance=function(){return e=cd(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=cd(l))>(a=cd(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 dd=n(3124),pd=n.n(dd);const md=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function gd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return hd(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=hd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(md,""),value:n?hd(n[0]).replace(md,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=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=g();for(;r=k();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:hd(t[1]),media:hd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=hd(t[1]),o=hd(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return fd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function hd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function fd(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){fd(e,o)})):n&&"object"==typeof n&&fd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var vd=n(8575),bd=n.n(vd);const kd=_d;function _d(e){this.options=e||{}}_d.prototype.emit=function(e){return e},_d.prototype.visit=function(e){return this[e.type](e)},_d.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const yd=Ed;function Ed(e){kd.call(this,e)}bd()(Ed,kd),Ed.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Ed.prototype.comment=function(e){return this.emit("",e.position)},Ed.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Ed.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.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("}")},Ed.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Ed.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Ed.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Ed.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Ed.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("}")},Ed.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Ed.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Ed.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("}"):""},Ed.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Cd=Sd;function Sd(e){e=e||{},kd.call(this,e),this.indentation=e.indent}bd()(Sd,kd),Sd.prototype.compile=function(e){return this.stylesheet(e)},Sd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Sd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Sd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Sd.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}")},Sd.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}")},Sd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Sd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Sd.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}")},Sd.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)+"}")},Sd.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")},Sd.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}")},Sd.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}")},Sd.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}")},Sd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Sd.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()+"}"):""},Sd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Sd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const wd=function(e,t){try{const r=gd(e);return n=pd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new yd(o):new Cd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Bd(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 Id(e,t){return new URL(e,t).toString()}const xd=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]};Bd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Id(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},Td=/^(body|html|:root).*$/,Nd=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(Td)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Pd=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(Nd(t)),o&&r.push(xd(o)),r.length?wd(n,(0,d.compose)(r)):n}))},Ld=".editor-styles-wrapper";function Md(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Ld);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=rd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Rd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Pd(t,Ld)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Md(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Ad(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=rd(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 Dd(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function Od(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function Fd(e){let{id:t,colors:n}=e;const o=Ad(n);return(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:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function zd(e){let{preset:t}=e;return(0,s.createElement)(Fd,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Vd;id([sd,ud]);const Hd=2e3,Gd=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,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(to).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);Vd=Vd||(0,d.pure)(mh);const v=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(${v})`,height:a*v,maxHeight:a>Hd?Hd*v:void 0,minHeight:o}},(0,s.createElement)(Lu,{head:(0,s.createElement)(Rd,{styles:h}),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:Hd,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(zd,{preset:e,key:e.slug}))),(0,s.createElement)(Vd,{renderAppender:!1}))))},Ud=(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(to).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)(pu,{value:d,settings:c},r?(0,s.createElement)(mu,{onClick:l}):(0,s.createElement)(Gd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function Wd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(to).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(pu,{value:p,settings:a},(0,s.createElement)(hh,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const $d=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Ud,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(n.name,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(au,{title:l,icon:i,description:a}))},jd=(0,s.createContext)(),Kd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(jd);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)}))})),qd=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Yd(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)(su,{icon:n}):(0,h.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
- (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(su,{icon:qd})))))}const Zd=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)(Yd,{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 Qd(){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)}const Xd=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const m=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Zd,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{m.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{m.current=!1,h&&h(e)}},(0,s.createElement)(Kd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Qd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===jc.ENTER&&(e.preventDefault(),l(o,Qd()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{m.current||a(o)},onMouseEnter:()=>{m.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:g},(0,s.createElement)(su,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(p.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),Jd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Gt.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),ep=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(jd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),tp=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Jd,{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)(ep,{key:t},e.map(((e,l)=>(0,s.createElement)(Xd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},np=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},op=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(to),{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])]},rp=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(jd.Provider,{value:n},t)},lp=[],ip=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=op(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]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:lp);return(0,s.createElement)(rp,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(np,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(tp,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(np,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(tp,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(np,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(tp,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(np,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(tp,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},sp=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,h.__)("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,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},ap=window.wp.notices,cp=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(to);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(ap.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
13
  /* translators: %s: block pattern title. */
14
- (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function up(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)(up)}`;return(0,s.createElement)(Zd,{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)(Ud,{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 dp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const pp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("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)(up,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(dp,{key:e.name}))))};function mp(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 gp(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,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const hp=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)(gp,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(mp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},fp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Rr,{className:"block-editor-inserter__no-results-icon",icon:iu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},vp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(to),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(to),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(to),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)?g(o.clientId,e,null,a||n?0:null,t):f(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
15
- (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Gt.speak)(s),i&&i()}),[l,c,g,f,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]},bp=e=>e.name||"",kp=e=>e.title,_p=e=>e.description||"",yp=e=>e.keywords||[],Ep=e=>e.category,Cp=()=>null;function Sp(){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 wp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Sp(e))},Bp=(e,t)=>e.filter((e=>!wp(t).some((t=>t.includes(e))))),Ip=(e,t,n,o)=>0===wp(o).length?e:xp(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}}),xp=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=wp(t);if(0===o.length)return e;const r=e.map((e=>[e,Tp(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 Tp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=bp,getTitle:r=kp,getDescription:l=_p,getKeywords:i=yp,getCategory:s=Ep,getCollection:a=Cp}=n,c=o(e),d=r(e),p=l(e),m=i(e),g=s(e),h=a(e),f=Sp(t),v=Sp(d);let b=0;if(f===v)b+=30;else if(v.startsWith(f))b+=20;else{const e=[c,d,p,...m,g,h].join(" "),t=(0,u.words)(f);0===Bp(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Np(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,h.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
- (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const Pp=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Gt.speak,500),[l,i]=vp({shouldFocusBlock:!0}),[a,,c]=cp(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?xp(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,h.sprintf)(
18
  /* translators: %d: number of results. */
19
- (0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(Np,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(rp,null,!g&&(0,s.createElement)(fp,null),g&&(0,s.createElement)(pp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Lp(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)(hp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(Pp,{filterValue:o,selectedCategory:l,patternCategories:n}))}const Mp=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Lp,n))};function Rp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=cp(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)(pp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const Ap=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=cp(),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,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Rp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(Mp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Dp=window.wp.url;function Op(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=op(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(fp,null):(0,s.createElement)(np,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(tp,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const Fp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Op,{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,Dp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:zp,Slot:Vp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");zp.Slot=Vp;const Hp=zp,Gp=[],Up=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Gt.speak,500),[_,y]=vp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=op(_,y),[B,,I]=cp(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=xp(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=Ip((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,h.sprintf)(
20
  /* translators: %d: number of results. */
21
- (0,h._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:Gp),M=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),R=!!N.length&&(0,s.createElement)(np,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(tp,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(np,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(pp,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(rp,null,!g&&!M&&(0,s.createElement)(fp,null),b?A:R,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?R:A,g&&(0,s.createElement)(Hp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:M,rootClientId:_}},(e=>e.length?e:M?null:(0,s.createElement)(fp,null))))},Wp={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
- title:(0,h.__)("Blocks")},$p={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
- title:(0,h.__)("Patterns")},jp={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
- title:(0,h.__)("Reusable")},Kp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Wp];return n&&e.push($p),o&&e.push(jp),e}),[Wp,n,$p,o,jp]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},qp=(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[g,f]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=vp({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(to);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)(ip,{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,h.__)("A tip for using the block editor")),(0,s.createElement)(lu,null)))),[y,B,x,g,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Ap,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),L=(0,s.useMemo)((()=>(0,s.createElement)(Fp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),M=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:L),[N,P,L]),R=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{R.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),f(e)},value:g,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:R}),!!g&&(0,s.createElement)(Up,{filterValue:g,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!g&&(S||w)&&(0,s.createElement)(Kp,{showPatterns:S,showReusableBlocks:w},M),!g&&!S&&!w&&N)),a&&v&&(0,s.createElement)($d,{item:v}))}));function Yp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=vp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=op(u,d),[f]=cp(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(to),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=f.length&&(!!i||l),_=k&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Up,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Zp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
28
- (0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:ou,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class Qp 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=Zp,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(Yp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(qp,{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,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Xp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getBlockIndex:u,getBlockCount:d,getSettings:p}=e(to),{getBlockVariations:m}=e(r.store);l=l||i(o)||void 0;const g=a(l),h=c(l),f=u(o),v=d(),b=p(),k=1===(null==g?void 0:g.length)&&0===(null===(n=m(g[0].name,"inserter"))||void 0===n?void 0:n.length);let _=!1;return k&&(_=g[0]),{hasItems:s(l),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:h,rootClientId:l,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!l&&f>0&&(f<v||0===v)}})),(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(to);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(to);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(to);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
29
- (0,h.__)("%s block added"),a.title);(0,Gt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Qp),Jp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(to),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(to);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,nu.decodeEntities)(r)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{jc.ENTER!==e.keyCode&&jc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Xp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function em(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Xp,{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,h.sprintf)(// translators: %s: the name of the block when there is only one
30
- (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Rr,{icon:ou}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const tm=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),em(e,t)))),nm=(0,s.forwardRef)(em),om=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(to);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)(Jp,{rootClientId:n}):(0,s.createElement)(nm,{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)}));(0,s.createContext)();const rm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(to),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=wo(t),v=wo(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),_=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}:(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}}),[f,v]),y=$o(l);return f&&v&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null},lm=(0,s.createContext)();function im(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(to),l=(0,s.useContext)(lm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(to),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:f?.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)(rm,{previousClientId:u,nextClientId:g,__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&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Xp,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function sm(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(to).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(lm.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(im,n),t)}function am(){const e=(0,s.useContext)(lm),t=(0,m.useSelect)((e=>e(to).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(to),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(to);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",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));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"))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 cm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,um="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function dm(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(to),{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 pm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(to),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=dm(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function mm(e){let{clientId:t,maximumLength:n,context:o}=e;return pm({clientId:t,maximumLength:n,context:o})}const gm=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(to),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,Il.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)(to);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,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Yd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},hm=function(e){let{clientId:t,rootClientId:n}=e;const o=dm(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(to),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:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(to),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,Gt.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N}=(0,m.useSelect)(to),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:M,moveBlockToPosition:R}=(0,m.useDispatch)(to),A=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),D=(0,h.__)("Drag");return(0,s.createElement)("div",{className:A},(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)(su,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(gm,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:qd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,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===jc.UP,r=n===jc.DOWN,l=n===jc.LEFT,i=n===jc.RIGHT,s=n===jc.TAB,a=n===jc.ESCAPE,c=n===jc.ENTER,u=n===jc.SPACE,d=e.shiftKey;if(n===jc.BACKSPACE||n===jc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(f)y=g;else if(v)y=h;else if(k){var A;y=null!==(A=w(p))&&void 0!==A?A:p}else if(_){var D;y=null!==(D=B([p])[0])&&void 0!==D?D:p}const O=C();if(a&&O&&!e.defaultPrevented&&(M(null),e.preventDefault()),(c||u)&&O){const e=w(O),t=w(p),n=S(O);let o=S(p);n<o&&e===t&&(o-=1),R(O,e,t,o),P(O),M(null)}if(v||f||k||_)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=E;do{t=Il.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Il.focus.tabbable.findNext(t))}else t=Il.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),L())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(mm,{clientId:t,maximumLength:35})))))};function fm(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const vm=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=!Il.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Il.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,_u.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=fm(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=fm(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)},bm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),km=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),_m=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),ym=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Em=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Cm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?bm:km:_m:"down"===e?"horizontal"===t?(0,h.isRTL)()?km:bm:ym:null,Sm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,wm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(wm),f=(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(to),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,k=h===f.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:g,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(to),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;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:Cm(o,C),label:Sm(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;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Em("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
33
- (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=Em("down",l);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Em("up",l);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
34
  (0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
35
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
36
- (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=Em("up",l);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
37
- (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=Em("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
38
  (0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
39
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
40
- (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=Em("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
41
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
42
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
- (0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=Em("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
44
  (0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
45
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
46
- (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=Em("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
47
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
48
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
49
- (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Bm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(wm,i({direction:"up",ref:t},e)))),Im=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(wm,i({direction:"down",ref:t},e)))),xm=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(to),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)),g=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===g.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const g=(0,h.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(gm,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:qd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:g,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)(Bm,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Im,i({clientIds:t},e))))))},{clearTimeout:Tm,setTimeout:Nm}=window,Pm=()=>{},Lm=200;function Mm(e){let{ref:t,isFocused:n,debounceTimeout:o=Lm,onChange:r=Pm}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&Tm&&Tm(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=Nm((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Rm(e){let{ref:t,debounceTimeout:n=Lm,onChange:o=Pm}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Mm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function Am(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(to),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(to),{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=dm(n),c=(0,s.useRef)(),{gestures:u}=Rm({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,h.sprintf)(
50
  /* translators: %s: Name of the block's parent. */
51
- (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(su,{icon:a.icon})}))}const Dm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Om(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,h.__)("Preview")),(0,s.createElement)(Ud,{viewportWidth:500,blocks:t})))))}const Fm=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,h.__)("Transform to"),className:t},i&&(0,s.createElement)(Om,{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)(su,{icon:n,showColors:!0}),l)})))},zm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),Vm=window.wp.tokenList;var Hm=n.n(Vm);function Gm(e,t,n){const o=new(Hm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Um(e){return(0,u.find)(e,"isDefault")}function Wm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(to),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)(to),d=function(e){return e&&0!==e.length?Um(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Hm())(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),g=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=Gm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:g,className:a}}const $m=()=>{};function jm(e){let{clientId:t,onSwitch:n=$m}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Wm({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?zm:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Km(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(jm,{clientId:o,onSwitch:n}))}const qm=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=qm(e,t,n);if(o)return o}}},Ym=(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 Zm(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,h.__)("Preview")),(0,s.createElement)(Qm,{patterns:t,onSelect:n})))))}function Qm(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,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Xm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Xm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Xm,`${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)(Ud,{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))}const Jm=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=qm(r,t.name,o);if(n){e=!0,o.add(n.clientId),Ym(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)(Zm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:bm},(0,h.__)("Patterns"))):null},eg=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(to),l=dm(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:g,patterns:f}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(to),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(to),m=i((0,u.castArray)(t)[0]),[{name:g}]=n,h=1===n.length,f=h&&c(g);let v;var b;h?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(g))||void 0===b?void 0:b.icon:Dm;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==f||!f.length),icon:v,blockTitle:null===(o=d(g))||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&&!b,_=!(null==f||!f.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:g,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(su,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(mm,{clientId:t,maximumLength:35})))}));const y=g,E=1===n.length?(0,h.sprintf)(
52
  /* translators: %s: block title. */
53
  (0,h.__)("%s: Change block type or style"),g):(0,h.sprintf)(
54
  /* translators: %d: number of blocks. */
55
- (0,h._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)(su,{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)(mm,{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)(Jm,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Fm,{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)(Km,{hoveredBlock:n[0],onSwitch:l}))})))))},tg=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(to).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(eg,{clientIds:t,blocks:n})},{Fill:ng,Slot:og}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");ng.Slot=og;const rg=ng,lg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),ig=window.wp.blob;function sg(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 ag(){const{getBlockName:e}=(0,m.useSelect)(to),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(ap.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
56
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
57
  (0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
58
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
59
- (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function cg(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(to),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,m.useDispatch)(to),f=ag();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,Il.documentHasUncollapsedSelection)(t):(0,Il.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)h();else{let t;if(f(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",(E=(E=n).replace(/<br>/g,"\n"),(0,Il.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),m.clipboardData.setData("text/html",n)}var E;if("cut"===m.type)_&&!y?u(v):g();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,Il.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!sg(r,o)&&(o=r.map((e=>`<img src="${(0,ig.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)}}),[])}const ug=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:cg()},t)};function dg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(to),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),g=s(t),h=i(t[0]),f=(0,u.every)(g,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(to),T=ag();return n({canDuplicate:f,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:g,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(!g.length)return;const e=p(),n=(0,r.switchToBlockType)(g,e);n&&y(t,n)},onUngroup(){if(!g.length)return;const e=g[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=g.map((e=>{let{clientId:t}=e;return t}));1===g.length&&w(e[0]),T("copy",e)}})}const pg=()=>{},mg=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(to),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=pg,clientId:o}=t;return{onToggleMode(){e(to).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),gg=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(to).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(to).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)})),{Fill:hg,Slot:fg}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");hg.Slot=fg;const vg=hg;function bg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(to);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,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function kg(){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(to),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}function _g(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(to),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])}const yg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),Eg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Cg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Sg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=_g(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,m.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(to),s=l(t),a=(0,r.getBlockType)(s);return{isReusable:(0,r.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:k}=(0,m.useDispatch)(to),_=dm(t),y=(0,d.useInstanceId)(Sg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(p.Modal,{title:(0,h.sprintf)(
60
  /* translators: %s: Name of the block. */
61
- (0,h.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),k([t],{lock:o,templateLock:v?Cg(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,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:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,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,h.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Eg:yg})),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,h.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Eg:yg})),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,h.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Eg:yg})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(p.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(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,h.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function wg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=_g(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?yg:Eg,onClick:l},i),r&&(0,s.createElement)(Sg,{clientId:t,onClose:l}))}const{Fill:Bg,Slot:Ig}=(0,p.createSlotFill)("BlockSettingsMenuControls");function xg(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(Bg,t))}xg.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(to),l=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(l).filter(Boolean),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=_g(r[0]),c=1===r.length&&a,d=kg(),{isGroupable:g,isUngroupable:h}=d,f=(g||h)&&l;return(0,s.createElement)(Ig,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!f&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(wg,{clientId:r[0]}),e,f&&(0,s.createElement)(bg,i({},d,{onClose:null==t?void 0:t.onClose})))))};const Tg=xg,Ng=()=>{},Pg={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Lg(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(p.MenuItem,{ref:o},l)}const Mg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:g,hasReducedUI:f,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(to),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(_u.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)(to),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Ng,[n]),B=pm({clientId:d,maximumLength:25}),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:Ng,[n,k,_,y]),x=(0,h.sprintf)(
62
  /* translators: %s: block name */
63
- (0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=Rm({ref:N,onChange(e){e&&f||S(g,e)}});return(0,s.createElement)(dg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:f,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:lg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Pg,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(vg.Slot,{fillProps:{onClose:l}}),void 0!==g&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(su,{icon:b.icon}),onClick:()=>C(g)}),(0,h.sprintf)(
64
  /* translators: %s: Name of the block's parent. */
65
- (0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(gg,{clientId:d}),(0,s.createElement)(Lg,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,f,w),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,h.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(mg,{clientId:d,onToggle:l})),(0,s.createElement)(Tg.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)))}))}))};function Rg(e){let{clientIds:t,...n}=e;const{block:o,shouldRender:l}=(0,m.useSelect)((e=>{const n=t[0],{isBlockMultiSelected:o,getBlockMode:r,getBlock:l}=e(to),i=!o(n),s="html"===r(n);return{block:l(n),shouldRender:i&&s}}),[t[0]]),{replaceBlocks:a}=(0,m.useDispatch)(to),c=(0,s.useCallback)((()=>{a(o.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(o)}))}),[o]);return l?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,i({onClick:c},n),(0,h.__)("Edit visually"))):null}const Ag=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rg,i({clientIds:t},n)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Mg,i({clientIds:t,toggleProps:e},n))))))};function Dg(e){let{clientId:t}=e;const n=dm(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=_g(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:Eg,label:(0,h.sprintf)(
66
  /* translators: %s: block name */
67
- (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Sg,{clientId:t,onClose:c})):null}const Og=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),Fg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),zg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),Vg={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},Hg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=kg(),{replaceBlocks:l}=(0,m.useDispatch)(to),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(to),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=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=Vg[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Og,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:Fg,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:zg,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))},Gg=(0,s.createContext)(""),Ug=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(to),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:f}=(0,m.useDispatch)(to),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Rm({ref:v,onChange(e){e&&u||f(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=g&&h,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)(Am,{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)(tg,{clientIds:n}),!C&&(0,s.createElement)(Dg,{clientId:n[0]}),(0,s.createElement)(xm,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(Hg,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(po.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Gg.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(rg.Slot,null))),(0,s.createElement)(Ag,{clientIds:n}))},Wg=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(to),{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:c&&(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)(vm,i({focusOnMount:t,className:d
68
- /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Ug,{hideDragHandle:n}))};function $g(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(to);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function jg(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:g,lastClientId:h}=(0,m.useSelect)($g,[]),f=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(to);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),{stopTyping:k}=(0,m.useDispatch)(to),_=a,y=!a&&!g&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||g||o);(0,_u.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(jo,{clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":f}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(Wg,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(hm,{clientId:t,rootClientId:n})):null}function Kg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(to),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function qg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Kg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(jg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Yg(e){let{children:t}=e;const n=(0,s.useContext)(lm),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(sm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(qg,{__unstablePopoverSlot:"block-toolbar"}),t))}const Zg=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=lo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Qg=Zg((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(nm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Xg=(0,d.compose)([Zg,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(to),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Jp,{rootClientId:t})})),Jg=new WeakMap;function eh(e,t){const n=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(to),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(to),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),g=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,Il.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function th(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 nh(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=th(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function oh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=nh(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function rh(){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(to);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(to),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(to),a=eh(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=oh(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 lh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(to),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(to).getBlockRootClientId(e);return{blockListSettings:t(to).getBlockListSettings(e),parentLock:t(to).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=Jr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Wo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(to),{replaceInnerBlocks:i}=(0,m.useDispatch)(to),a=(0,m.useSelect)((t=>t(to).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(to).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Jg.has(t)||Jg.set(t,new WeakMap);const n=Jg.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)(hh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function ih(e){return du(e),(0,s.createElement)(lh,e)}const sh=(0,s.forwardRef)(((e,t)=>{const n=ah({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function ah(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=lo(),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(to),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,rh({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?ih:lh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(hh,t)}}ah.save=r.__unstableGetInnerBlocksProps,sh.DefaultBlockAppender=Xg,sh.ButtonBlockAppender=Qg,sh.Content=()=>ah.save().children;const ch=sh,uh=(0,s.createContext)(),dh=(0,s.createContext)();function ph(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(to),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(to),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=ah({ref:(0,d.useMergeRefs)([gu(),am(),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)(uh.Provider,{value:o},(0,s.createElement)(dh.Provider,{value:g},(0,s.createElement)("div",h)))}function mh(e){return function(){const e=(0,m.useSelect)((e=>e(to).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(to).__experimentalGetParsedPattern(e[n].name),t=cm(o))};return t=cm(o),()=>um(t)}),[e])}(),(0,s.createElement)(Yg,null,(0,s.createElement)(ro,{value:no},(0,s.createElement)(ph,e)))}function gh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=el}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(to);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(nl,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(tu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(om,{tagName:r,rootClientId:n,renderAppender:o}))}function hh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(gh,e))}function fh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function vh(){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=fh(o),i=0===r||r?`${r}${l}`:void 0;return i}function bh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=vh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function kh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function _h(e){let{onChange:t,values:n,...o}=e;const r=vh(n),l=kh(n)&&bh(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}mh.__unstableElementContext=uh;const yh={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Eh(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(yh).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}const Ch=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),Sh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function wh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?Ch:Sh,iconSize:16,"aria-label":o})))}const Bh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Ih={px:100,em:20,rem:20};function xh(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!kh(n)||!bh(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 fh(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)(vh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_h,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Ih[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Eh,{min:0,onChange:t,values:n||Bh,units:l}),(0,s.createElement)(wh,{onClick:()=>r(!o),isLinked:o})))}function Th(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(xh,{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})}})}id([sd,ud]);const Nh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Ph=(e,t)=>(0,u.find)(e,{color:t});function Lh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Mh(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Rh(){const e=Mh(),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,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=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,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Ah="__experimentalBorder",Dh=["top","right","bottom","left"],Oh=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}}}},Fh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},zh=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Fh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Fh(t,"color",o)||{color:o}};function Vh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Hh(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Rh(),a=Gh(e.name),c=To("border.color")&&Gh(e.name,"color"),u=To("border.radius")&&Gh(e.name,"radius"),d=To("border.style")&&Gh(e.name,"style"),m=To("border.width")&&Gh(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Ah,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=zh({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Dh.forEach((e=>{var n;const o=Vh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=zh({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Go,{__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,h.__)("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:f,resetAllFilter:Oh,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}},Dh.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=zh({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=zh({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})},popoverPlacement:"left-start",popoverOffset:40,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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Uh(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(Th,e)))}function Gh(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,Ah);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 Uh(e,t){return Mo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Wh(e,t,n){if(!Gh(t,"color")||Do(t,Ah,"color"))return e;const o=$h(n),r=c()(e.className,o);return e.className=r||void 0,e}function $h(e){var t;const{borderColor:n,style:o}=e,r=Lh("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 jh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Rh();if(!Gh(m,"color")||Do(m,Ah,"color"))return(0,s.createElement)(e,t);const{color:b}=zh({colors:v,namedColor:h}),{color:k}=zh({colors:v,namedColor:Vh(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=zh({colors:v,namedColor:Vh(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=zh({colors:v,namedColor:Vh(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=zh({colors:v,namedColor:Vh(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function Kh(e){if(e)return`has-${e}-gradient-background`}function qh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Yh(e,t){return(0,u.find)(e,["gradient",t])}function Zh(e,t){const n=Yh(e,t);return n&&n.slug}function Qh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=lo(),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(to),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(to),d=(0,s.useCallback)((o=>{const r=Zh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Kh(a);let g;return g=a?qh(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Gh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Wh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Gh(e,"color")||Do(e,Ah,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Wh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",jh);const Xh=["colors","disableCustomColors","gradients","disableCustomGradients"],Jh={name:"color",title:"Solid color",value:"color"},ef={name:"gradient",title:"Gradient",value:"gradient"},tf=[Jh,ef];function nf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:k}=e;const _=m&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!_&&!y)return null;const E={[Jh.value]:(0,s.createElement)(p.ColorPalette,{value:h,onChange:y?e=>{m(e),g()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:k}),[ef.value]:(0,s.createElement)(p.GradientPicker,{value:f,onChange:_?e=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})};return(0,s.createElement)(p.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},b&&(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&&(0,s.createElement)(p.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:tf,initialTabName:f?ef.value:!!_&&Jh.value},(e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__tab-panel"},E[e.value]))),!y&&E[Jh.value],!_&&E[ef.value])))}function of(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)(nf,i({},t,e))}const rf=function(e){return(0,u.every)(Xh,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(nf,e):(0,s.createElement)(of,e)},lf=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},sf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,null,n))},af=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(sf,{colorValue:r,label:l}))};function cf(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(lf,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:af(f),renderContent:()=>(0,s.createElement)(p.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(rf,h)))}))})))}id([sd,ud]);const uf=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,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=rd(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 f){if(!e.color)continue;const t=rd(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
69
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
70
- (0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,Gt.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 df(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function pf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=So(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(df(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(df(t).color);let n=m.current,o=df(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=df(n).backgroundColor;a(o)}));const g=Rh();return(0,s.createElement)(Go,{__experimentalGroup:"color"},(0,s.createElement)(cf,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,s.createElement)(uf,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const mf="color",gf=e=>{const t=(0,r.getBlockSupport)(e,mf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},hf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,mf);return null!==t&&"object"==typeof t&&!!t.link},ff=e=>{const t=(0,r.getBlockSupport)(e,mf);return null!==t&&"object"==typeof t&&!!t.gradients},vf=e=>{const t=(0,r.getBlockSupport)(e,mf);return t&&!1!==t.background},bf=e=>{const t=(0,r.getBlockSupport)(e,mf);return t&&!1!==t.text},kf=(e,t)=>Mo(Ro(t,e,void 0)),_f=e=>({textColor:void 0,style:kf(["color","text"],e.style)}),yf=e=>({style:kf(["elements","link","color","text"],e.style)}),Ef=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 Cf(e,t,n){var o,r,l,i,s,a;if(!gf(t)||Do(t,mf))return e;const u=ff(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!Do(t,mf,e),f=h("text")?Lh("color",p):void 0,v=h("gradients")?Kh(m):void 0,b=h("background")?Lh("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Sf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Nh(e,n[1]).color:t};function wf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=To("color.palette.custom"),f=To("color.palette.theme"),v=To("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,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||!f||(null==f?void 0:f.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!gf(p))return null;const P=hf(p)&&B&&x,L=bf(p)&&I&&x,M=vf(p)&&w&&x,R=ff(p)&&T;if(!(P||L||M||R))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(R&&F)z=qh(E,F);else if(R){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=Ph(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,[mf,"__experimentalDefaultControls"]);return(0,s.createElement)(pf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Nh(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:_f}]:[],...M||R?[{label:(0,h.__)("Background"),onColorChange:M?H("background"):void 0,colorValue:Nh(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:R?t=>{const n=Zh(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,resetAllFilter:Ef}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=Ph(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Mo(Ro(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:Sf(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,resetAllFilter:yf}]:[]]})}const Bf=(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(!gf(o)||Do(o,mf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!Do(o,mf,"text")&&(m.color=null===(g=Nh(p,a))||void 0===g?void 0:g.color),l&&!Do(o,mf,"background")&&(m.backgroundColor=null===(h=Nh(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),If={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 gf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),ff(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Cf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!gf(e)||Do(e,mf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Cf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Bf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Ao({linkColor:hf(r),textColor:bf(r),backgroundColor:vf(r),gradient:ff(r)},If,e,t,n,o)}));const xf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],Tf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Nf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Pf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Nf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return xf.forEach((t=>{let{name:n,value:o}=t;Tf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
71
  /* translators: 1: Font weight name. 2: Font style name. */
72
- (0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return xf.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 Tf.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,h.sprintf)(// translators: %s: Currently selected font appearance.
73
- (0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
74
- (0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
75
- (0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const Lf=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||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const 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,h.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))},Mf="typography.lineHeight";function Rf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Lf,{__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:Mo(t)})}})}function Af(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Mf)||t}const Df="typography.__experimentalFontStyle",Of="typography.__experimentalFontWeight";function Ff(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!zf(e),i=!Vf(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)(Pf,{onChange:e=>{r({style:Mo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function zf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Df),n=To("typography.fontStyle");return!t||!n}function Vf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Of),n=To("typography.fontWeight");return!t||!n}function Hf(e){const t=zf(e),n=Vf(e);return t&&n}function Gf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=To("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Uf="typography.__experimentalFontFamily";function Wf(e,t,n){if(!(0,r.hasBlockSupport)(t,Uf))return e;if(Do(t,Ev,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Hm())(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 $f(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=To("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)(Gf,{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 jf(e){let{name:t}=e;const n=To("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Uf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Uf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Wf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Uf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Wf(o,e,n)},e}));const Kf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function qf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Yf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Zf=function(e){const t=To("typography.fontSizes"),n=!To("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Qf="typography.fontSize";function Xf(e,t,n){if(!(0,r.hasBlockSupport)(t,Qf))return e;if(Do(t,Ev,"fontSize"))return e;const o=new(Hm())(e.className);o.add(Yf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Jf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=To("typography.fontSizes"),a=Kf(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)(Zf,{onChange:e=>{const t=qf(i,e).slug;l({style:Mo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ev(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=To("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Qf)||!n}const tv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=To("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Qf)||Do(i,Ev,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=Kf(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"),nv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Qf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Xf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Qf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Xf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",tv),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ao({fontSize:(0,r.hasBlockSupport)(l,Qf)},nv,e,t,n,o)}));const ov=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),rv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),lv=[{name:(0,h.__)("Underline"),value:"underline",icon:ov},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:rv}];function iv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},lv.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 sv="typography.__experimentalTextDecoration";function av(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(iv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function cv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,sv),n=To("typography.textDecoration");return t||!n}const uv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),pv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),mv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:uv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:dv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:pv}];function gv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},mv.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 hv="typography.__experimentalTextTransform";function fv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(gv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function vv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,hv),n=To("typography.textTransform");return t||!n}function bv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const kv="typography.__experimentalLetterSpacing";function _v(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(bv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function yv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,kv),n=To("typography.letterSpacing");return t||!n}const Ev="typography",Cv=[Mf,Qf,Df,Of,Uf,sv,hv,kv];function Sv(e){const{clientId:t}=e,n=jf(e),o=ev(e),l=Hf(e),i=Af(e),a=cv(e),c=vv(e),u=yv(e),d=!zf(e),m=!Vf(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Hf(e),ev(e),Af(e),jf(e),cv(e),vv(e),yv(e)];return t.filter(Boolean).length===t.length}(e),f=wv(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[Ev,"__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)(Go,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)($f,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)
76
- /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Mo({...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)(Jf,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:Nf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Ff,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,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Rf,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,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(av,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)
77
- /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(fv,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,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(_v,e)))}const wv=e=>Cv.some((t=>(0,r.hasBlockSupport)(e,t))),Bv=[...Cv,Ah,mf,tr],Iv=e=>Bv.some((t=>(0,r.hasBlockSupport)(e,t))),xv="var:";function Tv(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,xv)?`var(--wp--${e.slice(xv.length).split("|").join("--")})`:e}function Nv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{if(r.__EXPERIMENTAL_STYLE_PROPERTY[o].rootOnly)return;const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Tv(r))})):t.includes(l.join("."))||(n[o]=Tv((0,u.get)(e,l))))}}));const o=Qr(e);return o.forEach((e=>{n[e.key]=e.value})),n}const Pv={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[mf],[`${Ev}.__experimentalSkipSerialization`]:[Ev],[`${tr}.__experimentalSkipSerialization`]:["spacing"]},Lv={...Pv,[`${tr}`]:["spacing.blockGap"]},Mv={gradients:"gradient"};function Rv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lv;if(!Iv(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Mv[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Nv(l),...e.style},e}const Av=(0,d.createHigherOrderComponent)((e=>t=>{const n=io();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wf,t),(0,s.createElement)(Sv,t),(0,s.createElement)(Hh,t),(0,s.createElement)(rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Dv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Do(t.name,mf,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=Zr(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(mh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Iv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Rv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Iv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rv(o,e,n,Pv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Av),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Dv),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Ov=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Fv=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(p.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(p.DuotoneSwatch,{values:i}):(0,s.createElement)(Rr,{icon:Ov}),(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==jc.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},zv=[];function Vv(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(Od,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fd,{id:n,colors:o}),(0,s.createElement)(Dd,{id:n,selector:t}))}function Hv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!To(n),r=To(`${t}.custom`)||zv,l=To(`${t}.theme`)||zv,i=To(`${t}.default`)||zv;return(0,s.useMemo)((()=>[...r,...l,...o?zv:i]),[o,r,l,i])}function Gv(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=Hv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Hv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!To("color.custom"),u=!To("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Fv,{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})}}))}id([sd]);const Uv=(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)(Gv,t))}),"withDuotoneControls"),Wv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(mh.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Vv,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Uv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Wv);const $v="__experimentalLayout";function jv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=To("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,$v,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Jr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inner blocks use full width"),checked:!k,onChange:()=>t({layout:{inherit:!k}})}),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},k?(0,h.__)("Nested blocks use theme content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container."))),!k&&u&&(0,s.createElement)(Kv,{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 Kv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Xr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const qv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,$v)&&(0,s.createElement)(jv,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Yv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,$v),a=(0,d.useInstanceId)(e),p=To("layout")||{},g=(0,s.useContext)(mh.__unstableElementContext),{layout:h}=o,{default:f}=(0,r.getBlockSupport)(n,$v)||{},v=null!=h&&h.inherit?p:h||f||{},b=l?function(e,t){var n;const o=(0,m.useSelect)((e=>{var t;const{getSettings:n}=e(to);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=[];var l;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&r.push(null==t||null===(l=t[(null==e?void 0:e.type)||"default"])||void 0===l?void 0:l.className),(null!=e&&e.inherit||null!=e&&e.contentSize)&&o&&r.push("has-global-padding"),null!=e&&e.orientation&&r.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&r.push("is-nowrap"),r}(v,null==p?void 0:p.definitions):null,k=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${a}`,_=null!==To("spacing.blockGap");let y;if(l){var E;const e=Jr((null==v?void 0:v.type)||"default");y=null==e||null===(E=e.getLayoutStyle)||void 0===E?void 0:E.call(e,{blockName:n,selector:k,layout:v,layoutDefinitions:null==p?void 0:p.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:_})}const C=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l&&!!y},b);return(0,s.createElement)(s.Fragment,null,l&&g&&!!y&&(0,s.createPortal)((0,s.createElement)(rl,{blockName:n,selector:k,css:y,layout:v,style:null==o?void 0:o.style}),g),(0,s.createElement)(e,i({},t,{className:C})))}));function Zv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:$h(e)||void 0,style:Nv({border:n})}}function Qv(e){const{colors:t}=Rh(),n=Zv(e),{borderColor:o}=e;if(o){const e=zh({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Xv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Lh("background-color",s),m=Lh("color",a),g=Kh(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Nv({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,$v)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Yv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",qv);const Jv={};function eb(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=To("color.palette.custom")||[],l=To("color.palette.theme")||[],i=To("color.palette.default")||[],a=To("color.gradients")||Jv,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=Xv(e);if(t){const e=Nh(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=qh(u,o)),n){const e=Nh(c,n);d.style.color=e.color}return d}function tb(e){const{style:t}=e;return{style:Nv({spacing:(null==t?void 0:t.spacing)||{}})}}function nb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const ob=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),rb=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette.custom"),o=To("color.palette.theme"),r=To("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function lb(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof t?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=rd(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=Ph(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=Nh(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:Lh(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ib(e){return function(){const t=ob(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(lb(o,t),"withCustomColors")}}function sb(){const e=rb();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(lb(n,e),"withColors")}const ab=[],cb=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=To("typography.fontSizes")||ab;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=Kf(r,l,n[t]);return e[o]={...i,class:Yf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},ub=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),db=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),pb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),mb=[{icon:ub,title:(0,h.__)("Align text left"),align:"left"},{icon:db,title:(0,h.__)("Align text center"),align:"center"},{icon:pb,title:(0,h.__)("Align text right"),align:"right"}],gb={position:"bottom right",isAlternate:!0},hb=function(e){let{value:t,onChange:n,alignmentControls:o=mb,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),g=c?p.ToolbarGroup:p.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{};return(0,s.createElement)(g,i({icon:m?m.icon:(0,h.isRTL)()?pb:ub,label:r,toggleProps:{describedBy:l},popoverProps:gb,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},fb=e=>(0,s.createElement)(hb,i({},e,{isToolbar:!1})),vb=e=>(0,s.createElement)(hb,i({},e,{isToolbar:!0})),bb=()=>{},kb={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(to),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=op(t,bb),i=(0,s.useMemo)((()=>(e.trim()?Ip(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)(su,{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))}}},_b=window.wp.apiFetch;var yb=n.n(_b);const Eb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 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"})),Cb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Sb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await yb()({path:(0,Dp.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)(Rr,{key:"icon",icon:"page"===e.subtype?Eb:Cb}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},wb=[];function Bb(e){let{completers:t=wb}=e;const{name:n}=lo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([kb,Sb])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const Ib=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Bb(e)}))},xb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Tb=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:xb,label:n,onClick:()=>o(!t),disabled:r})},Nb=()=>{},Pb=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=Nb,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{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!==jc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Lb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Mb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(to),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(to),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Rr,{icon:Lb,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)(mm,{clientId:e,maximumLength:35})),(0,s.createElement)(Rr,{icon:Lb,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(mm,{clientId:r,maximumLength:35})))};function Rb(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(to);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const Ab=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),Db=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(Ab,null)))},Ob=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==jc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Db,null)))}))}},Fb=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Ob(n),renderContent:()=>t})},zb=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Vb=Tc(p.__experimentalTreeGridRow);function Hb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=Lc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Vb,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Gb(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Rr,{icon:Lb}))}const Ub=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const g=dm(o),h=pm({clientId:o,context:"list-view"}),{isLocked:f}=_g(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==jc.ENTER&&e.keyCode!==jc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Gb,{onClick:l}),(0,s.createElement)(su,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(p.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(p.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},g.anchor),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Rr,{icon:Eg})))))})),Wb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(to);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),k=v&&b===f,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=g.includes(f)?g:[f];return(0,s.createElement)(gm,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:g}=e;return(0,s.createElement)(Ub,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:g,isExpanded:p},h))}))})),$b=(0,s.createContext)({}),jb=()=>(0,s.useContext)($b),Kb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(to),N=dm(B),P=(0,m.useSelect)((e=>e(to).getBlockName(B)),[B]),L=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:M}=_g(B),R=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,h.sprintf)(
78
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
79
- (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,g);let D=(0,h.__)("Link");N&&(D=M?(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
80
  (0,h.__)("%s link (locked)"),N.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
81
  (0,h.__)("%s link"),N.title));const O=N?(0,h.sprintf)(// translators: %s: The title of the block.
82
- (0,h.__)("Options for %s block"),N.title):(0,h.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=jb(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:L||(Y=3);const Z=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!L}),Q=y.includes(B)?y:[B];return(0,s.createElement)(Hb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:g,position:u,rowCount:f,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":R},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Wb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:R},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Bm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Im,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),L&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Mg,{clientIds:Q,icon:lg,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function qb(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Yb(t,n,o),0):1}const Yb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+qb(r,e,t,n):o+1};function Zb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d}=e,{expandedState:p,draggedClientIds:g}=jb(),h=t.filter(Boolean),f=h.length;let v=c;return(0,s.createElement)(s.Fragment,null,h.map(((e,t)=>{var c;const{clientId:b,innerBlocks:k}=e;t>0&&(v+=qb(h[t-1],p,g,d));const{itemInView:_}=u,y=_(v),E=t+1,C=i.length>0?`${i}_${E}`:`${E}`,S=!(null==k||!k.length),w=S?null!==(c=p[b])&&void 0!==c?c:d:void 0,B=!(null==g||!g.includes(b)),I=B||y,x=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(b,r),T=a||x&&S;return(0,s.createElement)(m.AsyncModeProvider,{key:b,value:!x},I&&(0,s.createElement)(Kb,{block:e,selectBlock:n,isSelected:x,isBranchSelected:T,isDragged:B,level:l,position:E,rowCount:f,siblingBlockCount:f,showBlockMovers:o,path:C,isExpanded:w,listPosition:v,selectedClientIds:r}),!I&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),S&&w&&!B&&(0,s.createElement)(Zb,{blocks:k,selectBlock:n,showBlockMovers:o,level:l+1,path:C,listPosition:v+1,fixedListWindow:u,isBranchSelected:T,selectedClientIds:r,isExpanded:d}))})))}Zb.defaultProps={selectBlock:()=>{}};const Qb=(0,s.memo)(Zb);function Xb(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:0,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Jb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const ek=["top","bottom"];const tk=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,nk=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:g}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(to);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:f}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(to),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(to),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(to),{getBlockType:g}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===jc.UP||r.keyCode===jc.DOWN||r.keyCode===jc.HOME||r.keyCode===jc.END);if(!m&&!p()&&!d())return void n(s,null);const f=c(),v=[...l(s),s];m&&!f.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===jc.HOME||r.keyCode===jc.END)&&S.length>1)return;const w=(0,u.difference)(f,S);let B;if(1===w.length){var I;const e=null===(I=g(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,h.sprintf)(
83
  /* translators: %s: block name */
84
  (0,h.__)("%s deselected."),e))}else w.length>1&&(B=(0,h.sprintf)(
85
  /* translators: %s: number of deselected blocks */
86
- (0,h.__)("%s blocks deselected."),w.length));B&&(0,Gt.speak)(B)}),[e,o,g,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(tk,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(to),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=eh(a,c),p=o(),g=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=nh(t,s,ek),u=Jb(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){g(e,e.currentTarget)},onDragEnd(){g.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(to);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:g[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,f,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),L=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[v]),M=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Xb,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:L},(0,s.createElement)($b.Provider,{value:M},(0,s.createElement)(Qb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:g,isExpanded:i}))))}));function ok(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:zb,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
87
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const rk=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;V()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(to).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(ok,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(nk,null))})}));function lk(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Gm(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)($d,{item:i,isStylePreview:!0})}function ik(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}const sk=()=>{};function ak(e){let{clientId:t,onSwitch:n=sk,onHoverClassName:o=sk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:g}=Wm({clientId:t,onSwitch:n}),[h,f]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(f,250),y=e=>{var t;h!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),f(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!k&&(0,s.createElement)(ik,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(lk,{activeStyle:a,className:g,genericPreviewBlock:m,style:h})))}ak.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};const ck=ak,uk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),dk=function(e){let{icon:t=uk,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},pk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),mk="carousel",gk="grid",hk=e=>{let{onBlockPatternSelect:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,h.__)("Choose")))},fk=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:km,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:bm,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))},vk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===mk,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:dl,label:(0,h.__)("Carousel view"),onClick:()=>n(mk),isPressed:c}),(0,s.createElement)(p.Button,{icon:pk,label:(0,h.__)("Grid view"),onClick:()=>n(gk),isPressed:t===gk}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(fk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,s.createElement)(hk,{onBlockPatternSelect:a}))},bk=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===mk){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(_k,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(kk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function kk(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(kk,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Ud,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function _k(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(_k,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(Ud,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}const yk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,a]=(0,s.useState)(mk),[c,u]=(0,s.useState)(0),{replaceBlock:d}=(0,m.useDispatch)(to),p=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(to),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==p||!p.length)return null;const g=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));d(t,n)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(bk,{viewMode:i,activeSlide:c,patterns:p,onBlockPatternSelect:g}),(0,s.createElement)(vk,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:p.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{g(p[c].blocks)}})))};function Ek(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:(0,s.createElement)(su,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)(
88
  /* translators: %s: Name of the block variation */
89
- (0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Ck(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:ym,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}const Sk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(to),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(to),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return!!l&&(l.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===l.length)}),[l]);if(null==l||!l.length)return null;const c=a?Ek:Ck;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},wk=(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette"),o=!To("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Bk=wk(p.ColorPalette);function Ik(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(rf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}const xk=window.wp.date,Tk=new Date(2022,0,25);function Nk(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,xk.dateI18n)(n,Tk))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Pk,{format:t,onChange:o}))}function Pk(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,h._x)("n/j/Y","short date format"),(0,h._x)("n/j/Y g:i A","short date format with time"),(0,h._x)("M j, Y","medium date format"),(0,h._x)("M j, Y g:i A","medium date format with time"),(0,h._x)("F j, Y","long date format"),(0,h._x)("M j","short date format without the year")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,xk.dateI18n)(e,Tk),format:e}))),i={key:"custom",name:(0,h.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,h.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,h.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,h.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,h.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const Lk=["colors","disableCustomColors","gradients","disableCustomGradients"],Mk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:a,title:g,showTitle:h=!0,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}=e;const k=(0,d.useInstanceId)(Mk),{batch:_}=(0,m.useRegistry)();return(0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(a,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,s.createElement)(p.__experimentalToolsPanel,{className:c()("block-editor-panel-color-gradient-settings",t),label:h?g:void 0,resetAll:()=>{_((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:k,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(cf,{settings:a,panelId:k,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:f,__experimentalIsRenderedInSidebar:v,enableAlpha:b}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",i))},Rk=e=>{const t=Mh();return t.colors=To("color.palette"),t.gradients=To("color.gradients"),(0,s.createElement)(Mk,i({},t,e))},Ak=e=>{const t=Rh();return(0,s.createElement)(Mk,i({},t,e))},Dk=e=>(0,u.every)(Lk,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Mk,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Ak,e):(0,s.createElement)(Rk,e);var Ok=function(e,t){return(Ok=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])})(e,t)},Fk=function(){return(Fk=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}).apply(this,arguments)};function zk(e,t,n,o){void 0===o&&(o=0);var r=Zk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function Vk(e,t,n,o,r){void 0===r&&(r=0);var l=Zk(t.width,t.height,r),i=l.width,s=l.height;return{x:Hk(e.x,i,n.width,o),y:Hk(e.y,s,n.height,o)}}function Hk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Gk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Uk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Wk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?$k:jk,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:Fk(Fk({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function $k(e,t){return Math.min(e,Math.max(0,t))}function jk(e,t){return t}function Kk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function qk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Yk(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function Zk(e,t,n){var o=e/2,r=t/2,l=[Yk(0,0,o,r,n),Yk(e,0,o,r,n),Yk(e,t,o,r,n),Yk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Qk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}const Xk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Kk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:zk(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Fk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?Vk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?Vk(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Wk(n.props.restrictPosition?Vk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?Vk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Ok(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=Gk(n,o),this.lastPinchRotation=Uk(n,o),this.onDragStart(qk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=qk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Gk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Uk(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,g=p.cropAreaStyle,h=p.mediaStyle,f=t.classes,v=f.containerClassName,b=f.cropAreaClassName,k=f.mediaClassName;return pi().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Qk("reactEasyCrop_Container",v)},n?pi().createElement("img",Fk({alt:"",className:Qk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Fk(Fk({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&pi().createElement("video",Fk({autoPlay:!0,loop:!0,muted:!0,className:Qk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Fk(Fk({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&pi().createElement("div",{style:Fk(Fk({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Qk("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(pi().Component),Jk={position:"bottom right",isAlternate:!0};const e_=(0,s.createContext)({}),t_=()=>(0,s.useContext)(e_);function n_(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[g,h]=(0,s.useState)(),[f,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(g+90)%360;let r=n/o;if(g%180==90&&(r=o/n),0===e)return i(),h(e),v(1/f),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180
1
+ (()=>{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:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):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:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function 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);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},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:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML="&nbsp;","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:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>hb,AlignmentToolbar:()=>fb,Autocomplete:()=>Bb,BlockAlignmentControl:()=>hl,BlockAlignmentToolbar:()=>fl,BlockBreadcrumb:()=>Lb,BlockColorsStyleSelector:()=>Ob,BlockContextProvider:()=>Tl,BlockControls:()=>po,BlockEdit:()=>Rl,BlockEditorKeyboardShortcuts:()=>CE,BlockEditorProvider:()=>pu,BlockFormatControls:()=>uo,BlockIcon:()=>su,BlockInspector:()=>bE,BlockList:()=>ph,BlockMover:()=>Im,BlockNavigationDropdown:()=>rk,BlockPreview:()=>Ud,BlockSelectionClearer:()=>hu,BlockSettingsMenu:()=>Mg,BlockSettingsMenuControls:()=>xg,BlockStyles:()=>ck,BlockTitle:()=>pm,BlockToolbar:()=>Gg,BlockTools:()=>kE,BlockVerticalAlignmentControl:()=>kr,BlockVerticalAlignmentToolbar:()=>_r,ButtonBlockAppender:()=>tm,ButtonBlockerAppender:()=>em,ColorPalette:()=>Bk,ColorPaletteControl:()=>Ik,ContrastChecker:()=>cf,CopyHandler:()=>cg,DefaultBlockAppender:()=>Xp,FontSizePicker:()=>Yf,InnerBlocks:()=>ah,Inserter:()=>Qp,InspectorAdvancedControls:()=>Ho,InspectorControls:()=>Go,JustifyContentControl:()=>Cr,JustifyToolbar:()=>Sr,LineHeightControl:()=>Pf,MediaPlaceholder:()=>cy,MediaReplaceFlow:()=>oy,MediaUpload:()=>J_,MediaUploadCheck:()=>ey,MultiSelectScrollIntoView:()=>SE,NavigableToolbar:()=>fm,ObserveTyping:()=>xE,PanelColorSettings:()=>uy,PlainText:()=>Wy,RichText:()=>Hy,RichTextShortcut:()=>Ky,RichTextToolbarButton:()=>qy,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>pE,ToolSelector:()=>Qy,Typewriter:()=>LE,URLInput:()=>S_,URLInputButton:()=>tE,URLPopover:()=>iy,Warning:()=>Al,WritingFlow:()=>Tu,__experimentalBlockAlignmentMatrixControl:()=>Nb,__experimentalBlockFullHeightAligmentControl:()=>xb,__experimentalBlockPatternSetup:()=>yk,__experimentalBlockPatternsList:()=>dp,__experimentalBlockVariationPicker:()=>dk,__experimentalBlockVariationTransforms:()=>Sk,__experimentalBorderRadiusControl:()=>Ih,__experimentalColorGradientControl:()=>of,__experimentalColorGradientSettingsDropdown:()=>af,__experimentalDateFormatPicker:()=>Nk,__experimentalDuotoneControl:()=>Ov,__experimentalFontAppearanceControl:()=>Nf,__experimentalFontFamilyControl:()=>Hf,__experimentalGetBorderClassesAndStyles:()=>Yv,__experimentalGetColorClassesAndStyles:()=>Qv,__experimentalGetElementClassName:()=>VE,__experimentalGetGapCSSValue:()=>ur,__experimentalGetGradientClass:()=>jh,__experimentalGetGradientObjectByGradientValue:()=>qh,__experimentalGetMatchingVariation:()=>GE,__experimentalGetSpacingClassesAndStyles:()=>eb,__experimentalImageEditingProvider:()=>n_,__experimentalImageEditor:()=>p_,__experimentalImageSizeControl:()=>h_,__experimentalImageURLInputUI:()=>cE,__experimentalInspectorPopoverHeader:()=>OE,__experimentalLayoutStyle:()=>rl,__experimentalLetterSpacingControl:()=>vv,__experimentalLibrary:()=>yE,__experimentalLinkControl:()=>Y_,__experimentalLinkControlSearchInput:()=>V_,__experimentalLinkControlSearchItem:()=>I_,__experimentalLinkControlSearchResults:()=>R_,__experimentalListView:()=>nk,__experimentalPanelColorGradientSettings:()=>Dk,__experimentalPreviewOptions:()=>uE,__experimentalPublishDateTimePicker:()=>FE,__experimentalRecursionProvider:()=>ME,__experimentalResponsiveBlockControl:()=>jy,__experimentalTextDecorationControl:()=>lv,__experimentalTextTransformControl:()=>mv,__experimentalUnitControl:()=>Xy,__experimentalUseBlockOverlayActive:()=>Rb,__experimentalUseBlockPreview:()=>Wd,__experimentalUseBorderProps:()=>Zv,__experimentalUseColorProps:()=>Jv,__experimentalUseCustomSides:()=>ir,__experimentalUseGradient:()=>Zh,__experimentalUseHasRecursion:()=>AE,__experimentalUseMultipleOriginColorsAndGradients:()=>Rh,__experimentalUseResizeCanvas:()=>dE,__unstableBlockNameContext:()=>Hg,__unstableBlockSettingsMenuFirstItem:()=>fg,__unstableBlockToolbarLastItem:()=>og,__unstableDuotoneFilter:()=>Fd,__unstableDuotoneStylesheet:()=>Dd,__unstableDuotoneUnsetStylesheet:()=>Od,__unstableEditorStyles:()=>Md,__unstableGetValuesFromColors:()=>Ad,__unstableIframe:()=>Lu,__unstableInserterMenuExtension:()=>Vp,__unstablePresetDuotoneFilter:()=>zd,__unstableRichTextInputEvent:()=>Yy,__unstableUseBlockSelectionClearer:()=>gu,__unstableUseClipboardHandler:()=>ag,__unstableUseMouseMoveTypingReset:()=>BE,__unstableUseTypewriter:()=>PE,__unstableUseTypingObserver:()=>IE,createCustomColorsHOC:()=>lb,getColorClassName:()=>Ph,getColorObjectByAttributeValues:()=>Th,getColorObjectByColorValue:()=>Nh,getFontSize:()=>jf,getFontSizeClass:()=>qf,getFontSizeObjectByValue:()=>Kf,getGradientSlugByValue:()=>Yh,getGradientValueBySlug:()=>Kh,getPxFromCssUnit:()=>XE,store:()=>to,storeConfig:()=>eo,transformStyles:()=>Pd,useBlockDisplayInformation:()=>um,useBlockEditContext:()=>lo,useBlockProps:()=>Zc,useCachedTruthy:()=>tb,useInnerBlocksProps:()=>sh,useSetting:()=>To,withColorContext:()=>wk,withColors:()=>ib,withFontSizes:()=>ab});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ft,__experimentalGetAllowedBlocks:()=>bt,__experimentalGetAllowedPatterns:()=>Et,__experimentalGetBlockListSettingsForBlocks:()=>xt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>_t,__experimentalGetPatternTransformItems:()=>St,__experimentalGetPatternsByBlockTypes:()=>Ct,__experimentalGetReusableBlockTitle:()=>Tt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetVisibleBlocks:()=>Ht,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,areInnerBlocksControlled:()=>Ot,canEditBlock:()=>at,canInsertBlockType:()=>nt,canInsertBlocks:()=>ot,canLockBlockType:()=>ct,canMoveBlock:()=>it,canMoveBlocks:()=>st,canRemoveBlock:()=>rt,canRemoveBlocks:()=>lt,didAutomaticChange:()=>At,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Ae,getBlockInsertionPoint:()=>Ye,getBlockListSettings:()=>wt,getBlockMode:()=>Ge,getBlockName:()=>U,getBlockOrder:()=>Me,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>ft,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ht,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>_e,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>ke,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>Bt,getTemplate:()=>Xe,getTemplateLock:()=>Je,hasBlockMovingClientId:()=>Mt,hasInserterItems:()=>vt,hasMultiSelection:()=>ze,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>Oe,isAncestorBeingDragged:()=>Ke,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>je,isBlockHighlighted:()=>Dt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,isBlockValid:()=>W,isBlockVisible:()=>Vt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>qe,isDraggingBlocks:()=>We,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>It,isMultiSelecting:()=>Ve,isNavigationMode:()=>Rt,isSelectionEnabled:()=>He,isTyping:()=>Ue,isValidTemplate:()=>Qe,wasBlockJustInserted:()=>zt});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>En,__unstableExpandSelection:()=>Sn,__unstableMarkAutomaticChange:()=>Un,__unstableMarkLastChangeAsPersistent:()=>Hn,__unstableMarkNextChangeAsNotPersistent:()=>Gn,__unstableSaveReusableBlock:()=>Vn,__unstableSplitSelection:()=>Cn,clearSelectedBlock:()=>rn,duplicateBlocks:()=>jn,enterFormattedText:()=>Mn,exitFormattedText:()=>An,flashBlock:()=>Zn,hideInsertionPoint:()=>bn,insertAfterBlock:()=>qn,insertBeforeBlock:()=>Kn,insertBlock:()=>hn,insertBlocks:()=>fn,insertDefaultBlock:()=>On,mergeBlocks:()=>wn,moveBlockToPosition:()=>gn,moveBlocksDown:()=>dn,moveBlocksToPosition:()=>mn,moveBlocksUp:()=>pn,multiSelect:()=>on,receiveBlocks:()=>Yt,removeBlock:()=>In,removeBlocks:()=>Bn,replaceBlock:()=>cn,replaceBlocks:()=>an,replaceInnerBlocks:()=>xn,resetBlocks:()=>jt,resetSelection:()=>qt,selectBlock:()=>Xt,selectNextBlock:()=>en,selectPreviousBlock:()=>Jt,selectionChange:()=>Dn,setBlockMovingClientId:()=>$n,setBlockVisibility:()=>Xn,setHasControlledInnerBlocks:()=>Qn,setNavigationMode:()=>Wn,setTemplateValidity:()=>kn,showInsertionPoint:()=>vn,startDraggingBlocks:()=>Ln,startMultiSelect:()=>tn,startTyping:()=>Nn,stopDraggingBlocks:()=>Rn,stopMultiSelect:()=>nn,stopTyping:()=>Pn,synchronizeTemplate:()=>yn,toggleBlockHighlight:()=>Yn,toggleBlockMode:()=>Tn,toggleSelection:()=>ln,updateBlock:()=>Qt,updateBlockAttributes:()=>Zt,updateBlockListSettings:()=>Fn,updateSettings:()=>zn,validateBlocksToTemplate:()=>Kt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={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")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function 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)}const _=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,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=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]: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=y(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,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,m.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;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]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,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"SET_BLOCK_VISIBILITY":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}});var L={};function R(e){return[e]}function M(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||R;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(L)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,l)),s.get(L)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!M(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(M(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),F=window.wp.richText,z=window.wp.deprecated;var V=n.n(z);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ot(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Me(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Me(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function ke(e){return e.initialPosition}const _e=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=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 ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:_e(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[..._e.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return(0,u.first)(ye(e))||null}function Se(e){return(0,u.last)(ye(e))||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=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=j(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=j(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,F.create)({html:g,...H(f)}),k=(0,F.create)({html:h,...H(v)});return b=(0,F.remove)(b,0,a.offset),k=(0,F.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,F.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,F.toHTMLString)({value:k,...H(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||G}function Ae(e,t){return Me(e,de(e,t)).indexOf(t)}function De(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>De(e,t)||Be(e,t)||n&&Oe(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ve(e){return e.isMultiSelecting}function He(e){return e.isSelectionEnabled}function Ge(e,t){return e.blocksMode[t]||"visual"}function Ue(e){return e.isTyping}function We(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function je(e,t){return e.draggedBlocks.includes(t)}function Ke(e,t){if(!We(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>je(e,t)))}function qe(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ye(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=Ae(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Je(e,t){if(!t)return e.settings.templateLock;const n=wt(e,t);return n?n.templateLock:null}const et=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},tt=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}=Bt(e),s=et(i,t,!0);if(!s)return!1;const a=!!Je(e,o);if(a)return!1;const c=wt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=et(d,t),m=n.parent,g=U(e,o),h=et(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>et(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},nt=A(tt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}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){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:r}=o,l="all"===Je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ct(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ut(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 dt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&tt(e,t.name,n),pt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ut(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:mt(r,l)}},mt=(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)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=ut(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:mt(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=A((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=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=ut(e,l)||{},c=mt(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=>dt(e,n,t))).map(n),a=tt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=pt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),ft=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>dt(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>dt(e,n,t)));if(n)return!0;const o=tt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>dt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),_t=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),yt=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return _t(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!et(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])),Et=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=yt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return nt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Ct=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Et(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)=>[...Et.getDependants(e,t)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ot(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Ct(e,o,n)}),((e,t)=>[...Ct.getDependants(e,t)]));function wt(e,t){return e.blockListSettings[t]}function Bt(e){return e.settings}function It(e){return e.blocks.isPersistentChange}const xt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Tt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Nt(e){return e.blocks.isIgnoredChange}function Pt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function At(e){return!!e.automaticChangeStatus}function Dt(e,t){return e.highlightedBlock===t}function Ot(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ft=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function zt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Vt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ht=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Gt=window.wp.a11y,Ut="†";function Wt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Ut)}))}const $t=e=>Array.isArray(e)?e:[e],jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Kt(e))},Kt=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 qt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Yt(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Zt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:$t(e),attributes:t,uniqueByBlock:n}}function Qt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function tn(){return{type:"START_MULTI_SELECT"}}function nn(){return{type:"STOP_MULTI_SELECT"}}const on=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,Gt.speak)((0,h.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
+ (0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function rn(){return{type:"CLEAR_SELECTED_BLOCK"}}function ln(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sn(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 an=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=$t(e),t=sn($t(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function cn(e,t){return an(e,t)}const un=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:$t(t),rootClientId:n})},dn=un("MOVE_BLOCKS_DOWN"),pn=un("MOVE_BLOCKS_UP"),mn=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 gn(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 mn([e],t,n,o)}function hn(e,t,n,o,r){return fn([e],t,n,o,0,r)}const fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=sn($t(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 vn(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 bn(){return{type:"HIDE_INSERTION_POINT"}}function kn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const yn=()=>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)},En=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,r.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.attributes[f.attributeKey];let w=(0,F.create)({html:y,...H(C)}),B=(0,F.create)({html:E,...H(S)});w=(0,F.remove)(w,h.offset,w.text.length),B=(0,F.insert)(B,Ut,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,F.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(k,{[f.attributeKey]:(0,F.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===k.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Wt(P),R=P[L],M=(0,F.create)({html:R,...H(g.attributes[L])}),A=M.text.indexOf(Ut),D=(0,F.remove)(M,A,A+1),O=(0,F.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const z=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Cn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,F.create)({html:f,...H(b)}),y=(0,F.create)({html:v,...H(k)});_=(0,F.remove)(_,u.offset,_.text.length),y=(0,F.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,F.toHTMLString)({value:_,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,F.toHTMLString)({value:y,...H(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},wn=(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),u=(0,r.getBlockType)(c.name);if(u&&!u.merge)return void l.selectBlock(c.clientId);const d=o.getBlock(a),p=(0,r.getBlockType)(d.name),{clientId:m,attributeKey:g,offset:h}=o.getSelectionStart(),f=(m===s?u:p).attributes[g],v=(m===s||m===a)&&void 0!==g&&void 0!==h&&!!f;f||("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 b=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(d);if(v){const e=m===s?b:k,t=e.attributes[g],n=(0,F.insert)((0,F.create)({html:t,...H(f)}),Ut,h,h);e.attributes[g]=(0,F.toHTMLString)({value:n,...H(f)})}const _=c.name===d.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!_||!_.length)return;const y=u.merge(b.attributes,_[0].attributes);if(v){const e=Wt(y),t=y[e],n=(0,F.create)({html:t,...H(u.attributes[e])}),o=n.text.indexOf(Ut),r=(0,F.remove)(n,o,o+1),i=(0,F.toHTMLString)({value:r,...H(u.attributes[e])});y[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},..._.slice(1)],0)},Bn=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=$t(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 In(e,t){return Bn([e],t)}function xn(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 Tn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Nn(){return{type:"START_TYPING"}}function Pn(){return{type:"STOP_TYPING"}}function Ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Rn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Mn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function An(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Dn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const On=(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 Fn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function zn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Vn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Hn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Gn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Un=()=>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"})}))},Wn=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,Gt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Gt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},$n=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,Gt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=$t(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(u,c+1,s,t),u.length>1&&t&&l.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Kn=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)},qn=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 Yn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Zn=e=>async t=>{let{dispatch:n}=t;n(Yn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Yn(e,!1))};function Qn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Jn="core/block-editor",eo={reducer:P,selectors:e,actions:t},to=(0,m.createReduxStore)(Jn,{...eo,persist:["preferences"]});(0,m.registerStore)(Jn,{...eo,persist:["preferences"]});const no={name:"",isSelected:!1},oo=(0,s.createContext)(no),{Provider:ro}=oo;function lo(){return(0,s.useContext)(oo)}function io(){const{isSelected:e,clientId:t,name:n}=lo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(to);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function so(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=io(),{clientId:o}=lo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(to),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{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 ao(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[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 co=so;co.Slot=ao;const uo=e=>(0,s.createElement)(so,i({group:"inline"},e));uo.Slot=e=>(0,s.createElement)(ao,i({group:"inline"},e));const po=co,mo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),fo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function _o(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${ko(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}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,clientId:n}=lo();return(0,m.useSelect)((o=>{if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>xo[e]||e)(e);[...o(to).getBlockParents(n),n].forEach((e=>{const n=o(to).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(to).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(to).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Io[i]?Io[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const 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=io(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{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 Lo=e=>e,Ro=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Ro),Lo);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 Ao(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 Do(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 Oo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(to),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(to),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:Ro(r.style)},t[n]=r})),r(n,t,!0)}),[Ro,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 Fo(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 zo(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)(Oo,{group:n,label:o},(0,s.createElement)(Fo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Vo=Po;Vo.Slot=zo;const Ho=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Ho.Slot=e=>(0,s.createElement)(zo,i({},e,{__experimentalGroup:"advanced"})),Ho.slotName="InspectorAdvancedControls";const Go=Vo,Uo=window.wp.isShallowEqual;var Wo=n.n(Uo);const $o=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])};function jo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=wo(t),g=wo(null!=n?n:t),h=$o(u),f=(0,s.useMemo)((()=>m&&g===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,g,r]);if(!m||n&&!g)return null;const v={top:m,bottom:g};return(0,s.createElement)(p.Popover,i({ref:h,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:f},o),!l&&o)}function Ko(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.margin)}function qo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!sr(e,"margin");return!Ko(e)||t||n}function Yo(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=ir(n,"margin"),a=i&&i.some((e=>or.includes(e)));return qo(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:Ro(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Zo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Qo(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.padding)}function Xo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!sr(e,"padding");return!Qo(e)||t||n}function Jo(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=ir(n,"padding"),a=i&&i.some((e=>or.includes(e)));return Xo(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:Ro(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function er(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const tr="spacing",nr=["top","right","bottom","left"],or=["vertical","horizontal"];function rr(e){const t=dr(e),n=Xo(e),o=qo(e),l=lr(e),i=(a=e.name,"web"===s.Platform.OS&&(ar(a)||Qo(a)||Ko(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[tr,"__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)(s.Fragment,null,(0,s.createElement)(Go,{__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,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(Yo,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,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(pr,e))),!n&&(0,s.createElement)(er,e),!o&&(0,s.createElement)(Zo,e))}const lr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=dr(e),n=Xo(e),o=qo(e);return t&&n&&o};function ir(e,t){var n;const o=(0,r.getBlockSupport)(e,tr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function sr(e,t){const n=ir(e,t);return!(n&&n.some((e=>nr.includes(e)))&&n.some((e=>or.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function ar(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.blockGap)}function cr(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 ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=cr(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}`}function dr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.blockGap");return!ar(e)||t}function pr(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=ir(r,"blockGap"),c=So(n);if(dr(e))return null;const u=a&&a.some((e=>or.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...cr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Ro(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=cr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=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,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const mr=(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"})),gr=(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"})),hr={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,h._x)("Align top","Block vertical alignment setting")},center:{icon:gr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:mr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},fr=["top","center","bottom"],vr={isAlternate:!0},br=function(e){let{value:t,onChange:n,controls:o=fr,isCollapsed:r=!0,isToolbar:l}=e;const a=hr[t],c=hr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:vr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...hr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},kr=e=>(0,s.createElement)(br,i({},e,{isToolbar:!1})),_r=e=>(0,s.createElement)(br,i({},e,{isToolbar:!0})),yr={left:mo,center:go,right:ho,"space-between":fo},Er=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?yr[r]:yr.left,d=[{name:"left",icon:mo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Cr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!1})),Sr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!0})),wr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Br={left:"flex-start",right:"flex-end",center:"center"},Ir={top:"flex-start",center:"center",bottom:"flex-end"},xr=["wrap","nowrap"],Tr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Pr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Rr,{layout:t,onChange:n}))),(0,s.createElement)(Lr,{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)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Nr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Do(i,"spacing","blockGap")?ur(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap):void 0,d=wr[r.justifyContent],p=xr.includes(r.flexWrap)?r.flexWrap:"wrap",m=Ir[r.verticalAlignment],g=Br[r.justifyContent]||Br.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${ko(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=_o(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Nr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=Ir.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(kr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Pr(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)(Cr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,h.__)("Justify items left")},{value:"center",icon:go,label:(0,h.__)("Justify items center")},{value:"right",icon:ho,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Lr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Rr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const Mr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Ar=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),Or="var:";function Fr(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:Vr(r)}]:[]}function zr(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=Vr((0,u.get)(l,[n]));return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",Hr(n)),value:r}),e}),[]);i.push(...e)}return i}function Vr(e){return"string"==typeof e&&e.startsWith(Or)?`var(--wp--${e.slice(Or.length).split("|").join("--")})`:e}function Hr(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const Gr={name:"radius",generate:(e,t)=>zr(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Ur=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return Fr(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return Fr(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return Fr(e,t,n,o)}}],Wr=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?Ur.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${Hr(e)}${Hr(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},$r={name:"borderTop",generate:Wr("top")},jr={name:"borderRight",generate:Wr("right")},Kr={name:"borderBottom",generate:Wr("bottom")},qr={name:"borderLeft",generate:Wr("left")},Yr=[...Ur,Gr,$r,jr,Kr,qr,{name:"text",generate:(e,t)=>Fr(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>Fr(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>Fr(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>zr(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>zr(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontSize",generate:(e,t)=>Fr(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>Fr(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>Fr(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>Fr(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>Fr(e,t,["typography","textTransform"],"textTransform")}];function Zr(e,t){const n=Qr(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,u.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const o=(0,u.groupBy)(n,"selector");return Object.keys(o).reduce(((e,t)=>(e.push(`${t} { ${o[t].map((e=>`${(0,u.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Qr(e,t){const n=[];return Yr.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const Xr=[{name:"default",label:(0,h.__)("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,h.__)("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)(Mr,{icon:Ar})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Mr,{icon:Dr}))),(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,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u}=r,d=cr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),p=null!=d&&d.top&&!Do(i,"spacing","blockGap")?null==d?void 0:d.top:"";let m=c||u?`\n\t\t\t\t\t${ko(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: 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(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&Qr(l).forEach((e=>{"paddingRight"===e.key?m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&p&&(m+=_o(o,a,"default",p)),m},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,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
+ o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}(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}},Tr];function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Xr.find((t=>t.name===e))}const el={type:"default"},tl=(0,s.createContext)(el),nl=tl.Provider;function ol(){return(0,s.useContext)(tl)}function rl(e){let{layout:t={},css:n,...o}=e;const r=Jr(t.type),l=null!==To("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const ll=["none","left","center","right","wide","full"],il=["wide","full"];function sl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=ol(),r=Jr(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=ll}=o,s=e.filter((e=>(o.alignments||t||!il.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const al=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),cl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),ul=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),dl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),pl={none:{icon:al,title:(0,h._x)("None","Alignment option")},left:{icon:cl,title:(0,h.__)("Align left")},center:{icon:Ar,title:(0,h.__)("Align center")},right:{icon:ul,title:(0,h.__)("Align right")},wide:{icon:Dr,title:(0,h.__)("Wide width")},full:{icon:dl,title:(0,h.__)("Full width")}},ml={isAlternate:!0},gl=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=sl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=pl[t],m=pl.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:ml,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...pl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{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}=pl[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)(g,i({},f,v))},hl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!1})),fl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!0})),vl=["left","center","right","wide","full"],bl=["wide","full"];function kl(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)?vl.filter((t=>e.includes(t))):!0===e?[...vl]:[],!o||!0===e&&!n?(0,u.without)(t,...bl):t}const _l=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=sl(kl((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)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(hl,{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"),yl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=sl(kl((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:[...vl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",yl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",_l),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return kl((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 El=/[\s#]/g,Cl={type:"string",source:"attribute",attribute:"id",selector:"*"},Sl=(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,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(El,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Go,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("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:Cl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Sl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const wl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:wl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Bl=(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)(Go,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Bl),(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 Il=window.wp.dom,xl=(0,s.createContext)({});function Tl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(xl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(xl.Provider,{value:r,children:n})}const Nl=xl,Pl={},Ll=(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):Pl),[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 Rl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(ro,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Ll,e))}const Ml=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Al=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:Ml,label:(0,h.__)("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))))))))))};var Dl=n(1973);function Ol(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,Il.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const Fl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,Dl.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Ol,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Ol,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},zl=e=>(0,r.rawHandler)({HTML:e.originalContent}),Vl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(to).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(to);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,zl(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)),[]),g=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
  title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Al,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
+ (0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Fl,{block:i,onKeep:t,onConvert:n,convertor:zl,convertButtonText:(0,h.__)("Convert to Blocks")})))})),Hl=(0,s.createElement)(Al,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),Gl=()=>Hl;class Ul extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Wl=Ul;var $l=n(773);const jl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(to).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)($l.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=ci();const ql=e=>li(e,Kl);let Yl=ci();ql.write=e=>li(e,Yl);let Zl=ci();ql.onStart=e=>li(e,Zl);let Ql=ci();ql.onFrame=e=>li(e,Ql);let Xl=ci();ql.onFinish=e=>li(e,Xl);let Jl=[];ql.setTimeout=(e,t)=>{let n=ql.now()+t,o=()=>{let e=Jl.findIndex((e=>e.cancel==o));~e&&Jl.splice(e,1),oi-=~e?1:0},r={time:n,handler:e,cancel:o};return Jl.splice(ei(n),0,r),oi+=1,ii(),r};let ei=e=>~(~Jl.findIndex((t=>t.time>e))||~Jl.length);ql.cancel=e=>{Zl.delete(e),Ql.delete(e),Kl.delete(e),Yl.delete(e),Xl.delete(e)},ql.sync=e=>{ri=!0,ql.batchedUpdates(e),ri=!1},ql.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ql.onStart(n)}return o.handler=e,o.cancel=()=>{Zl.delete(n),t=null},o};let ti="undefined"!=typeof window?window.requestAnimationFrame:()=>{};ql.use=e=>ti=e,ql.now="undefined"!=typeof performance?()=>performance.now():Date.now,ql.batchedUpdates=e=>e(),ql.catch=console.error,ql.frameLoop="always",ql.advance=()=>{"demand"!==ql.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ai()};let ni=-1,oi=0,ri=!1;function li(e,t){ri?(t.delete(e),e(0)):(t.add(e),ii())}function ii(){ni<0&&(ni=0,"demand"!==ql.frameLoop&&ti(si))}function si(){~ni&&(ti(si),ql.batchedUpdates(ai))}function ai(){let e=ni;ni=ql.now();let t=ei(ni);t&&(ui(Jl.splice(0,t),(e=>e.handler())),oi-=t),Zl.flush(),Kl.flush(e?Math.min(64,ni-e):16.667),Ql.flush(),Yl.flush(),Xl.flush(),oi||(ni=-1)}function ci(){let e=new Set,t=e;return{add(n){oi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(oi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,oi-=t.size,ui(t,(t=>t(n)&&e.add(t))),oi+=e.size,t=e)}}}function ui(e,t){e.forEach((e=>{try{t(e)}catch(e){ql.catch(e)}}))}var di=n(9196),pi=n.n(di);function mi(){}const gi={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 hi(e,t){if(gi.arr(e)){if(!gi.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 fi=(e,t)=>e.forEach(t);function vi(e,t,n){if(gi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const bi=e=>gi.und(e)?[]:gi.arr(e)?e:[e];function ki(e,t){if(e.size){const n=Array.from(e);e.clear(),fi(n,t)}}const _i=(e,...t)=>ki(e,(e=>e(...t))),yi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Ei,Ci,Si=null,wi=!1,Bi=mi;var Ii=Object.freeze({__proto__:null,get createStringInterpolator(){return Ei},get to(){return Ci},get colors(){return Si},get skipAnimation(){return wi},get willAdvance(){return Bi},assign:e=>{e.to&&(Ci=e.to),e.now&&(ql.now=e.now),void 0!==e.colors&&(Si=e.colors),null!=e.skipAnimation&&(wi=e.skipAnimation),e.createStringInterpolator&&(Ei=e.createStringInterpolator),e.requestAnimationFrame&&ql.use(e.requestAnimationFrame),e.batchedUpdates&&(ql.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Bi=e.willAdvance),e.frameLoop&&(ql.frameLoop=e.frameLoop)}});const xi=new Set;let Ti=[],Ni=[],Pi=0;const Li={get idle(){return!xi.size&&!Ti.length},start(e){Pi>e.priority?(xi.add(e),ql.onStart(Ri)):(Mi(e),ql(Di))},advance:Di,sort(e){if(Pi)ql.onFrame((()=>Li.sort(e)));else{const t=Ti.indexOf(e);~t&&(Ti.splice(t,1),Ai(e))}},clear(){Ti=[],xi.clear()}};function Ri(){xi.forEach(Mi),xi.clear(),ql(Di)}function Mi(e){Ti.includes(e)||Ai(e)}function Ai(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 Di(e){const t=Ni;for(let n=0;n<Ti.length;n++){const o=Ti[n];Pi=o.priority,o.idle||(Bi(o),o.advance(e),o.idle||t.push(o))}return Pi=0,Ni=Ti,Ni.length=0,Ti=t,Ti.length>0}const Oi="[-+]?\\d*\\.?\\d+",Fi=Oi+"%";function zi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Vi=new RegExp("rgb"+zi(Oi,Oi,Oi)),Hi=new RegExp("rgba"+zi(Oi,Oi,Oi,Oi)),Gi=new RegExp("hsl"+zi(Oi,Fi,Fi)),Ui=new RegExp("hsla"+zi(Oi,Fi,Fi,Oi)),Wi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,$i=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ji=/^#([0-9a-fA-F]{6})$/,Ki=/^#([0-9a-fA-F]{8})$/;function qi(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=qi(r,o,e+1/3),i=qi(r,o,e),s=qi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Zi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Qi(e){return(parseFloat(e)%360+360)%360/360}function Xi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ji(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function es(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ji.exec(e))?parseInt(t[1]+"ff",16)>>>0:Si&&void 0!==Si[e]?Si[e]:(t=Vi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|255)>>>0:(t=Hi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|Xi(t[4]))>>>0:(t=Wi.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=$i.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Gi.exec(e))?(255|Yi(Qi(t[1]),Ji(t[2]),Ji(t[3])))>>>0:(t=Ui.exec(e))?(Yi(Qi(t[1]),Ji(t[2]),Ji(t[3]))|Xi(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 ts=(e,t,n)=>{if(gi.fun(e))return e;if(gi.arr(e))return ts({range:e,output:t,extrapolate:n});if(gi.str(e.output[0]))return Ei(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 ns(){return(ns=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 os=Symbol.for("FluidValue.get"),rs=Symbol.for("FluidValue.observers"),ls=e=>Boolean(e&&e[os]),is=e=>e&&e[os]?e[os]():e,ss=e=>e[rs]||null;function as(e,t){let n=e[rs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class cs{constructor(e){if(this[os]=void 0,this[rs]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");us(this,e)}}const us=(e,t)=>ms(e,os,t);function ds(e,t){if(e[os]){let n=e[rs];n||ms(e,rs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ps(e,t){let n=e[rs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[rs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ms=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),gs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fs=new RegExp(`(${gs.source})(%|[a-z]+)`,"i"),vs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ks=e=>{const[t,n]=_s(e);if(!t||yi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&bs.test(n)?ks(n):n||e},_s=e=>{const t=bs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let ys;const Es=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Cs=e=>{ys||(ys=Si?new RegExp(`(${Object.keys(Si).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>is(e).replace(bs,ks).replace(hs,es).replace(ys,es))),n=t.map((e=>e.match(gs).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=>ts(ns({},e,{output:t}))));return e=>{var n;const r=!fs.test(t[0])&&(null==(n=t.find((e=>fs.test(e))))?void 0:n.replace(gs,""));let l=0;return t[0].replace(gs,(()=>`${o[l++](e)}${r||""}`)).replace(vs,Es)}},Ss="react-spring: ",ws=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ss}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Bs=ws(console.warn),Is=ws(console.warn);function xs(e){return gi.str(e)&&("#"==e[0]||/\d/.test(e)||!yi()&&bs.test(e)||e in(Si||{}))}const Ts="undefined"!=typeof window&&window.document&&window.document.createElement?di.useLayoutEffect:di.useEffect;function Ns(){const e=(0,di.useState)()[1],t=(()=>{const e=(0,di.useRef)(!1);return Ts((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ps=e=>(0,di.useEffect)(e,Ls),Ls=[];function Rs(e){const t=(0,di.useRef)();return(0,di.useEffect)((()=>{t.current=e})),t.current}const Ms=Symbol.for("Animated:node"),As=e=>e&&e[Ms],Ds=(e,t)=>{return n=e,o=Ms,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Os=e=>e&&e[Ms]&&e[Ms].getPayload();class Fs{constructor(){this.payload=void 0,Ds(this,this)}getPayload(){return this.payload||[]}}class zs extends Fs{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,gi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new zs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return gi.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,gi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Vs extends zs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ts({output:[e,e]})}static create(e){return new Vs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(gi.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=ts({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Hs={dependencies:null};class Gs extends Fs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return vi(this.source,((n,o)=>{var r;(r=n)&&r[Ms]===r?t[o]=n.getValue(e):ls(n)?t[o]=is(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&fi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return vi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Hs.dependencies&&ls(e)&&Hs.dependencies.add(e);const t=Os(e);t&&fi(t,(e=>this.add(e)))}}class Us extends Gs{constructor(e){super(e)}static create(e){return new Us(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(Ws)),!0)}}function Ws(e){return(xs(e)?Vs:zs).create(e)}function $s(e){const t=As(e);return t?t.constructor:gi.arr(e)?Us:xs(e)?Vs:zs}function js(){return(js=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 Ks=(e,t)=>{const n=!gi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,di.forwardRef)(((o,r)=>{const l=(0,di.useRef)(null),i=n&&(0,di.useCallback)((e=>{l.current=function(e,t){return e&&(gi.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Hs.dependencies=n,e.style&&(e=js({},e,{style:t.createAnimatedStyle(e.style)})),e=new Gs(e),Hs.dependencies=null,[e,n]}(o,t),c=Ns(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new qs(u,a),p=(0,di.useRef)();Ts((()=>(p.current=d,fi(a,(e=>ds(e,d))),()=>{p.current&&(fi(p.current.deps,(e=>ps(e,p.current))),ql.cancel(p.current.update))}))),(0,di.useEffect)(u,[]),Ps((()=>()=>{const e=p.current;fi(e.deps,(t=>ps(t,e)))}));const m=t.getComponentProps(s.getValue());return di.createElement(e,js({},m,{ref:i}))}))};class qs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ql.write(this.update)}}const Ys=Symbol.for("AnimatedComponent"),Zs=e=>gi.str(e)?e:e&&gi.str(e.displayName)?e.displayName:gi.fun(e)&&e.name||null;function Qs(){return(Qs=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 Xs(e,...t){return gi.fun(e)?e(...t):e}const Js=(e,t)=>!0===e||!!(t&&e&&(gi.fun(e)?e(t):bi(e).includes(t))),ea=(e,t)=>gi.obj(e)?t&&e[t]:e,ta=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,na=e=>e,oa=(e,t=na)=>{let n=ra;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);gi.und(n)||(o[r]=n)}return o},ra=["config","onProps","onStart","onChange","onPause","onResume","onRest"],la={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 ia(e){const t=function(e){const t={};let n=0;if(vi(e,((e,o)=>{la[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return vi(e,((e,o)=>o in t||(n[o]=e))),n}return Qs({},e)}function sa(e){return e=is(e),gi.arr(e)?e.map(sa):xs(e)?Ii.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function aa(e){for(const t in e)return!0;return!1}function ca(e){return gi.fun(e)||gi.arr(e)&&gi.obj(e[0])}function ua(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function da(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const pa=Qs({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class ma{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,pa)}}function ga(e,t){if(gi.und(t.decay)){const n=!gi.und(t.tension)||!gi.und(t.friction);!n&&gi.und(t.frequency)&&gi.und(t.damping)&&gi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ha=[];class fa{constructor(){this.changed=!1,this.values=ha,this.toValues=null,this.fromValues=ha,this.to=void 0,this.from=void 0,this.config=new ma,this.immediate=!1}}function va(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Js(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{gi.und(n.pause)||(r.paused=Js(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Js(e,t)),c=Xs(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-ql.now()}function m(){c>0&&!Ii.skipAnimation?(r.delayed=!0,u=ql.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Qs({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const ba=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ya(e.get()):t.every((e=>e.noop))?ka(e.get()):_a(e.get(),t.every((e=>e.finished))),ka=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),_a=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ya=e=>({value:e,cancelled:!0,finished:!1});function Ea(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=oa(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)&&ya(o)||r!==n.asyncId&&_a(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Sa,i=new wa;return(async()=>{if(Ii.skipAnimation)throw Ca(n),i.result=_a(o,!1),d(i),i;m(l);const s=gi.obj(e)?Qs({},e):Qs({},t,{to:e});s.parentId=r,vi(c,((e,t)=>{gi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Ii.skipAnimation)return Ca(n),_a(o,!1);try{let t;t=gi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=_a(o.get(),!0,!1)}catch(e){if(e instanceof Sa)h=e.result;else{if(!(e instanceof wa))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return gi.fun(i)&&ql.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Ca(e,t){ki(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Sa 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 wa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ba=e=>e instanceof xa;let Ia=1;class xa extends cs{constructor(...e){super(...e),this.id=Ia++,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=As(this);return e&&e.getValue()}to(...e){return Ii.to(this,e)}interpolate(...e){return Bs(`${Ss}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ii.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){as(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Li.sort(this),as(this,{type:"priority",parent:this,priority:e})}}const Ta=Symbol.for("SpringPhase"),Na=e=>(1&e[Ta])>0,Pa=e=>(2&e[Ta])>0,La=e=>(4&e[Ta])>0,Ra=(e,t)=>t?e[Ta]|=3:e[Ta]&=-3,Ma=(e,t)=>t?e[Ta]|=4:e[Ta]&=-5;class Aa extends xa{constructor(e,t){if(super(),this.key=void 0,this.animation=new fa,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!gi.und(e)||!gi.und(t)){const n=gi.obj(e)?Qs({},e):Qs({},t,{from:e});gi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Pa(this)||this._state.asyncTo)||La(this)}get goal(){return is(this.animation.to)}get velocity(){const e=As(this);return e instanceof zs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Na(this)}get isAnimating(){return Pa(this)}get isPaused(){return La(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=Os(o.to);!i&&ls(o.to)&&(l=bi(is(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Vs?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=gi.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(gi.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=!gi.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=As(this),a=s.getValue();if(t){const e=is(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 ql.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Pa(this)){const{to:e,config:t}=this.animation;ql.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 gi.und(e)?(n=this.queue||[],this.queue=[]):n=[gi.obj(e)?e:Qs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>ba(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ca(this._state,e&&this._lastCallId),ql.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=gi.obj(n)?n[t]:n,(null==n||ca(n))&&(n=void 0),o=gi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Na(this)||(e.reverse&&([n,o]=[o,n]),o=is(o),gi.und(o)?As(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Qs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,oa(n,((e,t)=>/^on/.test(t)?ea(e,o):e))),Ga(this,n,"onProps"),Ua(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 va(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{La(this)||(Ma(this,!0),_i(i.pauseQueue),Ua(this,"onPause",_a(this,Da(this,this.animation.to)),this))},resume:()=>{La(this)&&(Ma(this,!1),Pa(this)&&this._resume(),_i(i.resumeQueue),Ua(this,"onResume",_a(this,Da(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Oa(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ya(this));const o=!gi.und(e.to),r=!gi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ya(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&&!gi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!hi(d,c);p&&(s.from=d),d=is(d);const m=!hi(u,a);m&&this._focus(u);const g=ca(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(ga(n=Qs({},n),t),t=Qs({},n,t)),ga(e,t),Object.assign(e,t);for(const t in pa)null==e[t]&&(e[t]=pa[t]);let{mass:o,frequency:r,damping:l}=e;gi.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,Xs(t.config,l),t.config!==i.config?Xs(i.config,l):void 0);let b=As(this);if(!b||gi.und(u))return n(_a(this,!0));const k=gi.und(t.reset)?r&&!t.default:!gi.und(d)&&Js(t.reset,l),_=k?d:this.get(),y=sa(u),E=gi.num(y)||gi.arr(y)||xs(y),C=!g&&(!E||Js(i.immediate||t.immediate,l));if(m){const e=$s(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=ls(u),B=!1;if(!w){const e=k||!Na(this)&&p;(m||e)&&(B=hi(sa(_),y),w=!B),(hi(s.immediate,C)||C)&&hi(h.decay,f)&&hi(h.velocity,v)||(w=!0)}if(B&&Pa(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||ls(a))&&(s.values=b.getPayload(),s.toValues=ls(u)?null:S==Vs?[1]:bi(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;fi(Ha,(e=>Ga(this,t,e)));const o=_a(this,Da(this,a));_i(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&ql.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Xs(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(Ea(t.to,t,this._state,this)):w?this._start():Pa(this)&&!m?this._pendingCalls.add(n):n(ka(_))}_focus(e){const t=this.animation;e!==t.to&&(ss(this)&&this._detach(),t.to=e,ss(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ls(t)&&(ds(t,this),Ba(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ls(e)&&ps(e,this)}_set(e,t=!0){const n=is(e);if(!gi.und(n)){const e=As(this);if(!e||!hi(n,e.getValue())){const o=$s(n);e&&e.constructor==o?e.setValue(n):Ds(this,o.create(n)),e&&ql.batchedUpdates((()=>{this._onChange(n,t)}))}}return As(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ua(this,"onStart",_a(this,Da(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Xs(this.animation.onChange,e,this)),Xs(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;As(this).reset(is(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Pa(this)||(Ra(this,!0),La(this)||this._resume())}_resume(){Ii.skipAnimation?this.finish():Li.start(this)}_stop(e,t){if(Pa(this)){Ra(this,!1);const n=this.animation;fi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),as(this,{type:"idle",parent:this});const o=t?ya(this.get()):_a(this.get(),Da(this,null!=e?e:n.to));_i(this._pendingCalls,o),n.changed&&(n.changed=!1,Ua(this,"onRest",o,this))}}}function Da(e,t){const n=sa(t);return hi(sa(e.get()),n)}function Oa(e,t=e.loop,n=e.to){let o=Xs(t);if(o){const r=!0!==o&&ia(o),l=(r||e).reverse,i=!r||r.reset;return Fa(Qs({},e,{loop:t,default:!1,pause:void 0,to:!l||ca(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Fa(e){const{to:t,from:n}=e=ia(e),o=new Set;return gi.obj(t)&&Va(t,o),gi.obj(n)&&Va(n,o),e.keys=o.size?Array.from(o):null,e}function za(e){const t=Fa(e);return gi.und(t.default)&&(t.default=oa(t)),t}function Va(e,t){vi(e,((e,n)=>null!=e&&t.add(n)))}const Ha=["onStart","onRest","onChange","onPause","onResume"];function Ga(e,t,n){e.animation[n]=t[n]!==ta(t,n)?ea(t[n],e.key):void 0}function Ua(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 Wa=["onStart","onChange","onRest"];let $a=1;class ja{constructor(e,t){this.id=$a++,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(Qs({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];gi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Fa(e)),this}start(e){let{queue:t}=this;return e?t=bi(e).map(Fa):this.queue=[],this._flush?this._flush(this,t):(Ja(this,t),Ka(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;fi(bi(t),(t=>n[t].stop(!!e)))}else Ca(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(gi.und(e))this.start({pause:!0});else{const t=this.springs;fi(bi(e),(e=>t[e].pause()))}return this}resume(e){if(gi.und(e))this.start({pause:!1});else{const t=this.springs;fi(bi(e),(e=>t[e].resume()))}return this}each(e){vi(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,ki(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&&ki(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,ki(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)}ql.onFrame(this._onFrame)}}function Ka(e,t){return Promise.all(t.map((t=>qa(e,t)))).then((t=>ba(e,t)))}async function qa(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=gi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=gi.arr(r)||gi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):fi(Wa,(n=>{const o=t[n];if(gi.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,_i(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===ta(t,"cancel");(u||m&&d.asyncId)&&p.push(va(++e._lastAsyncId,{props:t,state:d,actions:{pause:mi,resume:mi,start(t,n){m?(Ca(d,e._lastAsyncId),n(ya(e))):(t.onRest=s,n(Ea(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=ba(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Oa(t,i,r);if(n)return Ja(e,[n]),qa(e,n,!0)}return a&&ql.batchedUpdates((()=>a(g,e,e.item))),g}function Ya(e,t){const n=Qs({},e.springs);return t&&fi(bi(t),(e=>{gi.und(e.keys)&&(e=Fa(e)),gi.obj(e.to)||(e=Qs({},e,{to:void 0})),Xa(n,e,(e=>Qa(e)))})),Za(e,n),n}function Za(e,t){vi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,ds(t,e))}))}function Qa(e,t){const n=new Aa;return n.key=e,t&&ds(n,t),n}function Xa(e,t,n){t.keys&&fi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ja(e,t){fi(t,(t=>{Xa(e.springs,t,(t=>Qa(t,e)))}))}const ec=["children"],tc=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,ec);const o=(0,di.useContext)(nc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,di.useState)((()=>({inputs:t,result:e()}))),o=(0,di.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,di.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=nc;return di.createElement(i,{value:n},t)},nc=(oc=tc,rc={},Object.assign(oc,di.createContext(rc)),oc.Provider._context=oc,oc.Consumer._context=oc,oc);var oc,rc;tc.Provider=nc.Provider,tc.Consumer=nc.Consumer;const lc=()=>{const e=[],t=function(t){Is(`${Ss}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 fi(e,((e,r)=>{if(gi.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 fi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return fi(e,(e=>e.resume(...arguments))),this},t.set=function(t){fi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return fi(e,((e,o)=>{if(gi.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 fi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return fi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return gi.fun(e)?e(n,t):e};return t._getProps=n,t};function ic(e,t,n){const o=gi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,di.useMemo)((()=>o||3==arguments.length?lc():void 0),[]),l=(0,di.useRef)(0),i=Ns(),s=(0,di.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ya(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ka(e,t):new Promise((o=>{Za(e,n),s.queue.push((()=>{o(Ka(e,t))})),i()}))}})),[]),a=(0,di.useRef)([...s.ctrls]),c=[],u=Rs(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ja(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=za(n))}}(0,di.useMemo)((()=>{fi(a.current.slice(e,u),(e=>{ua(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,di.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ya(e,c[t]))),m=(0,di.useContext)(tc),g=Rs(m),h=m!==g&&aa(m);Ts((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],fi(e,(e=>e()))),fi(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(da(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ps((()=>()=>{fi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>Qs({},e)));return r?[f,r]:f}let sc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(sc||(sc={}));class ac extends xa{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ts(...t);const n=this._get(),o=$s(n);Ds(this,o.create(n))}advance(e){const t=this._get();hi(t,this.get())||(As(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&uc(this._active)&&dc(this)}_get(){const e=gi.arr(this.source)?this.source.map(is):bi(is(this.source));return this.calc(...e)}_start(){this.idle&&!uc(this._active)&&(this.idle=!1,fi(Os(this),(e=>{e.done=!1})),Ii.skipAnimation?(ql.batchedUpdates((()=>this.advance())),dc(this)):Li.start(this))}_attach(){let e=1;fi(bi(this.source),(t=>{ls(t)&&ds(t,this),Ba(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){fi(bi(this.source),(e=>{ls(e)&&ps(e,this)})),this._active.clear(),dc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=bi(this.source).reduce(((e,t)=>Math.max(e,(Ba(t)?t.priority:0)+1)),0))}}function cc(e){return!1!==e.idle}function uc(e){return!e.size||Array.from(e).every(cc)}function dc(e){e.idle||(e.idle=!0,fi(Os(e),(e=>{e.done=!0})),as(e,{type:"idle",parent:e}))}Ii.assign({createStringInterpolator:Cs,to:(e,t)=>new ac(e,t)}),Li.advance;const pc=window.ReactDOM;function mc(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 gc=["style","children","scrollTop","scrollLeft"],hc=/^--/;function fc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||hc.test(e)||bc.hasOwnProperty(e)&&bc[e]?(""+t).trim():t+"px"}const vc={};let bc={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 kc=["Webkit","Ms","Moz","O"];bc=Object.keys(bc).reduce(((e,t)=>(kc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),bc);const _c=["x","y","z"],yc=/^(matrix|translate|scale|rotate|skew)/,Ec=/^(translate)/,Cc=/^(rotate|skew)/,Sc=(e,t)=>gi.num(e)&&0!==e?e+t:e,wc=(e,t)=>gi.arr(e)?e.every((e=>wc(e,t))):gi.num(e)?e===t:parseFloat(e)===t;class Bc extends Gs{constructor(e){let{x:t,y:n,z:o}=e,r=mc(e,_c);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Sc(e,"px"))).join(",")})`,wc(e,0)]))),vi(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(yc.test(t)){if(delete r[t],gi.und(e))return;const n=Ec.test(t)?"px":Cc.test(t)?"deg":"";l.push(bi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Sc(r,n)})`,wc(r,0)]:e=>[`${t}(${e.map((e=>Sc(e,n))).join(",")})`,wc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ic(l,i)),super(r)}}class Ic extends cs{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 fi(this.inputs,((n,o)=>{const r=is(n[0]),[l,i]=this.transforms[o](gi.arr(r)?r:n.map(is));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ds(e,this)))))}observerRemoved(e){0==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ps(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),as(this,e)}}const xc=["scrollTop","scrollLeft"];Ii.assign({batchedUpdates:pc.unstable_batchedUpdates,createStringInterpolator:Cs,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 Tc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Gs(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zs(e)||"Anonymous";return(e=gi.str(e)?l[e]||(l[e]=Ks(e,r)):e[Ys]||(e[Ys]=Ks(e,r))).displayName=`Animated(${t})`,e};return vi(e,((t,n)=>{gi.arr(e)&&(n=Zs(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=mc(o,gc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:vc[t]||(vc[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=fc(t,r[t]);hc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Bc(e),getComponentProps:e=>mc(e,xc)}).animated,Nc=e=>e+1,Pc=e=>({top:e.offsetTop,left:e.offsetLeft}),Lc=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)(Nc,0),[u,p]=(0,s.useReducer)(Nc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?Pc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Il.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",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=Pc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=gi.fun(e),[[o],r]=ic(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},Rc=".block-editor-block-list__block",Mc=".block-list-appender",Ac=".block-editor-button-block-appender";function Dc(e,t){return t.closest([Rc,Mc,Ac].join(","))===e}function Oc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Rc);return t?t.id.slice("block-".length):void 0}function Fc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(to);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(to);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=Il.focus.tabbable.find(t.current).filter((e=>(0,Il.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(Dc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Il.focus.tabbable.findNext(t.current);if(e&&Dc(t.current,e)&&(0,Il.isFormElement)(e))return void e.focus()}(0,Il.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function zc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Vc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(to);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",zc),t.addEventListener("mouseover",zc),()=>{t.removeEventListener("mouseout",zc),t.removeEventListener("mouseover",zc),t.classList.remove("is-hovered")}}),[e])}function Hc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p}=t(to),{outlineMode:m}=a(),g=n(e),h=l(e),f=s(e),v=u(e,!0),b=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":b,"is-partially-selected":b&&!p(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(f)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&m&&d()})}),[e])}function Gc(e){return(0,m.useSelect)((t=>{const n=t(to).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Uc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(to),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 Wc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(to);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 $c(e){const{isBlockSelected:t}=(0,m.useSelect)(to),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Dc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const jc=window.wp.keycodes;function Kc(e){const t=(0,m.useSelect)((t=>t(to).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(to),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(to);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!==jc.ENTER&&s!==jc.BACKSPACE&&s!==jc.DELETE||a!==i||(0,Il.isTextField)(a)||(t.preventDefault(),s===jc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function qc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(to),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(to);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 Yc(){const e=(0,s.useContext)(uh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Zc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Qc),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(to),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,Fc(o),Co(o),$c(o),Kc(o),qc(o),Vc(),Yc(),Lc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=lo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Hc(o),Gc(o),Uc(o),Wc(o)),style:{...i.style,...e.style}}}Zc.save=r.__unstableGetBlockProps;const Qc=(0,s.createContext)();function Xc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Zc(o,{__unstableIsHtml:n}),t)}const Jc=(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(to),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),eu=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(to);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(to),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(to),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n,rootClientId:l}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(to);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(l){const e=(0,r.switchToBlockType)(u(l),"*");e&&e.length&&a(l,e,0)}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),tu=(0,d.compose)(d.pure,Jc,eu,(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:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(to),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(Rl,{name:h,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)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,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)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Xc,{isHtml:!0},(0,s.createElement)(jl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Xc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Vl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Il.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Qc.Provider,{value:L},(0,s.createElement)(Wl,{fallback:(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Gl,null))},N))})),nu=window.wp.htmlEntities,ou=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),ru=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],lu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*ru.length));return(0,s.createElement)(p.Tip,null,ru[e])},iu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),su=(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:iu});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)})),au=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(su,{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)))},cu=(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(Jn,eo),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),uu=()=>{};function du(e){let{clientId:t=null,value:n,selection:o,onChange:l=uu,onInput:i=uu}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(to),{getBlockName:f,getBlocks:v}=a.select(to),b=(0,m.useSelect)((e=>!t||e(to).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),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(to);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(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])}const pu=cu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o(n)}),[n]),du(e),(0,s.createElement)(Eo,null,t)}));function mu(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)(ph,null)))}function gu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(to),{clearSelectedBlock:n}=(0,m.useDispatch)(to);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 hu(e){return(0,s.createElement)("div",i({ref:gu()},e))}function fu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(to);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function vu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(fu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,s.getSelection().removeAllRanges(),r.focus())}),[o,t,n,r,e,l])}function bu(e,t,n,o){let r,l=Il.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Il.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function ku(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,m.useSelect)(to),{selectBlock:l}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===jc.UP,p=c===jc.DOWN,m=c===jc.LEFT,g=c===jc.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?Il.isVerticalEdge:Il.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!r())return;if(a.defaultPrevented)return;if(!b)return;if(k)return;return a.preventDefault(),void(h?l(e()):l(t(),-1))}if(v?s||(s=(0,Il.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===jc.UP||t===jc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,_))return;const S=(0,Il.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=n();if(k)(function(e,t){const n=bu(e,t,i);return n&&Oc(n)})(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Il.isVerticalEdge)(u,h)&&!w){const e=bu(u,h,i,!0);e&&((0,Il.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,Il.isHorizontalEdge)(u,S)&&!w){const e=bu(u,S,i);(0,Il.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const _u=window.wp.keyboardShortcuts;function yu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(to),{multiSelect:o,selectBlock:r}=(0,m.useDispatch)(to),l=(0,_u.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(i){if(!l("core/block-editor/select-all",i))return;const s=t();if(s.length<2&&!(0,Il.isEntirelySelected)(i.target))return;const[a]=s,c=n(a);let d=e(c);s.length===d.length&&(d=e(n(c)));const p=(0,u.first)(d),m=(0,u.last)(d);p!==m?(o(p,m),i.preventDefault()):r(p)}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Eu(e,t){e.contentEditable=t,t&&e.focus()}function Cu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(to),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Eu(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Eu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Su(e,t){e.contentEditable=t,t&&e.focus()}function wu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(to),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Su(n,!1);let c=Oc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=Oc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=Oc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Su(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Bu(){const{selectBlock:e}=(0,m.useDispatch)(to),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=Oc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Iu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(to),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===jc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===jc.BACKSPACE||d.keyCode===jc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===jc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===jc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function xu(){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)(to),{setNavigationMode:a}=(0,m.useDispatch)(to),c=(0,m.useSelect)((e=>e(to).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";Il.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===jc.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==jc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Il.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Il.isFormElement)(Il.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!==jc.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=Il.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(to).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Iu(),Cu(),wu(),Bu(),vu(),yu(),ku(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const Tu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=xu();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)})),Nu="editor-styles-wrapper";function Pu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Lu=(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)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Pu(null==a?void 0:a.styles),_=Pu(null==a?void 0:a.scripts),y=gu(),[E,C,S]=xu(),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),f(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]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${Nu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Nu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var Ru={grad:.9,turn:360,rad:360/(2*Math.PI)},Mu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Au=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Du=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},Fu=function(e){return{r:Du(e.r,0,255),g:Du(e.g,0,255),b:Du(e.b,0,255),a:Du(e.a)}},zu=function(e){return{r:Au(e.r),g:Au(e.g),b:Au(e.b),a:Au(e.a,3)}},Vu=/^#([0-9a-f]{3,8})$/i,Hu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Gu=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}},Uu=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}},Wu=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),l:Du(e.l,0,100),a:Du(e.a)}},$u=function(e){return{h:Au(e.h),s:Au(e.s),l:Au(e.l),a:Au(e.a,3)}},ju=function(e){return Uu((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},Ku=function(e){return{h:(t=Gu(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},qu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xu={string:[[function(e){var t=Vu.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?Au(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?Au(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Zu.exec(e)||Qu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Fu({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=qu.exec(e)||Yu.exec(e);if(!t)return null;var n,o,r=Wu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Ru[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ju(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 Mu(t)&&Mu(n)&&Mu(o)?Fu({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(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=Wu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ju(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),v:Du(e.v,0,100),a:Du(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Uu(i)},"hsv"]]},Ju=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]},ed=function(e,t){var n=Ku(e);return{h:n.h,s:Du(n.s+100*t,0,100),l:n.l,a:n.a}},td=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},nd=function(e,t){var n=Ku(e);return{h:n.h,s:n.s,l:Du(n.l+100*t,0,100),a:n.a}},od=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Ju(e.trim(),Xu.string):"object"==typeof e&&null!==e?Ju(e,Xu.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 Au(td(this.rgba),2)},e.prototype.isDark=function(){return td(this.rgba)<.5},e.prototype.isLight=function(){return td(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=zu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Hu(Au(255*r)):"","#"+Hu(t)+Hu(n)+Hu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return zu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=zu(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 $u(Ku(this.rgba))},e.prototype.toHslString=function(){return t=(e=$u(Ku(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=Gu(this.rgba),{h:Au(e.h),s:Au(e.s),v:Au(e.v),a:Au(e.a,3)};var e},e.prototype.invert=function(){return rd({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),rd(ed(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),rd(ed(this.rgba,-e))},e.prototype.grayscale=function(){return rd(ed(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),rd(nd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),rd(nd(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?rd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Au(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ku(this.rgba);return"number"==typeof e?rd({h:e,s:t.s,l:t.l,a:t.a}):Au(t.h)},e.prototype.isEqual=function(e){return this.toHex()===rd(e).toHex()},e}(),rd=function(e){return e instanceof od?e:new od(e)},ld=[],id=function(e){e.forEach((function(e){ld.indexOf(e)<0&&(e(od,Xu),ld.push(e))}))};function sd(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var ad=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},cd=function(e){return.2126*ad(e.r)+.7152*ad(e.g)+.0722*ad(e.b)};function ud(e){e.prototype.luminance=function(){return e=cd(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=cd(l))>(a=cd(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 dd=n(3124),pd=n.n(dd);const md=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function gd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return hd(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=hd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(md,""),value:n?hd(n[0]).replace(md,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=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=g();for(;r=k();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:hd(t[1]),media:hd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=hd(t[1]),o=hd(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return fd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function hd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function fd(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){fd(e,o)})):n&&"object"==typeof n&&fd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var vd=n(8575),bd=n.n(vd);const kd=_d;function _d(e){this.options=e||{}}_d.prototype.emit=function(e){return e},_d.prototype.visit=function(e){return this[e.type](e)},_d.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const yd=Ed;function Ed(e){kd.call(this,e)}bd()(Ed,kd),Ed.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Ed.prototype.comment=function(e){return this.emit("",e.position)},Ed.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Ed.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.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("}")},Ed.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Ed.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Ed.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Ed.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Ed.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("}")},Ed.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Ed.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Ed.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("}"):""},Ed.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Cd=Sd;function Sd(e){e=e||{},kd.call(this,e),this.indentation=e.indent}bd()(Sd,kd),Sd.prototype.compile=function(e){return this.stylesheet(e)},Sd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Sd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Sd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Sd.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}")},Sd.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}")},Sd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Sd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Sd.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}")},Sd.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)+"}")},Sd.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")},Sd.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}")},Sd.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}")},Sd.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}")},Sd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Sd.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()+"}"):""},Sd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Sd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const wd=function(e,t){try{const r=gd(e);return n=pd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new yd(o):new Cd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Bd(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 Id(e,t){return new URL(e,t).toString()}const xd=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]};Bd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Id(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},Td=/^(body|html|:root).*$/,Nd=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(Td)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Pd=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(Nd(t)),o&&r.push(xd(o)),r.length?wd(n,(0,d.compose)(r)):n}))},Ld=".editor-styles-wrapper";function Rd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Ld);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=rd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Md(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Pd(t,Ld)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Rd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Ad(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=rd(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 Dd(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function Od(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function Fd(e){let{id:t,colors:n}=e;const o=Ad(n);return(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:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function zd(e){let{preset:t}=e;return(0,s.createElement)(Fd,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Vd;id([sd,ud]);const Hd=2e3,Gd=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,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(to).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);Vd=Vd||(0,d.pure)(ph);const v=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(${v})`,height:a*v,maxHeight:a>Hd?Hd*v:void 0,minHeight:o}},(0,s.createElement)(Lu,{head:(0,s.createElement)(Md,{styles:h}),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:Hd,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(zd,{preset:e,key:e.slug}))),(0,s.createElement)(Vd,{renderAppender:!1}))))},Ud=(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(to).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)(pu,{value:d,settings:c},r?(0,s.createElement)(mu,{onClick:l}):(0,s.createElement)(Gd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function Wd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(to).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(pu,{value:p,settings:a},(0,s.createElement)(gh,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const $d=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Ud,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(n.name,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(au,{title:l,icon:i,description:a}))},jd=(0,s.createContext)(),Kd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(jd);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)}))})),qd=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Yd(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)(su,{icon:n}):(0,h.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
+ (0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(su,{icon:qd})))))}const Zd=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)(Yd,{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})}))},Qd=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const m=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(Zd,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{m.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{m.current=!1,h&&h(e)}},(0,s.createElement)(Kd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,(0,jc.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===jc.ENTER&&(e.preventDefault(),l(o,(0,jc.isAppleOS)()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{m.current||a(o)},onMouseEnter:()=>{m.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:g},(0,s.createElement)(su,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(p.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),Xd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Gt.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),Jd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(jd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),ep=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Xd,{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)(Jd,{key:t},e.map(((e,l)=>(0,s.createElement)(Qd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===l})))))),l)},tp=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))},np=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(to),{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])]},op=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(jd.Provider,{value:n},t)},rp=[],lp=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=np(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]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:rp);return(0,s.createElement)(op,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(tp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(ep,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(tp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(ep,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(tp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(ep,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(tp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(ep,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},ip=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,h.__)("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,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},sp=window.wp.notices,ap=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(to);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(sp.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
13
  /* translators: %s: block pattern title. */
14
+ (0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function cp(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)(cp)}`;return(0,s.createElement)(Zd,{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)(Ud,{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 up(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const dp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("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)(cp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(up,{key:e.name}))))};function pp(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 mp(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,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const gp=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)(mp,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(pp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},hp=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Mr,{className:"block-editor-inserter__no-results-icon",icon:iu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},fp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(to),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(to),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(to),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)?g(o.clientId,e,null,a||n?0:null,t):f(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
15
+ (0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Gt.speak)(s),i&&i()}),[l,c,g,f,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]},vp=e=>e.name||"",bp=e=>e.title,kp=e=>e.description||"",_p=e=>e.keywords||[],yp=e=>e.category,Ep=()=>null;function Cp(){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 Sp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Cp(e))},wp=(e,t)=>e.filter((e=>!Sp(t).some((t=>t.includes(e))))),Bp=(e,t,n,o)=>0===Sp(o).length?e:Ip(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}}),Ip=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=Sp(t);if(0===o.length)return e;const r=e.map((e=>[e,xp(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 xp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=vp,getTitle:r=bp,getDescription:l=kp,getKeywords:i=_p,getCategory:s=yp,getCollection:a=Ep}=n,c=o(e),d=r(e),p=l(e),m=i(e),g=s(e),h=a(e),f=Cp(t),v=Cp(d);let b=0;if(f===v)b+=30;else if(v.startsWith(f))b+=20;else{const e=[c,d,p,...m,g,h].join(" "),t=(0,u.words)(f);0===wp(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Tp(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,h.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
+ (0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const Np=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Gt.speak,500),[l,i]=fp({shouldFocusBlock:!0}),[a,,c]=ap(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ip(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,h.sprintf)(
18
  /* translators: %d: number of results. */
19
+ (0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(Tp,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(op,null,!g&&(0,s.createElement)(hp,null),g&&(0,s.createElement)(dp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Pp(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)(gp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(Np,{filterValue:o,selectedCategory:l,patternCategories:n}))}const Lp=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Pp,n))};function Rp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=ap(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)(dp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const Mp=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=ap(),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,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ip,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Rp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(Lp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Ap=window.wp.url;function Dp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=np(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(hp,null):(0,s.createElement)(tp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(ep,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const Op=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Dp,{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,Ap.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:Fp,Slot:zp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Fp.Slot=zp;const Vp=Fp,Hp=[],Gp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Gt.speak,500),[_,y]=fp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=np(_,y),[B,,I]=ap(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ip(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=Bp((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,h.sprintf)(
20
  /* translators: %d: number of results. */
21
+ (0,h._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:Hp),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),M=!!N.length&&(0,s.createElement)(tp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(ep,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(tp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(dp,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(op,null,!g&&!R&&(0,s.createElement)(hp,null),b?A:M,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?M:A,g&&(0,s.createElement)(Vp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(hp,null))))},Up={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
+ title:(0,h.__)("Blocks")},Wp={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
+ title:(0,h.__)("Patterns")},$p={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
+ title:(0,h.__)("Reusable")},jp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Up];return n&&e.push(Wp),o&&e.push($p),e}),[Up,n,Wp,o,$p]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Kp=(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[g,f]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=fp({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(to);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)(lp,{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,h.__)("A tip for using the block editor")),(0,s.createElement)(lu,null)))),[y,B,x,g,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Mp,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),L=(0,s.useMemo)((()=>(0,s.createElement)(Op,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:L),[N,P,L]),M=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{M.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),f(e)},value:g,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:M}),!!g&&(0,s.createElement)(Gp,{filterValue:g,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!g&&(S||w)&&(0,s.createElement)(jp,{showPatterns:S,showReusableBlocks:w},R),!g&&!S&&!w&&N)),a&&v&&(0,s.createElement)($d,{item:v}))}));function qp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=fp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=np(u,d),[f]=ap(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(to),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=f.length&&(!!i||l),_=k&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Gp,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Yp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
28
+ (0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:ou,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class Zp 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=Yp,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(qp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(Kp,{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,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Qp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getBlockIndex:u,getBlockCount:d,getSettings:p}=e(to),{getBlockVariations:m}=e(r.store);l=l||i(o)||void 0;const g=a(l),h=c(l),f=u(o),v=d(),b=p(),k=1===(null==g?void 0:g.length)&&0===(null===(n=m(g[0].name,"inserter"))||void 0===n?void 0:n.length);let _=!1;return k&&(_=g[0]),{hasItems:s(l),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:h,rootClientId:l,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!l&&f>0&&(f<v||0===v)}})),(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(to);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(to);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(to);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
29
+ (0,h.__)("%s block added"),a.title);(0,Gt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Zp),Xp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(to),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(to);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,nu.decodeEntities)(r)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{jc.ENTER!==e.keyCode&&jc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Qp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Jp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Qp,{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,h.sprintf)(// translators: %s: the name of the block when there is only one
30
+ (0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Mr,{icon:ou}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const em=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Jp(e,t)))),tm=(0,s.forwardRef)(Jp),nm=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(to);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)(Xp,{rootClientId:n}):(0,s.createElement)(tm,{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)}));(0,s.createContext)();const om=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(to),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=wo(t),v=wo(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),_=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}:(0,h.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,height:0,width:0,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,height:0,width:0,ownerDocument:e}}),[f,v]),y=$o(l);return f&&v&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null},rm=(0,s.createContext)();function lm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(to),l=(0,s.useContext)(rm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(to),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:f?.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)(om,{previousClientId:u,nextClientId:g,__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&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Qp,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function im(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(to).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(rm.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(lm,n),t)}function sm(){const e=(0,s.useContext)(rm),t=(0,m.useSelect)((e=>e(to).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(to),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(to);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",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));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"))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 am="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,cm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function um(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(to),{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 dm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(to),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=um(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function pm(e){let{clientId:t,maximumLength:n,context:o}=e;return dm({clientId:t,maximumLength:n,context:o})}const mm=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(to),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,Il.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)(to);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,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Yd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},gm=function(e){let{clientId:t,rootClientId:n}=e;const o=um(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(to),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:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(to),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,Gt.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N}=(0,m.useSelect)(to),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:M}=(0,m.useDispatch)(to),A=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),D=(0,h.__)("Drag");return(0,s.createElement)("div",{className:A},(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)(su,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(mm,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:qd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,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===jc.UP,r=n===jc.DOWN,l=n===jc.LEFT,i=n===jc.RIGHT,s=n===jc.TAB,a=n===jc.ESCAPE,c=n===jc.ENTER,u=n===jc.SPACE,d=e.shiftKey;if(n===jc.BACKSPACE||n===jc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(f)y=g;else if(v)y=h;else if(k){var A;y=null!==(A=w(p))&&void 0!==A?A:p}else if(_){var D;y=null!==(D=B([p])[0])&&void 0!==D?D:p}const O=C();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=w(O),t=w(p),n=S(O);let o=S(p);n<o&&e===t&&(o-=1),M(O,e,t,o),P(O),R(null)}if(v||f||k||_)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=E;do{t=Il.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Il.focus.tabbable.findNext(t))}else t=Il.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),L())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(pm,{clientId:t,maximumLength:35})))))};function hm(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const fm=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=!Il.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Il.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,_u.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=hm(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=hm(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)},vm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),bm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),km=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),_m=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),ym=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Em=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?vm:bm:km:"down"===e?"horizontal"===t?(0,h.isRTL)()?bm:vm:_m:null,Cm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Sm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(Sm),f=(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(to),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,k=h===f.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:g,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(to),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;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:Em(o,C),label:Cm(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;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=ym("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
33
+ (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=ym("down",l);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=ym("up",l);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
34
  (0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
35
  (0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
36
+ (0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=ym("up",l);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
37
+ (0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=ym("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
38
  (0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
39
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
40
+ (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=ym("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
41
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
42
  (0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
+ (0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=ym("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
44
  (0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
45
  (0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
46
+ (0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=ym("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
47
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
48
  (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
49
+ (0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),wm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Sm,i({direction:"up",ref:t},e)))),Bm=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Sm,i({direction:"down",ref:t},e)))),Im=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(to),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)),g=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===g.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const g=(0,h.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(mm,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:qd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:g,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)(wm,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Bm,i({clientIds:t},e))))))},{clearTimeout:xm,setTimeout:Tm}=window,Nm=()=>{},Pm=200;function Lm(e){let{ref:t,isFocused:n,debounceTimeout:o=Pm,onChange:r=Nm}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&xm&&xm(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=Tm((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Rm(e){let{ref:t,debounceTimeout:n=Pm,onChange:o=Nm}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Lm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function Mm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(to),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(to),{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=um(n),c=(0,s.useRef)(),{gestures:u}=Rm({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,h.sprintf)(
50
  /* translators: %s: Name of the block's parent. */
51
+ (0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(su,{icon:a.icon})}))}const Am=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function Dm(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,h.__)("Preview")),(0,s.createElement)(Ud,{viewportWidth:500,blocks:t})))))}const Om=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,h.__)("Transform to"),className:t},i&&(0,s.createElement)(Dm,{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)(su,{icon:n,showColors:!0}),l)})))},Fm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),zm=window.wp.tokenList;var Vm=n.n(zm);function Hm(e,t,n){const o=new(Vm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Gm(e){return(0,u.find)(e,"isDefault")}function Um(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(to),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)(to),d=function(e){return e&&0!==e.length?Gm(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Vm())(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),g=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=Hm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:g,className:a}}const Wm=()=>{};function $m(e){let{clientId:t,onSwitch:n=Wm}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Um({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?Fm:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function jm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)($m,{clientId:o,onSwitch:n}))}const Km=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=Km(e,t,n);if(o)return o}}},qm=(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 Ym(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,h.__)("Preview")),(0,s.createElement)(Zm,{patterns:t,onSelect:n})))))}function Zm(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,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Qm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Qm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Qm,`${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)(Ud,{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))}const Xm=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=Km(r,t.name,o);if(n){e=!0,o.add(n.clientId),qm(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)(Ym,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:vm},(0,h.__)("Patterns"))):null},Jm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(to),l=um(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:g,patterns:f}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(to),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(to),m=i((0,u.castArray)(t)[0]),[{name:g}]=n,h=1===n.length,f=h&&c(g);let v;var b;h?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(g))||void 0===b?void 0:b.icon:Am;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==f||!f.length),icon:v,blockTitle:null===(o=d(g))||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&&!b,_=!(null==f||!f.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:g,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(su,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(pm,{clientId:t,maximumLength:35})))}));const y=g,E=1===n.length?(0,h.sprintf)(
52
  /* translators: %s: block title. */
53
  (0,h.__)("%s: Change block type or style"),g):(0,h.sprintf)(
54
  /* translators: %d: number of blocks. */
55
+ (0,h._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)(su,{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)(pm,{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)(Xm,{blocks:n,patterns:f,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Om,{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)(jm,{hoveredBlock:n[0],onSwitch:l}))})))))},eg=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(to).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Jm,{clientIds:t,blocks:n})},{Fill:tg,Slot:ng}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");tg.Slot=ng;const og=tg,rg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),lg=window.wp.blob;function ig(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function sg(){const{getBlockName:e}=(0,m.useSelect)(to),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(sp.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
56
  (0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
57
  (0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
58
  (0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
59
+ (0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function ag(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(to),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,m.useDispatch)(to),f=sg();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,Il.documentHasUncollapsedSelection)(t):(0,Il.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)h();else{let t;if(f(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",(E=(E=n).replace(/<br>/g,"\n"),(0,Il.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),m.clipboardData.setData("text/html",n)}var E;if("cut"===m.type)_&&!y?u(v):g();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,Il.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!ig(r,o)&&(o=r.map((e=>`<img src="${(0,lg.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)}}),[])}const cg=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:ag()},t)};function ug(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(to),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),g=s(t),h=i(t[0]),f=(0,u.every)(g,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(to),T=sg();return n({canDuplicate:f,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:g,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(!g.length)return;const e=p(),n=(0,r.switchToBlockType)(g,e);n&&y(t,n)},onUngroup(){if(!g.length)return;const e=g[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=g.map((e=>{let{clientId:t}=e;return t}));1===g.length&&w(e[0]),T("copy",e)}})}const dg=()=>{},pg=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(to),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=dg,clientId:o}=t;return{onToggleMode(){e(to).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),mg=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(to).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(to).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)})),{Fill:gg,Slot:hg}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");gg.Slot=hg;const fg=gg;function vg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(to);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,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function bg(){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(to),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}function kg(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(to),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])}const _g=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),yg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Eg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Cg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=kg(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,m.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(to),s=l(t),a=(0,r.getBlockType)(s);return{isReusable:(0,r.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:k}=(0,m.useDispatch)(to),_=um(t),y=(0,d.useInstanceId)(Cg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(p.Modal,{title:(0,h.sprintf)(
60
  /* translators: %s: Name of the block. */
61
+ (0,h.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),k([t],{lock:o,templateLock:v?Eg(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,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:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,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,h.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?yg:_g})),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,h.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?yg:_g})),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,h.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?yg:_g})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(p.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(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,h.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function Sg(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=kg(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?_g:yg,onClick:l},i),r&&(0,s.createElement)(Cg,{clientId:t,onClose:l}))}const{Fill:wg,Slot:Bg}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Ig(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(wg,t))}Ig.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(to),l=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(l).filter(Boolean),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=kg(r[0]),c=1===r.length&&a,d=bg(),{isGroupable:g,isUngroupable:h}=d,f=(g||h)&&l;return(0,s.createElement)(Bg,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!f&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(Sg,{clientId:r[0]}),e,f&&(0,s.createElement)(vg,i({},d,{onClose:null==t?void 0:t.onClose})))))};const xg=Ig,Tg=()=>{},Ng={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Pg(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(p.MenuItem,{ref:o},l)}const Lg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:g,hasReducedUI:f,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(to),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(_u.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)(to),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:Tg,[n]),B=dm({clientId:d,maximumLength:25}),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:Tg,[n,k,_,y]),x=(0,h.sprintf)(
62
  /* translators: %s: block name */
63
+ (0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=Rm({ref:N,onChange(e){e&&f||S(g,e)}});return(0,s.createElement)(ug,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:f,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:rg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Ng,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(fg.Slot,{fillProps:{onClose:l}}),void 0!==g&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(su,{icon:b.icon}),onClick:()=>C(g)}),(0,h.sprintf)(
64
  /* translators: %s: Name of the block's parent. */
65
+ (0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(mg,{clientId:d}),(0,s.createElement)(Pg,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,f,w),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,h.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(pg,{clientId:d,onToggle:l})),(0,s.createElement)(xg.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)))}))}))};function Rg(e){let{clientIds:t,...n}=e;const{block:o,shouldRender:l}=(0,m.useSelect)((e=>{const n=t[0],{isBlockMultiSelected:o,getBlockMode:r,getBlock:l}=e(to),i=!o(n),s="html"===r(n);return{block:l(n),shouldRender:i&&s}}),[t[0]]),{replaceBlocks:a}=(0,m.useDispatch)(to),c=(0,s.useCallback)((()=>{a(o.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(o)}))}),[o]);return l?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,i({onClick:c},n),(0,h.__)("Edit visually"))):null}const Mg=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rg,i({clientIds:t},n)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Lg,i({clientIds:t,toggleProps:e},n))))))};function Ag(e){let{clientId:t}=e;const n=um(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=kg(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:yg,label:(0,h.sprintf)(
66
  /* translators: %s: block name */
67
+ (0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Cg,{clientId:t,onClose:c})):null}const Dg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),Og=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),Fg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),zg={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},Vg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=bg(),{replaceBlocks:l}=(0,m.useDispatch)(to),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(to),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=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=zg[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Dg,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:Og,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:Fg,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))},Hg=(0,s.createContext)(""),Gg=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(to),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:f}=(0,m.useDispatch)(to),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Rm({ref:v,onChange(e){e&&u||f(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=g&&h,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)(Mm,{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)(eg,{clientIds:n}),!C&&(0,s.createElement)(Ag,{clientId:n[0]}),(0,s.createElement)(Im,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(Vg,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(po.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Hg.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(og.Slot,null))),(0,s.createElement)(Mg,{clientIds:n}))},Ug=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(to),{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:c&&(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)(fm,i({focusOnMount:t,className:d
68
+ /* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Gg,{hideDragHandle:n}))};function Wg(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(to);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function $g(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:g,lastClientId:h}=(0,m.useSelect)(Wg,[]),f=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(to);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),{stopTyping:k}=(0,m.useDispatch)(to),_=a,y=!a&&!g&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||g||o);(0,_u.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(jo,{clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":f}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(Ug,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(gm,{clientId:t,rootClientId:n})):null}function jg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(to),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Kg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(jg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)($g,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function qg(e){let{children:t}=e;const n=(0,s.useContext)(rm),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(im,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Kg,{__unstablePopoverSlot:"block-toolbar"}),t))}const Yg=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=lo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Zg=Yg((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(tm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Qg=(0,d.compose)([Yg,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(to),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Xp,{rootClientId:t})})),Xg=new WeakMap;function Jg(e,t){const n=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(to),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(to),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),g=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,Il.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function eh(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 th(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=eh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function nh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=th(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function oh(){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(to);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(to),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(to),a=Jg(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=nh(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 rh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(to),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(to).getBlockRootClientId(e);return{blockListSettings:t(to).getBlockListSettings(e),parentLock:t(to).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=Jr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Wo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(to),{replaceInnerBlocks:i}=(0,m.useDispatch)(to),a=(0,m.useSelect)((t=>t(to).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(to).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Xg.has(t)||Xg.set(t,new WeakMap);const n=Xg.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)(gh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function lh(e){return du(e),(0,s.createElement)(rh,e)}const ih=(0,s.forwardRef)(((e,t)=>{const n=sh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=lo(),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(to),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,oh({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?lh:rh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(gh,t)}}sh.save=r.__unstableGetInnerBlocksProps,ih.DefaultBlockAppender=Qg,ih.ButtonBlockAppender=Zg,ih.Content=()=>sh.save().children;const ah=ih,ch=(0,s.createContext)(),uh=(0,s.createContext)();function dh(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(to),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(to),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=sh({ref:(0,d.useMergeRefs)([gu(),sm(),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)(ch.Provider,{value:o},(0,s.createElement)(uh.Provider,{value:g},(0,s.createElement)("div",h)))}function ph(e){return function(){const e=(0,m.useSelect)((e=>e(to).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(to).__experimentalGetParsedPattern(e[n].name),t=am(o))};return t=am(o),()=>cm(t)}),[e])}(),(0,s.createElement)(qg,null,(0,s.createElement)(ro,{value:no},(0,s.createElement)(dh,e)))}function mh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=el}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(to);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(nl,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(tu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(nm,{tagName:r,rootClientId:n,renderAppender:o}))}function gh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(mh,e))}function hh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function fh(){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=hh(o),i=0===r||r?`${r}${l}`:void 0;return i}function vh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function bh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function kh(e){let{onChange:t,values:n,...o}=e;const r=fh(n),l=bh(n)&&vh(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}ph.__unstableElementContext=ch;const _h={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function yh(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(_h).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}const Eh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),Ch=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Sh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("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?Eh:Ch,iconSize:16,"aria-label":o})))}const wh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Bh={px:100,em:20,rem:20};function Ih(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!bh(n)||!vh(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 hh(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)(fh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(kh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Bh[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(yh,{min:0,onChange:t,values:n||wh,units:l}),(0,s.createElement)(Sh,{onClick:()=>r(!o),isLinked:o})))}function xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ih,{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=Ro(t)),o({style:t})}})}id([sd,ud]);const Th=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Nh=(e,t)=>(0,u.find)(e,{color:t});function Ph(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Lh(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Rh(){const e=Lh(),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,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=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,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Mh="__experimentalBorder",Ah=["top","right","bottom","left"],Dh=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}}}},Oh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Fh=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Oh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Oh(t,"color",o)||{color:o}};function zh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Vh(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Rh(),a=Hh(e.name),c=To("border.color")&&Hh(e.name,"color"),u=To("border.radius")&&Hh(e.name,"radius"),d=To("border.style")&&Hh(e.name,"style"),m=To("border.width")&&Hh(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Mh,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Fh({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Ah.forEach((e=>{var n;const o=zh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Fh({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Go,{__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,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Ro({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Dh,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}},Ah.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Fh({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=Fh({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Ro({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Gh(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(xh,e)))}function Hh(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,Mh);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 Gh(e,t){return Ro({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Uh(e,t,n){if(!Hh(t,"color")||Do(t,Mh,"color"))return e;const o=Wh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Wh(e){var t;const{borderColor:n,style:o}=e,r=Ph("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 $h=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Rh();if(!Hh(m,"color")||Do(m,Mh,"color"))return(0,s.createElement)(e,t);const{color:b}=Fh({colors:v,namedColor:h}),{color:k}=Fh({colors:v,namedColor:zh(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Fh({colors:v,namedColor:zh(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Fh({colors:v,namedColor:zh(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Fh({colors:v,namedColor:zh(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function jh(e){if(e)return`has-${e}-gradient-background`}function Kh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function qh(e,t){return(0,u.find)(e,["gradient",t])}function Yh(e,t){const n=qh(e,t);return n&&n.slug}function Zh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=lo(),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(to),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(to),d=(0,s.useCallback)((o=>{const r=Yh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=jh(a);let g;return g=a?Kh(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Hh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Uh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Hh(e,"color")||Do(e,Mh,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Uh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",$h);const Qh=["colors","disableCustomColors","gradients","disableCustomGradients"],Xh={name:"color",title:"Solid",value:"color"},Jh={name:"gradient",title:"Gradient",value:"gradient"},ef=[Xh,Jh];function tf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:k}=e;const _=m&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!_&&!y)return null;const E={[Xh.value]:(0,s.createElement)(p.ColorPalette,{value:h,onChange:y?e=>{m(e),g()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:k}),[Jh.value]:(0,s.createElement)(p.GradientPicker,{value:f,onChange:_?e=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(p.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},b&&(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&&(0,s.createElement)(p.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:ef,initialTabName:f?Jh.value:!!_&&Xh.value},(e=>C(e.value))),!y&&C(Xh.value),!_&&C(Jh.value))))}function nf(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)(tf,i({},t,e))}const of=function(e){return(0,u.every)(Qh,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(tf,e):(0,s.createElement)(nf,e)},rf=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},lf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},sf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(lf,{colorValue:r,label:l}))};function af(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(rf,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:sf(f),renderContent:()=>(0,s.createElement)(p.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(of,h)))}))})))}id([sd,ud]);const cf=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,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=rd(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 f){if(!e.color)continue;const t=rd(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
69
  (0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
70
+ (0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,Gt.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 uf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function df(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=So(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(uf(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(uf(t).color);let n=m.current,o=uf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=uf(n).backgroundColor;a(o)}));const g=Rh();return(0,s.createElement)(Go,{__experimentalGroup:"color"},(0,s.createElement)(af,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,s.createElement)(cf,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const pf="color",mf=e=>{const t=(0,r.getBlockSupport)(e,pf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},gf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,pf);return null!==t&&"object"==typeof t&&!!t.link},hf=e=>{const t=(0,r.getBlockSupport)(e,pf);return null!==t&&"object"==typeof t&&!!t.gradients},ff=e=>{const t=(0,r.getBlockSupport)(e,pf);return t&&!1!==t.background},vf=e=>{const t=(0,r.getBlockSupport)(e,pf);return t&&!1!==t.text},bf=(e,t)=>Ro(Mo(t,e,void 0)),kf=e=>({textColor:void 0,style:bf(["color","text"],e.style)}),_f=e=>({style:bf(["elements","link","color","text"],e.style)}),yf=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 Ef(e,t,n){var o,r,l,i,s,a;if(!mf(t)||Do(t,pf))return e;const u=hf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!Do(t,pf,e),f=h("text")?Ph("color",p):void 0,v=h("gradients")?jh(m):void 0,b=h("background")?Ph("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Cf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Th(e,n[1]).color:t};function Sf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=To("color.palette.custom"),f=To("color.palette.theme"),v=To("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,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||!f||(null==f?void 0:f.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!mf(p))return null;const P=gf(p)&&B&&x,L=vf(p)&&I&&x,R=ff(p)&&w&&x,M=hf(p)&&T;if(!(P||L||R||M))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(M&&F)z=Kh(E,F);else if(M){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=Nh(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:Ro(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,[pf,"__experimentalDefaultControls"]);return(0,s.createElement)(df,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Th(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:kf}]:[],...R||M?[{label:(0,h.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Th(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:M?t=>{const n=Yh(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:Ro(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:Ro(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,resetAllFilter:yf}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=Nh(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Ro(Mo(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:Cf(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,resetAllFilter:_f}]:[]]})}const wf=(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(!mf(o)||Do(o,pf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!Do(o,pf,"text")&&(m.color=null===(g=Th(p,a))||void 0===g?void 0:g.color),l&&!Do(o,pf,"background")&&(m.backgroundColor=null===(h=Th(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),Bf={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 mf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),hf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Ef),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!mf(e)||Do(e,pf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ef(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",wf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Ao({linkColor:gf(r),textColor:vf(r),backgroundColor:ff(r),gradient:hf(r)},Bf,e,t,n,o)}));const If=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],xf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Tf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Nf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...a}=e,c=n||o,u=Tf(n,o),d={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},m=(0,s.useMemo)((()=>n&&o?(()=>{const e=[d];return If.forEach((t=>{let{name:n,value:o}=t;xf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
71
  /* translators: 1: Font weight name. 2: Font style name. */
72
+ (0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return If.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return xf.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),g=m.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||m[0];return c&&(0,s.createElement)(p.CustomSelectControl,i({},a,{className:"components-font-appearance-control",label:u,describedBy:g?n?o?(0,h.sprintf)(// translators: %s: Currently selected font appearance.
73
+ (0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
74
+ (0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
75
+ (0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:m,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const Pf=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(p.__experimentalNumberControl,i({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},Lf="typography.lineHeight";function Rf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Pf,{__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:Ro(t)})}})}function Mf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Lf)||t}const Af="typography.__experimentalFontStyle",Df="typography.__experimentalFontWeight";function Of(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Ff(e),i=!zf(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)(Nf,{onChange:e=>{r({style:Ro({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Ff(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Af),n=To("typography.fontStyle");return!t||!n}function zf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Df),n=To("typography.fontWeight");return!t||!n}function Vf(e){const t=Ff(e),n=zf(e);return t&&n}function Hf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=To("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Gf="typography.__experimentalFontFamily";function Uf(e,t,n){if(!(0,r.hasBlockSupport)(t,Gf))return e;if(Do(t,yv,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Vm())(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 Wf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=To("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)(Hf,{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 $f(e){let{name:t}=e;const n=To("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Gf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Gf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Uf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Gf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Uf(o,e,n)},e}));const jf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Kf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function qf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Yf=function(e){const t=To("typography.fontSizes"),n=!To("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Zf="typography.fontSize";function Qf(e,t,n){if(!(0,r.hasBlockSupport)(t,Zf))return e;if(Do(t,yv,"fontSize"))return e;const o=new(Vm())(e.className);o.add(qf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Xf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=To("typography.fontSizes"),a=jf(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)(Yf,{onChange:e=>{const t=Kf(i,e).slug;l({style:Ro({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Jf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=To("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Zf)||!n}const ev=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=To("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Zf)||Do(i,yv,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=jf(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"),tv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Zf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Qf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Zf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ev),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ao({fontSize:(0,r.hasBlockSupport)(l,Zf)},tv,e,t,n,o)}));const nv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),ov=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),rv=[{name:(0,h.__)("Underline"),value:"underline",icon:nv},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:ov}];function lv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},rv.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 iv="typography.__experimentalTextDecoration";function sv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(lv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function av(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,iv),n=To("typography.textDecoration");return t||!n}const cv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),uv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),pv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:cv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:uv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:dv}];function mv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},pv.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 gv="typography.__experimentalTextTransform";function hv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(mv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function fv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gv),n=To("typography.textTransform");return t||!n}function vv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,i({},r,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const bv="typography.__experimentalLetterSpacing";function kv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(vv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function _v(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,bv),n=To("typography.letterSpacing");return t||!n}const yv="typography",Ev=[Lf,Zf,Af,Df,Gf,iv,gv,bv];function Cv(e){const{clientId:t}=e,n=$f(e),o=Jf(e),l=Vf(e),i=Mf(e),a=av(e),c=fv(e),u=_v(e),d=!Ff(e),m=!zf(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Vf(e),Jf(e),Mf(e),$f(e),av(e),fv(e),_v(e)];return t.filter(Boolean).length===t.length}(e),f=Sv(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[yv,"__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)(Go,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Wf,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)
76
+ /* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Ro({...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)(Xf,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:Tf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(Of,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,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(Rf,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,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(sv,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)
77
+ /* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(hv,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,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...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)(kv,e)))}const Sv=e=>Ev.some((t=>(0,r.hasBlockSupport)(e,t))),wv=[...Ev,Mh,pf,tr],Bv=e=>wv.some((t=>(0,r.hasBlockSupport)(e,t))),Iv="var:";function xv(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,Iv)?`var(--wp--${e.slice(Iv.length).split("|").join("--")})`:e}function Tv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{if(r.__EXPERIMENTAL_STYLE_PROPERTY[o].rootOnly)return;const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=xv(r))})):t.includes(l.join("."))||(n[o]=xv((0,u.get)(e,l))))}}));const o=Qr(e);return o.forEach((e=>{n[e.key]=e.value})),n}const Nv={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[pf],[`${yv}.__experimentalSkipSerialization`]:[yv],[`${tr}.__experimentalSkipSerialization`]:["spacing"]},Pv={...Nv,[`${tr}`]:["spacing.blockGap"]},Lv={gradients:"gradient"};function Rv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pv;if(!Bv(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Lv[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Tv(l),...e.style},e}const Mv=(0,d.createHigherOrderComponent)((e=>t=>{const n=io();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Sf,t),(0,s.createElement)(Cv,t),(0,s.createElement)(Vh,t),(0,s.createElement)(rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Av=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Do(t.name,pf,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=Zr(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(ph.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Bv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Rv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Bv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rv(o,e,n,Nv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Mv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Av),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Ov=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(p.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(p.DuotoneSwatch,{values:i}):(0,s.createElement)(Mr,{icon:Dv}),(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==jc.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},Fv=[];function zv(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(Od,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fd,{id:n,colors:o}),(0,s.createElement)(Dd,{id:n,selector:t}))}function Vv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!To(n),r=To(`${t}.custom`)||Fv,l=To(`${t}.theme`)||Fv,i=To(`${t}.default`)||Fv;return(0,s.useMemo)((()=>[...r,...l,...o?Fv:i]),[o,r,l,i])}function Hv(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=Vv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Vv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!To("color.custom"),u=!To("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Ov,{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})}}))}id([sd]);const Gv=(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)(Hv,t))}),"withDuotoneControls"),Uv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(ph.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(zv,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Gv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Uv);const Wv="__experimentalLayout";function $v(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=To("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Wv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Jr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inner blocks use full width"),checked:!k,onChange:()=>t({layout:{inherit:!k}})}),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},k?(0,h.__)("Nested blocks use theme content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container."))),!k&&u&&(0,s.createElement)(jv,{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 jv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Xr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Kv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Wv)&&(0,s.createElement)($v,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),qv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Wv),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return!!t().disableLayoutStyles})),p=l&&!a,g=(0,d.useInstanceId)(e),h=To("layout")||{},f=(0,s.useContext)(ph.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Wv)||{},k=null!=v&&v.inherit?h:v||b||{},_=l?function(e,t){var n;const o=(0,m.useSelect)((e=>{var t;const{getSettings:n}=e(to);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=[];var l;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&r.push(null==t||null===(l=t[(null==e?void 0:e.type)||"default"])||void 0===l?void 0:l.className),(null!=e&&e.inherit||null!=e&&e.contentSize)&&o&&r.push("has-global-padding"),null!=e&&e.orientation&&r.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&r.push("is-nowrap"),r}(k,null==h?void 0:h.definitions):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==To("spacing.blockGap");let C;if(p){var S;const e=Jr((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:p&&!!C},_);return(0,s.createElement)(s.Fragment,null,p&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(rl,{blockName:n,selector:y,css:C,layout:k,style:null==o?void 0:o.style}),f),(0,s.createElement)(e,i({},t,{className:w})))}));function Yv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:Wh(e)||void 0,style:Tv({border:n})}}function Zv(e){const{colors:t}=Rh(),n=Yv(e),{borderColor:o}=e;if(o){const e=Fh({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function Qv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Ph("background-color",s),m=Ph("color",a),g=jh(u),h=g||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,g,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Tv({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Wv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",qv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Kv);const Xv={};function Jv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=To("color.palette.custom")||[],l=To("color.palette.theme")||[],i=To("color.palette.default")||[],a=To("color.gradients")||Xv,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=Qv(e);if(t){const e=Th(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Kh(u,o)),n){const e=Th(c,n);d.style.color=e.color}return d}function eb(e){const{style:t}=e;return{style:Tv({spacing:(null==t?void 0:t.spacing)||{}})}}function tb(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const nb=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),ob=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette.custom"),o=To("color.palette.theme"),r=To("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function rb(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,..."string"==typeof t?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=rd(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Nh(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=Th(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:Ph(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function lb(e){return function(){const t=nb(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(rb(o,t),"withCustomColors")}}function ib(){const e=ob();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(rb(n,e),"withColors")}const sb=[],ab=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=To("typography.fontSizes")||sb;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=jf(r,l,n[t]);return e[o]={...i,class:qf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},cb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),ub=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),db=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"})),pb=[{icon:cb,title:(0,h.__)("Align text left"),align:"left"},{icon:ub,title:(0,h.__)("Align text center"),align:"center"},{icon:db,title:(0,h.__)("Align text right"),align:"right"}],mb={position:"bottom right",isAlternate:!0},gb=function(e){let{value:t,onChange:n,alignmentControls:o=pb,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),g=c?p.ToolbarGroup:p.ToolbarDropdownMenu,f=c?{isCollapsed:a}:{};return(0,s.createElement)(g,i({icon:m?m.icon:(0,h.isRTL)()?db:cb,label:r,toggleProps:{describedBy:l},popoverProps:mb,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},f))},hb=e=>(0,s.createElement)(gb,i({},e,{isToolbar:!1})),fb=e=>(0,s.createElement)(gb,i({},e,{isToolbar:!0})),vb=()=>{},bb={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(to),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=np(t,vb),i=(0,s.useMemo)((()=>(e.trim()?Bp(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)(su,{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))}}},kb=window.wp.apiFetch;var _b=n.n(kb);const yb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Eb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m7.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"})),Cb={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await _b()({path:(0,Ap.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)(Mr,{key:"icon",icon:"page"===e.subtype?yb:Eb}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},Sb=[];function wb(e){let{completers:t=Sb}=e;const{name:n}=lo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([bb,Cb])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const Bb=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:wb(e)}))},Ib=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),xb=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Ib,label:n,onClick:()=>o(!t),disabled:r})},Tb=()=>{},Nb=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=Tb,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(p.Dropdown,{position:"bottom right",popoverProps:{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!==jc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Pb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Lb=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(to),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(to),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Mr,{icon:Pb,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)(pm,{clientId:e,maximumLength:35})),(0,s.createElement)(Mr,{icon:Pb,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(pm,{clientId:r,maximumLength:35})))};function Rb(e){return(0,m.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,canEditBlock:r}=t(to);return!r(e)||!n(e)&&!o(e,!0)}),[e])}const Mb=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),Ab=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(Mb,null)))},Db=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==jc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Ab,null)))}))}},Ob=e=>{let{children:t,...n}=e;return V()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Db(n),renderContent:()=>t})},Fb=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),zb=Tc(p.__experimentalTreeGridRow);function Vb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=Lc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(zb,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}const Hb=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));function Gb(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Mr,{icon:(0,h.isRTL)()?Hb:Pb}))}const Ub=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const g=um(o),h=dm({clientId:o,context:"list-view"}),{isLocked:f}=kg(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==jc.ENTER&&e.keyCode!==jc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Gb,{onClick:l}),(0,s.createElement)(su,{icon:null==g?void 0:g.icon,showColors:!0}),(0,s.createElement)(p.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(p.__experimentalTruncate,{ellipsizeMode:"auto"},h)),(null==g?void 0:g.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},g.anchor),f&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Mr,{icon:yg})))))})),Wb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:g,...h}=e;const{clientId:f}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(to);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[f]),k=v&&b===f,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=g.includes(f)?g:[f];return(0,s.createElement)(mm,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:g}=e;return(0,s.createElement)(Ub,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:g,isExpanded:p},h))}))})),$b=(0,s.createContext)({}),jb=()=>(0,s.useContext)($b),Kb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:g,rowCount:f,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(to),N=um(B),P=(0,m.useSelect)((e=>e(to).getBlockName(B)),[B]),L=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:R}=kg(B),M=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,h.sprintf)(
78
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
79
+ (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,g);let D=(0,h.__)("Link");N&&(D=R?(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
80
  (0,h.__)("%s link (locked)"),N.title):(0,h.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
81
  (0,h.__)("%s link"),N.title));const O=N?(0,h.sprintf)(// translators: %s: The title of the block.
82
+ (0,h.__)("Options for %s block"),N.title):(0,h.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=jb(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:L||(Y=3);const Z=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!L}),Q=y.includes(B)?y:[B];return(0,s.createElement)(Vb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:g,position:u,rowCount:f,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":M},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Wb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:g,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:M},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(wm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Bm,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),L&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Lg,{clientIds:Q,icon:rg,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function qb(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Yb(t,n,o),0):1}const Yb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+qb(r,e,t,n):o+1};function Zb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d}=e,{expandedState:p,draggedClientIds:g}=jb(),h=t.filter(Boolean),f=h.length;let v=c;return(0,s.createElement)(s.Fragment,null,h.map(((e,t)=>{var c;const{clientId:b,innerBlocks:k}=e;t>0&&(v+=qb(h[t-1],p,g,d));const{itemInView:_}=u,y=_(v),E=t+1,C=i.length>0?`${i}_${E}`:`${E}`,S=!(null==k||!k.length),w=S?null!==(c=p[b])&&void 0!==c?c:d:void 0,B=!(null==g||!g.includes(b)),I=B||y,x=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(b,r),T=a||x&&S;return(0,s.createElement)(m.AsyncModeProvider,{key:b,value:!x},I&&(0,s.createElement)(Kb,{block:e,selectBlock:n,isSelected:x,isBranchSelected:T,isDragged:B,level:l,position:E,rowCount:f,siblingBlockCount:f,showBlockMovers:o,path:C,isExpanded:w,listPosition:v,selectedClientIds:r}),!I&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),S&&w&&!B&&(0,s.createElement)(Zb,{blocks:k,selectBlock:n,showBlockMovers:o,level:l+1,path:C,listPosition:v+1,fixedListWindow:u,isBranchSelected:T,selectedClientIds:r,isExpanded:d}))})))}Zb.defaultProps={selectBlock:()=>{}};const Qb=(0,s.memo)(Zb);function Xb(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:0,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function Jb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const ek=["top","bottom"];const tk=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,nk=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:g}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(to);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:f}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(to),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(to),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(to),{getBlockType:g}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===jc.UP||r.keyCode===jc.DOWN||r.keyCode===jc.HOME||r.keyCode===jc.END);if(!m&&!p()&&!d())return void n(s,null);const f=c(),v=[...l(s),s];m&&!f.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===jc.HOME||r.keyCode===jc.END)&&S.length>1)return;const w=(0,u.difference)(f,S);let B;if(1===w.length){var I;const e=null===(I=g(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,h.sprintf)(
83
  /* translators: %s: block name */
84
  (0,h.__)("%s deselected."),e))}else w.length>1&&(B=(0,h.sprintf)(
85
  /* translators: %s: number of deselected blocks */
86
+ (0,h.__)("%s blocks deselected."),w.length));B&&(0,Gt.speak)(B)}),[e,o,g,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(tk,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(to),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Jg(a,c),p=o(),g=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=th(t,s,ek),u=Jb(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){g(e,e.currentTarget)},onDragEnd(){g.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(to);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:g[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,f,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),L=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[v]),R=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Xb,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:L},(0,s.createElement)($b.Provider,{value:R},(0,s.createElement)(Qb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:g,isExpanded:i}))))}));function ok(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:Fb,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
87
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}const rk=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;V()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(to).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(ok,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(nk,null))})}));function lk(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Hm(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)($d,{item:i,isStylePreview:!0})}function ik(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}const sk=()=>{};function ak(e){let{clientId:t,onSwitch:n=sk,onHoverClassName:o=sk,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:g}=Um({clientId:t,onSwitch:n}),[h,f]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(f,250),y=e=>{var t;h!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),f(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),h&&!k&&(0,s.createElement)(ik,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(lk,{activeStyle:a,className:g,genericPreviewBlock:m,style:h})))}ak.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};const ck=ak,uk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),dk=function(e){let{icon:t=uk,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},pk=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),mk="carousel",gk="grid",hk=e=>{let{onBlockPatternSelect:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{variant:"primary",onClick:t},(0,h.__)("Choose")))},fk=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:bm,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:vm,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))},vk=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a}=e;const c=t===mk,u=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:dl,label:(0,h.__)("Carousel view"),onClick:()=>n(mk),isPressed:c}),(0,s.createElement)(p.Button,{icon:pk,label:(0,h.__)("Grid view"),onClick:()=>n(gk),isPressed:t===gk}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},c&&(0,s.createElement)(fk,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),u,c&&(0,s.createElement)(hk,{onBlockPatternSelect:a}))},bk=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r}=e;const l=(0,p.__unstableUseCompositeState)(),a="block-editor-block-pattern-setup__container";if(t===mk){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(_k,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(kk,{key:e.name,pattern:e,onSelect:r,composite:l})))))};function kk(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(kk,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(Ud,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function _k(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(_k,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(Ud,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}const yk=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:l}=e;const[i,a]=(0,s.useState)(mk),[c,u]=(0,s.useState)(0),{replaceBlock:d}=(0,m.useDispatch)(to),p=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(to),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==p||!p.length)return null;const g=l||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));d(t,n)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(bk,{viewMode:i,activeSlide:c,patterns:p,onBlockPatternSelect:g}),(0,s.createElement)(vk,{viewMode:i,setViewMode:a,activeSlide:c,totalSlides:p.length,handleNext:()=>{u((e=>e+1))},handlePrevious:()=>{u((e=>e-1))},onBlockPatternSelect:()=>{g(p[c].blocks)}})))};function Ek(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:(0,s.createElement)(su,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)(
88
  /* translators: %s: Name of the block variation */