Gutenberg - Version 12.0.2

Version Description

Download this release

Release Info

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

Code changes from version 12.0.1 to 12.0.2

build/block-editor/index.js CHANGED
@@ -36108,9 +36108,13 @@ function BlockStylesPreviewPanelFill(_ref2) {
36108
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
36109
  name: `BlockStylesPreviewPanel/${scope}`
36110
  }, (0,external_wp_element_namespaceObject.createElement)("div", props, children));
36111
- } // Block Styles component for the Settings Sidebar.
 
 
36112
 
36113
 
 
 
36114
  function BlockStyles(_ref3) {
36115
  let {
36116
  clientId,
@@ -36133,7 +36137,8 @@ function BlockStyles(_ref3) {
36133
  const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
36134
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
36135
  const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
36136
- setContainerScrollTop(scrollContainer.scrollTop + 16);
 
36137
  }, [hoveredStyle]);
36138
 
36139
  if (!stylesToRender || stylesToRender.length === 0) {
36108
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Fill, {
36109
  name: `BlockStylesPreviewPanel/${scope}`
36110
  }, (0,external_wp_element_namespaceObject.createElement)("div", props, children));
36111
+ } // Top position (in px) of the Block Styles container
36112
+ // relative to the editor pane.
36113
+ // The value is the equivalent of the container's right position.
36114
 
36115
 
36116
+ const DEFAULT_POSITION_TOP = 16; // Block Styles component for the Settings Sidebar.
36117
+
36118
  function BlockStyles(_ref3) {
36119
  let {
36120
  clientId,
36137
  const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
36138
  (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
36139
  const scrollContainer = document.querySelector('.interface-interface-skeleton__content');
36140
+ const scrollTop = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTop) || 0;
36141
+ setContainerScrollTop(scrollTop + DEFAULT_POSITION_TOP);
36142
  }, [hoveredStyle]);
36143
 
36144
  if (!stylesToRender || stylesToRender.length === 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-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' => '56ef77368d5b1dcf18d4c1f510f4780a');
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-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' => 'd4684bb0c3920c414c5346a9ec9c8a9a');
build/block-editor/index.min.js CHANGED
@@ -66,7 +66,7 @@ function uf(){return{disableCustomColors:!mo("color.custom"),disableCustomGradie
66
  (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)}})}function Pf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==va.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Mf="typography.lineHeight";function Rf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Pf,{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:qo(t)})}})}function Lf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Mf)||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:qo({...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=mo("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=mo("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=mo("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 Gf(e,t,n){if(!(0,r.hasBlockSupport)(t,Uf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(ip())(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=mo("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=mo("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",Gf),(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)),Gf(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`}var Yf=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Zf="typography.fontSize";function Xf(e,t,n){if(!(0,r.hasBlockSupport)(t,Zf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(ip())(e.className);o.add(qf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Qf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("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:qo({...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=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Zf)||!n}const eh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Zf)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!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");(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",Xf),(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)),Xf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",eh);var th=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),nh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const oh=[{name:(0,h.__)("Underline"),value:"underline",icon:th},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:nh}];function rh(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"},oh.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 lh="typography.__experimentalTextDecoration";function ih(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(rh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function sh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,lh),n=mo("typography.textDecoration");return t||!n}var ah=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),ch=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),uh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const dh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:ah},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:ch},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:uh}];function ph(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"},dh.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 mh="typography.__experimentalTextTransform";function fh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ph,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,mh),n=mo("typography.textTransform");return t||!n}function gh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("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 vh="typography.__experimentalLetterSpacing";function bh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(gh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function kh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vh),n=mo("typography.letterSpacing");return t||!n}const _h="typography",yh=[Mf,Zf,Af,Df,Uf,lh,mh,vh];function Eh(e){const{clientId:t}=e,n=$f(e),o=Jf(e),l=Vf(e),i=Lf(e),a=sh(e),c=hh(e),u=kh(e),d=!Ff(e),m=!zf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Vf(e),Jf(e),Lf(e),$f(e),sh(e),hh(e),kh(e)];return t.filter(Boolean).length===t.length}(e),g=Ch(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[_h,"__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)(er,{__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),label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...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)(Qf,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:qo({...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:qo({...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:qo({...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)(ih,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...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)(fh,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:qo({...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)(bh,e)))}const Ch=e=>yh.some((t=>(0,r.hasBlockSupport)(e,t)));function Sh(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.blockGap)}function wh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Sh(e)||t}function Bh(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ba(n);return wh(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(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;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Ih(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.margin)}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!zh(e,"margin");return!Ih(e)||t||n}function Th(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Fh(n,"margin"),a=i&&i.some((e=>Ah.includes(e)));return xh(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Nh(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.padding)}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!zh(e,"padding");return!Nh(e)||t||n}function Mh(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Fh(n,"padding"),a=i&&i.some((e=>Ah.includes(e)));return Ph(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Rh="spacing",Lh=["top","right","bottom","left"],Ah=["vertical","horizontal"];function Dh(e){const t=wh(e),n=Ph(e),o=xh(e),l=Oh(e),i=(a=e.name,"web"===s.Platform.OS&&(Sh(a)||Nh(a)||Ih(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Rh,"__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)(er,{__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:qo({...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)(Mh,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:qo({...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)(Th,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)(Bh,e)))}const Oh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=wh(e),n=Ph(e),o=xh(e);return t&&n&&o};function Fh(e,t){const n=(0,r.getBlockSupport)(e,Rh);if(n&&"boolean"!=typeof n[t])return n[t]}function zh(e,t){const n=Fh(e,t);return!(n&&n.some((e=>Lh.includes(e)))&&n.some((e=>Ah.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Vh=[...yh,Km,bf,Rh],Hh=e=>Vh.some((t=>(0,r.hasBlockSupport)(e,t))),Uh="var:";function Gh(e){return(0,u.startsWith)(e,Uh)?`var(--wp--${e.slice(Uh.length).split("|").join("--")})`:e}function Wh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((n=>{const o=r.__EXPERIMENTAL_STYLE_PROPERTY[n].value,l=r.__EXPERIMENTAL_STYLE_PROPERTY[n].properties;if((0,u.has)(e,o)&&"elements"!==(0,u.first)(o)){const r=(0,u.get)(e,o);l&&!(0,u.isString)(r)?Object.entries(l).forEach((e=>{const[n,o]=e,l=(0,u.get)(r,[o]);l&&(t[n]=Gh(l))})):t[n]=Gh((0,u.get)(e,o))}})),t}const $h={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[bf],"typography.__experimentalSkipSerialization":[_h],[`${Rh}.__experimentalSkipSerialization`]:["spacing"]},jh={...$h,[`${Rh}`]:["spacing.blockGap"]};function Kh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jh;if(!Hh(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...Wh(l),...e.style},e}const qh=(0,d.createHigherOrderComponent)((e=>t=>{const n=$n();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wf,t),(0,s.createElement)(Eh,t),(0,s.createElement)(qm,t),(0,s.createElement)(Dh,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Yh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Wh(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(pm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Hh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Kh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Hh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Kh(o,e,n,$h)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",qh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Yh);var Zh=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},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:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const Xh=[];function Qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rc(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 Jh(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function eg(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=mo("color.duotone")||Xh,a=mo("color.palette")||Xh,c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Zn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Zh,{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})}}))}Ac([Dc]);const tg=(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)(eg,t))}),"withDuotoneControls"),ng=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(pm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Jh,{selector:m,id:p,values:Qh(u)}),h),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",tg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ng);const og="__experimentalLayout";function rg(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Vn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,og,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=Io(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(lg,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function lg(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const ig=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,og)&&(0,s.createElement)(rg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),sg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,og),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(pm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,og)||{},h=null!=m&&m.inherit?u:m||f||{},g=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:h}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,og)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",sg),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",ig);const ag=[];function cg(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=ym("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:Wh({border:r})}}function ug(e){const t=mo("color.palette")||ag,n=cg(e);if(e.borderColor){const o=km(t,e.borderColor);n.style.borderColor=o.color}return n}const dg=[];function pg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=ym("background-color",s),m=ym("color",a),f=Jm(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[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:Wh({color:(null==d?void 0:d.color)||{}})}}function mg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette")||dg,l=mo("color.gradients")||dg,i=pg(e);if(t){const e=km(r,t);i.style.backgroundColor=e.color}if(o&&(i.style.background=ef(l,o)),n){const e=km(r,n);i.style.color=e.color}return i}function fg(e){const{style:t}=e;return{style:Wh({spacing:(null==t?void 0:t.spacing)||{}})}}function hg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const gg=[],vg=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),bg=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette")||gg;return(0,s.createElement)(e,i({},t,{colors:n}))}),"withEditorColorPalette");function kg(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Rc(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=_m(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=km(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:ym(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function _g(e){return function(){const t=vg(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(kg(o,t),"withCustomColors")}}function yg(){const e=bg();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(kg(n,e),"withColors")}const Eg=[];var Cg=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=mo("typography.fontSizes")||Eg;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")},Sg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),wg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Bg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Ig=[{icon:Sg,title:(0,h.__)("Align text left"),align:"left"},{icon:wg,title:(0,h.__)("Align text center"),align:"center"},{icon:Bg,title:(0,h.__)("Align text right"),align:"right"}],xg={position:"bottom right",isAlternate:!0};var Tg=function(e){let{value:t,onChange:n,alignmentControls:o=Ig,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)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?Bg:Sg,label:r,toggleProps:{describedBy:l},popoverProps:xg,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Ng(e){return(0,s.createElement)(Tg,i({},e,{isToolbar:!1}))}function Pg(e){return(0,s.createElement)(Tg,i({},e,{isToolbar:!0}))}var Mg={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(Vn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=wu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Yu(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)(Ua,{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))}}};const Rg=[];function Lg(e){let{completers:t=Rg}=e;const{name:n}=Wn();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Mg])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ag=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Lg(e)}))},Dg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),Og=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:Dg,label:n,onClick:()=>o(!t),disabled:r})},Fg=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},zg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Vg=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Vn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Vn),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)(wo,{icon:zg,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)(Ld,{clientId:e})),(0,s.createElement)(wo,{icon:zg,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ld,{clientId:r})))};function Hg(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:h,isParentHighlighted:g}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(Vn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":g,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const Ug=()=>(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"})),Gg=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)(Ug,null)))},Wg=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!==va.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Gg,null)))}))}};var $g=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Wg(n),renderContent:()=>t})},jg=(0,s.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(F.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Kg=na(p.__experimentalTreeGridRow);function qg(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=la({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Kg,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Yg(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)(wo,{icon:zg}))}var Zg=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_}=t;const y=Rd(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)(
67
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
68
  (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,"aria-describedby":E,ref:n,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_},(0,s.createElement)(Yg,{onClick:a}),(0,s.createElement)(Ua,{icon:null==y?void 0:y.icon,showColors:!0}),(0,s.createElement)(Ld,{clientId:r}),(null==y?void 0:y.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},y.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:E},C))})),Xg=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,...p}=e;const{clientId:f}=r,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(Vn);return{rootClientId:t(f)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[f]),v=h&&g===f,b=c()("block-editor-list-view-block-contents",{"is-dropping-before":v});return(0,s.createElement)(Ad,{clientIds:[r.clientId]},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(Zg,i({ref:t,className:b,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f},p))}))}));const Qg=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Jg=()=>(0,s.useContext)(Qg);var ev=(0,s.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:a,rowCount:u,siblingBlockCount:d,showBlockMovers:f,path:h,isExpanded:g}=e;const v=(0,s.useRef)(null),[b,k]=(0,s.useState)(!1),{clientId:_}=t,{toggleBlockHighlight:y}=(0,m.useDispatch)(Vn),{__experimentalFeatures:E,__experimentalPersistentListViewFeatures:C,__experimentalHideContainerBlockActions:S,isTreeGridMounted:w,expand:B,collapse:I}=Jg(),x=f&&d>0,T=c()("block-editor-list-view-block__mover-cell",{"is-visible":b||o}),N=c()("block-editor-list-view-block__menu-cell",{"is-visible":b||o});(0,s.useEffect)((()=>{C&&!w&&o&&v.current.focus()}),[]);const P=C?y:()=>{},M=(0,s.useCallback)((()=>{k(!0),P(_,!0)}),[_,k,P]),R=(0,s.useCallback)((()=>{k(!1),P(_,!1)}),[_,k,P]),L=(0,s.useCallback)((e=>{e.stopPropagation(),l(_)}),[_,l]),A=(0,s.useCallback)((e=>{e.stopPropagation(),!0===g?I(_):!1===g&&B(_)}),[_,B,I,g]),D=E&&(!S||S&&a>1),O=E&&!D;let F;x?F=2:O&&(F=3);const z=c()({"is-selected":o,"is-branch-selected":C&&r,"is-dragging":n,"has-single-cell":O});return(0,s.createElement)(qg,{className:z,onMouseEnter:M,onMouseLeave:R,onFocus:M,onBlur:R,level:a,position:i,rowCount:u,path:h,id:`list-view-block-${_}`,"data-block":_,isExpanded:g},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:F,ref:v},(e=>{let{ref:n,tabIndex:r,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Xg,{block:t,onClick:L,onToggleExpanded:A,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l}))})),x&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:T,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(jd,{orientation:"vertical",clientIds:[_],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)(Kd,{orientation:"vertical",clientIds:[_],ref:t,tabIndex:n,onFocus:o})})))),D&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:N},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Fp,{clientIds:[_],icon:_p,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:L})})))}));function tv(e,t,n){var o;return(null==n?void 0:n.includes(e.clientId))?0:null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(nv(t,n),0):1}const nv=(e,t)=>(n,o)=>{var r;return(null==t?void 0:t.includes(o.clientId))?n:(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+tv(o,e,t):n+1};function ov(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p}=e,{expandedState:f,draggedClientIds:h,__experimentalPersistentListViewFeatures:g}=Jg(),v=(0,u.compact)(t),b=v.length;let k=d;return(0,s.createElement)(s.Fragment,null,v.map(((e,t)=>{var d;const{clientId:_,innerBlocks:y}=e;t>0&&(k+=tv(v[t-1],f,h));const E=g,{itemInView:C}=p,S=!E||C(k),w=t+1,B=a.length>0?`${a}_${w}`:`${w}`,I=r&&!!y&&!!y.length,x=I?null===(d=f[_])||void 0===d||d:void 0,T=!(null==h||!h.includes(_)),N=T||S,P=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||P&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!P},N&&(0,s.createElement)(ev,{block:e,selectBlock:n,isSelected:P,isBranchSelected:M,isDragged:T,level:i,position:w,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:x,listPosition:k}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,s.createElement)(ov,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}ov.defaultProps={selectBlock:()=>{}};var rv=(0,s.memo)(ov);function lv(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:t.height,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,{noArrow:!0,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 iv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const sv=["top","bottom"];const av=()=>{},cv=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var uv=(0,s.forwardRef)((function(e,t){let{blocks:n,onSelect:o=av,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:u,...f}=e;const{clientIdsTree:g,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Vn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{selectBlock:k}=(0,m.useDispatch)(Vn),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Vn),o=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),y=(0,s.useCallback)((e=>{k(e),o(e)}),[k,o]),[E,C]=(0,s.useReducer)(cv,{}),{ref:S,target:w}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Vn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Jp(a,c),p=o(),f=(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]=tm(t,s,sv),u=iv(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,i),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){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),B=(0,s.useRef)(),I=(0,d.useMergeRefs)([B,S,t]),x=(0,s.useRef)(!1);(0,s.useEffect)((()=>{x.current=!0}),[]);const[T]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),N=(0,s.useCallback)((e=>{e&&C({type:"expand",clientId:e})}),[C]),P=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientId:e})}),[C]),M=(0,s.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,s.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),L=(0,s.useMemo)((()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:x.current,draggedClientIds:v,expandedState:E,expand:N,collapse:P})),[r,l,a,x.current,v,E,N,P]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(lv,{listViewRef:B,blockDropTarget:w}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:I,onCollapseRow:R,onExpandRow:M},(0,s.createElement)(Qg.Provider,{value:L},(0,s.createElement)(rv,i({blocks:g,selectBlock:y,showNestedBlocks:c,showBlockMovers:u,fixedListWindow:T,selectedClientIds:b},f)))))}));function dv(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:jg,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
69
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var pv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Vn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(dv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(uv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function mv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=sp(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)(mu,{item:i,isStylePreview:!0})}function fv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function hv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=cp({clientId:t,onSwitch:n}),[h,g]=(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");b(e.scrollTop+16)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(g,250),y=e=>{l(e),o(null),g(null),_.cancel()},E=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:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{va.ENTER!==t.keyCode&&va.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(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)(fv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(mv,{activeStyle:a,className:f,genericPreviewBlock:m,style:h})))}hv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var gv=hv,vv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),bv=function(e){let{icon:t=vv,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"))))},kv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"}));const _v="carousel",yv="grid",Ev=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},Cv=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:Vd,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:zd,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Sv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===_v,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:no,label:(0,h.__)("Carousel view"),onClick:()=>n(_v),isPressed:u}),(0,s.createElement)(p.Button,{icon:kv,label:(0,h.__)("Grid view"),onClick:()=>n(yv),isPressed:t===yv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Cv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Ev,{onBlockPatternSelect:a,onStartBlank:c}))};const wv=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===_v){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Iv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Bv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Bv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(Bv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(pu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Iv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Iv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(pu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var xv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(_v),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Vn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Vn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Sv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(wv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const Tv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Nv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(Vn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(Vn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Tv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Ud,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const Pv=(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"})),Mv=(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"})),Rv={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:Mv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Pv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Lv=["top","center","bottom"],Av={isAlternate:!0};var Dv=function(e){let{value:t,onChange:n,controls:o=Lv,isCollapsed:r=!0,isToolbar:l}=e;const a=Rv[t],c=Rv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Av,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function Ov(e){return(0,s.createElement)(Dv,i({},e,{isToolbar:!1}))}function Fv(e){return(0,s.createElement)(Dv,i({},e,{isToolbar:!0}))}var zv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("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"),Vv=zv(p.ColorPalette);function Hv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(bm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Uv=function(e,t){return(Uv=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)},Gv=function(){return(Gv=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 Wv(e,t,n,o){void 0===o&&(o=0);var r=tb(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 $v(e,t,n,o,r){void 0===r&&(r=0);var l=tb(t.width,t.height,r),i=l.width,s=l.height;return{x:jv(e.x,i,n.width,o),y:jv(e.y,s,n.height,o)}}function jv(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Kv(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function qv(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Yv(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Zv:Xv,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:Gv(Gv({},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 Zv(e,t){return Math.min(e,Math.max(0,t))}function Xv(e,t){return t}function Qv(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 Jv(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function eb(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 tb(e,t,n){var o=e/2,r=t/2,l=[eb(0,0,o,r,n),eb(e,0,o,r,n),eb(e,t,o,r,n),eb(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 nb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var ob=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=Qv(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:Wv(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=Gv({},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?$v(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?$v(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=Yv(n.props.restrictPosition?$v(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?$v(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}Uv(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=Kv(n,o),this.lastPinchRotation=qv(n,o),this.onDragStart(Jv(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Jv(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Kv(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=qv(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,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,v=g.containerClassName,b=g.cropAreaClassName,k=g.mediaClassName;return Gr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:nb("reactEasyCrop_Container",v)},n?Gr().createElement("img",Gv({alt:"",className:nb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Gv(Gv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Gr().createElement("video",Gv({autoPlay:!0,loop:!0,muted:!0,className:nb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Gv(Gv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Gr().createElement("div",{style:Gv(Gv({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:nb("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}(Gr().Component);const rb={position:"bottom right",isAlternate:!0};var lb=window.wp.apiFetch,ib=n.n(lb);const sb=(0,s.createContext)({}),ab=()=>(0,s.useContext)(sb);function cb(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)(),[f,h]=(0,s.useState)(),[g,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=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Nu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ib()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)(
70
  /* translators: 1. Error message */
71
  (0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(sb.Provider,{value:f},u)}function ub(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=ab();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(ob,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var db=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function pb(){const{isInProgress:e,zoom:t,setZoom:n}=ab();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:rb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:db,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var mb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function fb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?rp:void 0},t)})))}function hb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=ab();return(0,s.createElement)(p.DropdownMenu,{icon:mb,label:(0,h.__)("Aspect Ratio"),popoverProps:rb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(fb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(fb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var gb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function vb(){const{isInProgress:e,rotateClockwise:t}=ab();return(0,s.createElement)(p.ToolbarButton,{icon:gb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function bb(){const{isInProgress:e,apply:t,cancel:n}=ab();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function kb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ub,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Zn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(pb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(hb,{toggleProps:e}))),(0,s.createElement)(vb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(bb,null))))}const _b=[25,50,75,100];function yb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},_b.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Eb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Cb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class Sb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,ya()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,rd.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)(
72
  /* translators: %s: number of results. */
66
  (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)}})}function Pf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==va.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Mf="typography.lineHeight";function Rf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Pf,{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:qo(t)})}})}function Lf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Mf)||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:qo({...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=mo("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=mo("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=mo("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 Gf(e,t,n){if(!(0,r.hasBlockSupport)(t,Uf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(ip())(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=mo("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=mo("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",Gf),(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)),Gf(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`}var Yf=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Zf="typography.fontSize";function Xf(e,t,n){if(!(0,r.hasBlockSupport)(t,Zf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(ip())(e.className);o.add(qf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Qf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("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:qo({...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=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Zf)||!n}const eh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Zf)||(0,r.hasBlockSupport)(i,"typography.__experimentalSkipSerialization")||!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");(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",Xf),(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)),Xf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",eh);var th=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),nh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const oh=[{name:(0,h.__)("Underline"),value:"underline",icon:th},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:nh}];function rh(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"},oh.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 lh="typography.__experimentalTextDecoration";function ih(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(rh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function sh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,lh),n=mo("typography.textDecoration");return t||!n}var ah=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),ch=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),uh=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const dh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:ah},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:ch},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:uh}];function ph(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"},dh.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 mh="typography.__experimentalTextTransform";function fh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(ph,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,mh),n=mo("typography.textTransform");return t||!n}function gh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("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 vh="typography.__experimentalLetterSpacing";function bh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(gh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function kh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vh),n=mo("typography.letterSpacing");return t||!n}const _h="typography",yh=[Mf,Zf,Af,Df,Uf,lh,mh,vh];function Eh(e){const{clientId:t}=e,n=$f(e),o=Jf(e),l=Vf(e),i=Lf(e),a=sh(e),c=hh(e),u=kh(e),d=!Ff(e),m=!zf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Vf(e),Jf(e),Lf(e),$f(e),sh(e),hh(e),kh(e)];return t.filter(Boolean).length===t.length}(e),g=Ch(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[_h,"__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)(er,{__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),label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...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)(Qf,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:qo({...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:qo({...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:qo({...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)(ih,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...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)(fh,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:qo({...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)(bh,e)))}const Ch=e=>yh.some((t=>(0,r.hasBlockSupport)(e,t)));function Sh(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.blockGap)}function wh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Sh(e)||t}function Bh(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ba(n);return wh(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(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;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Ih(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.margin)}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!zh(e,"margin");return!Ih(e)||t||n}function Th(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Fh(n,"margin"),a=i&&i.some((e=>Ah.includes(e)));return xh(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Nh(e){const t=(0,r.getBlockSupport)(e,Rh);return!!(!0===t||null!=t&&t.padding)}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!zh(e,"padding");return!Nh(e)||t||n}function Mh(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Fh(n,"padding"),a=i&&i.some((e=>Ah.includes(e)));return Ph(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Rh="spacing",Lh=["top","right","bottom","left"],Ah=["vertical","horizontal"];function Dh(e){const t=wh(e),n=Ph(e),o=xh(e),l=Oh(e),i=(a=e.name,"web"===s.Platform.OS&&(Sh(a)||Nh(a)||Ih(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Rh,"__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)(er,{__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:qo({...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)(Mh,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:qo({...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)(Th,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)(Bh,e)))}const Oh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=wh(e),n=Ph(e),o=xh(e);return t&&n&&o};function Fh(e,t){const n=(0,r.getBlockSupport)(e,Rh);if(n&&"boolean"!=typeof n[t])return n[t]}function zh(e,t){const n=Fh(e,t);return!(n&&n.some((e=>Lh.includes(e)))&&n.some((e=>Ah.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Vh=[...yh,Km,bf,Rh],Hh=e=>Vh.some((t=>(0,r.hasBlockSupport)(e,t))),Uh="var:";function Gh(e){return(0,u.startsWith)(e,Uh)?`var(--wp--${e.slice(Uh.length).split("|").join("--")})`:e}function Wh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((n=>{const o=r.__EXPERIMENTAL_STYLE_PROPERTY[n].value,l=r.__EXPERIMENTAL_STYLE_PROPERTY[n].properties;if((0,u.has)(e,o)&&"elements"!==(0,u.first)(o)){const r=(0,u.get)(e,o);l&&!(0,u.isString)(r)?Object.entries(l).forEach((e=>{const[n,o]=e,l=(0,u.get)(r,[o]);l&&(t[n]=Gh(l))})):t[n]=Gh((0,u.get)(e,o))}})),t}const $h={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[bf],"typography.__experimentalSkipSerialization":[_h],[`${Rh}.__experimentalSkipSerialization`]:["spacing"]},jh={...$h,[`${Rh}`]:["spacing.blockGap"]};function Kh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jh;if(!Hh(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{(0,r.getBlockSupport)(t,n)&&(l=(0,u.omit)(l,e))})),e.style={...Wh(l),...e.style},e}const qh=(0,d.createHigherOrderComponent)((e=>t=>{const n=$n();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wf,t),(0,s.createElement)(Eh,t),(0,s.createElement)(qm,t),(0,s.createElement)(Dh,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Yh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=null===(n=t.attributes.style)||void 0===n?void 0:n.elements,a=`wp-elements-${(0,d.useInstanceId)(e)}`,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Wh(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(pm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,l&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:l?c()(t.className,a):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Hh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Kh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Hh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Kh(o,e,n,$h)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",qh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Yh);var Zh=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},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:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const Xh=[];function Qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rc(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 Jh(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:n},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function eg(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=mo("color.duotone")||Xh,a=mo("color.palette")||Xh,c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Zn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Zh,{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})}}))}Ac([Dc]);const tg=(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)(eg,t))}),"withDuotoneControls"),ng=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(pm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(Jh,{selector:m,id:p,values:Qh(u)}),h),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",tg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ng);const og="__experimentalLayout";function rg(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Vn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,og,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=Io(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(lg,{type:k,onChange:e=>t({layout:{type:e}})}),!b&&_&&(0,s.createElement)(_.inspectorControls,{layout:v,onChange:y,layoutBlockSupport:c}))),!b&&_&&(0,s.createElement)(_.toolBarControls,{layout:v,onChange:y,layoutBlockSupport:c}))}function lg(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const ig=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,og)&&(0,s.createElement)(rg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),sg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,og),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(pm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,og)||{},h=null!=m&&m.inherit?u:m||f||{},g=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:h}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,og)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",sg),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",ig);const ag=[];function cg(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=ym("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:Wh({border:r})}}function ug(e){const t=mo("color.palette")||ag,n=cg(e);if(e.borderColor){const o=km(t,e.borderColor);n.style.borderColor=o.color}return n}const dg=[];function pg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=ym("background-color",s),m=ym("color",a),f=Jm(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[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:Wh({color:(null==d?void 0:d.color)||{}})}}function mg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette")||dg,l=mo("color.gradients")||dg,i=pg(e);if(t){const e=km(r,t);i.style.backgroundColor=e.color}if(o&&(i.style.background=ef(l,o)),n){const e=km(r,n);i.style.color=e.color}return i}function fg(e){const{style:t}=e;return{style:Wh({spacing:(null==t?void 0:t.spacing)||{}})}}function hg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const gg=[],vg=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),bg=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette")||gg;return(0,s.createElement)(e,i({},t,{colors:n}))}),"withEditorColorPalette");function kg(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Rc(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=_m(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=km(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:ym(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function _g(e){return function(){const t=vg(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(kg(o,t),"withCustomColors")}}function yg(){const e=bg();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(kg(n,e),"withColors")}const Eg=[];var Cg=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=mo("typography.fontSizes")||Eg;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")},Sg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),wg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Bg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Ig=[{icon:Sg,title:(0,h.__)("Align text left"),align:"left"},{icon:wg,title:(0,h.__)("Align text center"),align:"center"},{icon:Bg,title:(0,h.__)("Align text right"),align:"right"}],xg={position:"bottom right",isAlternate:!0};var Tg=function(e){let{value:t,onChange:n,alignmentControls:o=Ig,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)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?Bg:Sg,label:r,toggleProps:{describedBy:l},popoverProps:xg,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Ng(e){return(0,s.createElement)(Tg,i({},e,{isToolbar:!1}))}function Pg(e){return(0,s.createElement)(Tg,i({},e,{isToolbar:!0}))}var Mg={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(Vn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=wu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Yu(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)(Ua,{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))}}};const Rg=[];function Lg(e){let{completers:t=Rg}=e;const{name:n}=Wn();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Mg])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ag=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Lg(e)}))},Dg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),Og=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:Dg,label:n,onClick:()=>o(!t),disabled:r})},Fg=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},zg=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Vg=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Vn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Vn),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)(wo,{icon:zg,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)(Ld,{clientId:e})),(0,s.createElement)(wo,{icon:zg,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ld,{clientId:r})))};function Hg(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:h,isParentHighlighted:g}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(Vn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":g,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const Ug=()=>(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"})),Gg=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)(Ug,null)))},Wg=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!==va.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Gg,null)))}))}};var $g=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Wg(n),renderContent:()=>t})},jg=(0,s.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(F.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Kg=na(p.__experimentalTreeGridRow);function qg(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=la({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Kg,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Yg(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)(wo,{icon:zg}))}var Zg=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_}=t;const y=Rd(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)(
67
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
68
  (0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,"aria-describedby":E,ref:n,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_},(0,s.createElement)(Yg,{onClick:a}),(0,s.createElement)(Ua,{icon:null==y?void 0:y.icon,showColors:!0}),(0,s.createElement)(Ld,{clientId:r}),(null==y?void 0:y.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},y.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:E},C))})),Xg=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,...p}=e;const{clientId:f}=r,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(Vn);return{rootClientId:t(f)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[f]),v=h&&g===f,b=c()("block-editor-list-view-block-contents",{"is-dropping-before":v});return(0,s.createElement)(Ad,{clientIds:[r.clientId]},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(Zg,i({ref:t,className:b,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f},p))}))}));const Qg=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Jg=()=>(0,s.useContext)(Qg);var ev=(0,s.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:a,rowCount:u,siblingBlockCount:d,showBlockMovers:f,path:h,isExpanded:g}=e;const v=(0,s.useRef)(null),[b,k]=(0,s.useState)(!1),{clientId:_}=t,{toggleBlockHighlight:y}=(0,m.useDispatch)(Vn),{__experimentalFeatures:E,__experimentalPersistentListViewFeatures:C,__experimentalHideContainerBlockActions:S,isTreeGridMounted:w,expand:B,collapse:I}=Jg(),x=f&&d>0,T=c()("block-editor-list-view-block__mover-cell",{"is-visible":b||o}),N=c()("block-editor-list-view-block__menu-cell",{"is-visible":b||o});(0,s.useEffect)((()=>{C&&!w&&o&&v.current.focus()}),[]);const P=C?y:()=>{},M=(0,s.useCallback)((()=>{k(!0),P(_,!0)}),[_,k,P]),R=(0,s.useCallback)((()=>{k(!1),P(_,!1)}),[_,k,P]),L=(0,s.useCallback)((e=>{e.stopPropagation(),l(_)}),[_,l]),A=(0,s.useCallback)((e=>{e.stopPropagation(),!0===g?I(_):!1===g&&B(_)}),[_,B,I,g]),D=E&&(!S||S&&a>1),O=E&&!D;let F;x?F=2:O&&(F=3);const z=c()({"is-selected":o,"is-branch-selected":C&&r,"is-dragging":n,"has-single-cell":O});return(0,s.createElement)(qg,{className:z,onMouseEnter:M,onMouseLeave:R,onFocus:M,onBlur:R,level:a,position:i,rowCount:u,path:h,id:`list-view-block-${_}`,"data-block":_,isExpanded:g},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:F,ref:v},(e=>{let{ref:n,tabIndex:r,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Xg,{block:t,onClick:L,onToggleExpanded:A,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l}))})),x&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:T,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(jd,{orientation:"vertical",clientIds:[_],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)(Kd,{orientation:"vertical",clientIds:[_],ref:t,tabIndex:n,onFocus:o})})))),D&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:N},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Fp,{clientIds:[_],icon:_p,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:L})})))}));function tv(e,t,n){var o;return(null==n?void 0:n.includes(e.clientId))?0:null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(nv(t,n),0):1}const nv=(e,t)=>(n,o)=>{var r;return(null==t?void 0:t.includes(o.clientId))?n:(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+tv(o,e,t):n+1};function ov(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p}=e,{expandedState:f,draggedClientIds:h,__experimentalPersistentListViewFeatures:g}=Jg(),v=(0,u.compact)(t),b=v.length;let k=d;return(0,s.createElement)(s.Fragment,null,v.map(((e,t)=>{var d;const{clientId:_,innerBlocks:y}=e;t>0&&(k+=tv(v[t-1],f,h));const E=g,{itemInView:C}=p,S=!E||C(k),w=t+1,B=a.length>0?`${a}_${w}`:`${w}`,I=r&&!!y&&!!y.length,x=I?null===(d=f[_])||void 0===d||d:void 0,T=!(null==h||!h.includes(_)),N=T||S,P=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||P&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!P},N&&(0,s.createElement)(ev,{block:e,selectBlock:n,isSelected:P,isBranchSelected:M,isDragged:T,level:i,position:w,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:x,listPosition:k}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,s.createElement)(ov,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}ov.defaultProps={selectBlock:()=>{}};var rv=(0,s.memo)(ov);function lv(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:t.height,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,{noArrow:!0,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 iv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const sv=["top","bottom"];const av=()=>{},cv=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var uv=(0,s.forwardRef)((function(e,t){let{blocks:n,onSelect:o=av,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:u,...f}=e;const{clientIdsTree:g,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Vn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{selectBlock:k}=(0,m.useDispatch)(Vn),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Vn),o=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),y=(0,s.useCallback)((e=>{k(e),o(e)}),[k,o]),[E,C]=(0,s.useReducer)(cv,{}),{ref:S,target:w}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Vn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Jp(a,c),p=o(),f=(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]=tm(t,s,sv),u=iv(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,i),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){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),B=(0,s.useRef)(),I=(0,d.useMergeRefs)([B,S,t]),x=(0,s.useRef)(!1);(0,s.useEffect)((()=>{x.current=!0}),[]);const[T]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),N=(0,s.useCallback)((e=>{e&&C({type:"expand",clientId:e})}),[C]),P=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientId:e})}),[C]),M=(0,s.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,s.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),L=(0,s.useMemo)((()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:x.current,draggedClientIds:v,expandedState:E,expand:N,collapse:P})),[r,l,a,x.current,v,E,N,P]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(lv,{listViewRef:B,blockDropTarget:w}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:I,onCollapseRow:R,onExpandRow:M},(0,s.createElement)(Qg.Provider,{value:L},(0,s.createElement)(rv,i({blocks:g,selectBlock:y,showNestedBlocks:c,showBlockMovers:u,fixedListWindow:T,selectedClientIds:b},f)))))}));function dv(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:jg,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
69
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var pv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Vn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(dv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(uv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function mv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=sp(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)(mu,{item:i,isStylePreview:!0})}function fv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function hv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=cp({clientId:t,onSwitch:n}),[h,g]=(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)(g,250),y=e=>{l(e),o(null),g(null),_.cancel()},E=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:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{va.ENTER!==t.keyCode&&va.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(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)(fv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(mv,{activeStyle:a,className:f,genericPreviewBlock:m,style:h})))}hv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var gv=hv,vv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"})),bv=function(e){let{icon:t=vv,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"))))},kv=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.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"}));const _v="carousel",yv="grid",Ev=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},Cv=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:Vd,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:zd,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Sv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===_v,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:no,label:(0,h.__)("Carousel view"),onClick:()=>n(_v),isPressed:u}),(0,s.createElement)(p.Button,{icon:kv,label:(0,h.__)("Grid view"),onClick:()=>n(yv),isPressed:t===yv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Cv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Ev,{onBlockPatternSelect:a,onStartBlank:c}))};const wv=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===_v){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:a},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Iv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Bv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Bv(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,title:a,description:c,viewportWidth:u=700}=t,m=(0,d.useInstanceId)(Bv,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?m:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(pu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Iv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Iv,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,s.createElement)(pu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var xv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(_v),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Vn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Vn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Sv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(wv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const Tv=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};var Nv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(Vn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(Vn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Tv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Ud,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${d}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:c,value:n,onSelect:u})))))};const Pv=(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"})),Mv=(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"})),Rv={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:Mv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Pv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Lv=["top","center","bottom"],Av={isAlternate:!0};var Dv=function(e){let{value:t,onChange:n,controls:o=Lv,isCollapsed:r=!0,isToolbar:l}=e;const a=Rv[t],c=Rv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Av,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function Ov(e){return(0,s.createElement)(Dv,i({},e,{isToolbar:!1}))}function Fv(e){return(0,s.createElement)(Dv,i({},e,{isToolbar:!0}))}var zv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("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"),Vv=zv(p.ColorPalette);function Hv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(bm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Uv=function(e,t){return(Uv=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)},Gv=function(){return(Gv=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 Wv(e,t,n,o){void 0===o&&(o=0);var r=tb(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 $v(e,t,n,o,r){void 0===r&&(r=0);var l=tb(t.width,t.height,r),i=l.width,s=l.height;return{x:jv(e.x,i,n.width,o),y:jv(e.y,s,n.height,o)}}function jv(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Kv(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function qv(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Yv(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Zv:Xv,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:Gv(Gv({},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 Zv(e,t){return Math.min(e,Math.max(0,t))}function Xv(e,t){return t}function Qv(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 Jv(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function eb(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 tb(e,t,n){var o=e/2,r=t/2,l=[eb(0,0,o,r,n),eb(e,0,o,r,n),eb(e,t,o,r,n),eb(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 nb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var ob=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=Qv(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:Wv(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=Gv({},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?$v(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?$v(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=Yv(n.props.restrictPosition?$v(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?$v(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}Uv(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=Kv(n,o),this.lastPinchRotation=qv(n,o),this.onDragStart(Jv(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Jv(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Kv(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=qv(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,f=p.cropAreaStyle,h=p.mediaStyle,g=t.classes,v=g.containerClassName,b=g.cropAreaClassName,k=g.mediaClassName;return Gr().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:nb("reactEasyCrop_Container",v)},n?Gr().createElement("img",Gv({alt:"",className:nb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Gv(Gv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Gr().createElement("video",Gv({autoPlay:!0,loop:!0,muted:!0,className:nb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Gv(Gv({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Gr().createElement("div",{style:Gv(Gv({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:nb("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}(Gr().Component);const rb={position:"bottom right",isAlternate:!0};var lb=window.wp.apiFetch,ib=n.n(lb);const sb=(0,s.createContext)({}),ab=()=>(0,s.useContext)(sb);function cb(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)(),[f,h]=(0,s.useState)(),[g,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=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Nu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ib()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)(
70
  /* translators: 1. Error message */
71
  (0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(sb.Provider,{value:f},u)}function ub(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=ab();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(ob,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var db=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function pb(){const{isInProgress:e,zoom:t,setZoom:n}=ab();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:rb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:db,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var mb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function fb(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?rp:void 0},t)})))}function hb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=ab();return(0,s.createElement)(p.DropdownMenu,{icon:mb,label:(0,h.__)("Aspect Ratio"),popoverProps:rb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(fb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(fb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var gb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(F.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function vb(){const{isInProgress:e,rotateClockwise:t}=ab();return(0,s.createElement)(p.ToolbarButton,{icon:gb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function bb(){const{isInProgress:e,apply:t,cancel:n}=ab();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function kb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ub,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Zn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(pb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(hb,{toggleProps:e}))),(0,s.createElement)(vb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(bb,null))))}const _b=[25,50,75,100];function yb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},_b.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Eb=(0,s.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Cb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class Sb extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,ya()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,rd.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)(
72
  /* translators: %s: number of results. */
changelog.txt CHANGED
@@ -1,10 +1,324 @@
1
  == Changelog ==
2
 
3
- = 12.0.1 =
4
 
5
- ### Enhancements
 
 
 
 
6
 
7
- #### Global Styles
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  - Add caching to `WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()`. ([36584](https://github.com/WordPress/gutenberg/pull/36584))
9
 
10
 
1
  == Changelog ==
2
 
3
+ = 12.0.2 =
4
 
5
+ ### Bug Fixes
6
+
7
+ #### Block Variations
8
+ - Block Styles: Check for existence of scroll container. ([37010](https://github.com/WordPress/gutenberg/pull/37010))
9
+
10
 
11
+
12
+
13
+
14
+ = 12.1.0-rc.1 =
15
+
16
+
17
+
18
+ ### Enhancements
19
+
20
+ #### Components
21
+ - Add `__unstable-large` size variant on `InputControl` `SelectControl` `UnitControl`. ([35646](https://github.com/WordPress/gutenberg/pull/35646))
22
+ - Font Size Picker: Allow non-integers as simple CSS values and in hints. ([36636](https://github.com/WordPress/gutenberg/pull/36636))
23
+ - Improve `vertical` and RTL support for `Divider`. ([36579](https://github.com/WordPress/gutenberg/pull/36579))
24
+ - ItemGroup: Experimenting with chevron icon. ([36654](https://github.com/WordPress/gutenberg/pull/36654))
25
+ - Toggle Group Control: Add tooltip. ([36726](https://github.com/WordPress/gutenberg/pull/36726))
26
+ - `Modal`: Add `__experimentalHideHeader` prop, wrap in `forwardref`. ([36831](https://github.com/WordPress/gutenberg/pull/36831))
27
+ - `ZStack`: Support RTL layouts when applying `offset`. ([36769](https://github.com/WordPress/gutenberg/pull/36769))
28
+
29
+ #### Site Editor
30
+ - Add icons to navigation sidebar items. ([36893](https://github.com/WordPress/gutenberg/pull/36893))
31
+ - Allow editing custom template title. ([36933](https://github.com/WordPress/gutenberg/pull/36933))
32
+ - Only render the site editor canvas when the global styles are ready. ([36643](https://github.com/WordPress/gutenberg/pull/36643))
33
+ - Remove extra border radius. ([37022](https://github.com/WordPress/gutenberg/pull/37022))
34
+ - Show theme, plugin or author in Added By column with appropriate icon or avatar. ([36763](https://github.com/WordPress/gutenberg/pull/36763))
35
+ - Update navigation sidebar responsiveness. ([36638](https://github.com/WordPress/gutenberg/pull/36638))
36
+
37
+ #### Global Styles
38
+ - Borders: Switch to ToolsPanel for displaying UI. ([33743](https://github.com/WordPress/gutenberg/pull/33743))
39
+ - Custom color palette: Add default color name. ([36940](https://github.com/WordPress/gutenberg/pull/36940))
40
+ - Polish unset color indicator. ([36994](https://github.com/WordPress/gutenberg/pull/36994))
41
+
42
+ #### Block Editor
43
+ - Always show the block appender when its parent is selected. ([36656](https://github.com/WordPress/gutenberg/pull/36656))
44
+ - Insertion point bar: Hide onBlur and onMouseLeave. ([36798](https://github.com/WordPress/gutenberg/pull/36798))
45
+ - Writing Flow: Double escape unselects all blocks. ([36945](https://github.com/WordPress/gutenberg/pull/36945))
46
+
47
+ #### Block Library
48
+ - Add spacing attributes to comment author avatar. ([36322](https://github.com/WordPress/gutenberg/pull/36322))
49
+ - Only show submenu options and Show arrow button when relevant. ([36826](https://github.com/WordPress/gutenberg/pull/36826))
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ - Dependency Extraction Webpack Plugin: Make the plugin work when using `optimizations.runtimeChunk = 'single'`. ([26214](https://github.com/WordPress/gutenberg/pull/26214))
55
+ - Fix document typo. ([36776](https://github.com/WordPress/gutenberg/pull/36776))
56
+ - Prevent CleanWebpackPlugin webpack plugin from deleting webpack assets. ([35986](https://github.com/WordPress/gutenberg/pull/35986))
57
+ - Try: Hide the columns inserter in pattern previews. ([36626](https://github.com/WordPress/gutenberg/pull/36626))
58
+ - Update theme.json version. ([36917](https://github.com/WordPress/gutenberg/pull/36917))
59
+
60
+ #### Block Library
61
+ - Add page list to navigation direct insert conditions. ([36591](https://github.com/WordPress/gutenberg/pull/36591))
62
+ - Cover: Fix undo trap. ([36807](https://github.com/WordPress/gutenberg/pull/36807))
63
+ - Fix Nav block editing wrong entity on creation of new Menu. ([36880](https://github.com/WordPress/gutenberg/pull/36880))
64
+ - Fix Nav block fallback DB query to match on full block grammar start tag. ([36854](https://github.com/WordPress/gutenberg/pull/36854))
65
+ - Fix icon scaling. ([36948](https://github.com/WordPress/gutenberg/pull/36948))
66
+ - Fix non existent menu handling in nav block. ([36507](https://github.com/WordPress/gutenberg/pull/36507))
67
+ - Fix page list missing button styles when set to open on click. ([36601](https://github.com/WordPress/gutenberg/pull/36601))
68
+ - Fix template part slug generation when creating through the block placeholder. ([36764](https://github.com/WordPress/gutenberg/pull/36764))
69
+ - Gallery v1: Allow clicks within replace media placeholder state. ([36804](https://github.com/WordPress/gutenberg/pull/36804))
70
+ - Gallery: Fix stuck image size options loader. ([36806](https://github.com/WordPress/gutenberg/pull/36806))
71
+ - Include cascading properties in Navigation deprecation. ([36432](https://github.com/WordPress/gutenberg/pull/36432))
72
+ - Navigation: Scale submenu icon. ([36714](https://github.com/WordPress/gutenberg/pull/36714))
73
+ - Navigation: Try removing absorb toolbar prop. ([36990](https://github.com/WordPress/gutenberg/pull/36990))
74
+ - Post Featured Image: Add the "Reset" button. ([36572](https://github.com/WordPress/gutenberg/pull/36572))
75
+ - [Post Title]: Fix render error when setting Page to homepage. ([36786](https://github.com/WordPress/gutenberg/pull/36786))
76
+ - [Query Pagination Next/Previous]: Remove text and link color support. ([36954](https://github.com/WordPress/gutenberg/pull/36954))
77
+
78
+ #### Site Editor
79
+ - Stabilize export endpoint. ([36559](https://github.com/WordPress/gutenberg/pull/36559))
80
+ - Templat list fallback to slug. ([36947](https://github.com/WordPress/gutenberg/pull/36947))
81
+ - Templates Controller: Add missing 'is_custom' prop. ([36911](https://github.com/WordPress/gutenberg/pull/36911))
82
+ - Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site. ([36705](https://github.com/WordPress/gutenberg/pull/36705))
83
+ - Validate the postType query argument. ([36706](https://github.com/WordPress/gutenberg/pull/36706))
84
+
85
+ #### Components
86
+ - Color Picker: Re-instate debounce and controlled value to fix issue with gradient picker. ([36941](https://github.com/WordPress/gutenberg/pull/36941))
87
+ - ColorPicker: Replace hardcoded "blue" with theme color. ([36153](https://github.com/WordPress/gutenberg/pull/36153))
88
+ - Tools Panel: Fix race conditions caused by conditionally displayed ToolsPanelItems. ([36588](https://github.com/WordPress/gutenberg/pull/36588))
89
+ - `DateTimePicker`: Set PM hours correctly. ([36878](https://github.com/WordPress/gutenberg/pull/36878))
90
+
91
+ #### Themes
92
+ - Block Templates: Fix PHP notices on WP 5.8. ([36964](https://github.com/WordPress/gutenberg/pull/36964))
93
+ - Don't try and render unstable location if Nav block has ID. ([36863](https://github.com/WordPress/gutenberg/pull/36863))
94
+ - Fix duotone first render in Safari. ([36754](https://github.com/WordPress/gutenberg/pull/36754))
95
+
96
+ #### Accessibility
97
+ - Add accessible labelling to submenu buttons. ([36631](https://github.com/WordPress/gutenberg/pull/36631))
98
+ - Add aria-current="page" to active navigation item. ([36946](https://github.com/WordPress/gutenberg/pull/36946))
99
+ - Fix site editor region navigation. ([36709](https://github.com/WordPress/gutenberg/pull/36709))
100
+
101
+ #### Block Editor
102
+ - Fix wordbreak for URLs. ([36993](https://github.com/WordPress/gutenberg/pull/36993))
103
+ - Writing Flow Multi-select: Ensure post title content editable after multi-select. ([36843](https://github.com/WordPress/gutenberg/pull/36843))
104
+
105
+ #### Full Site Editing
106
+ - Highlight "Site" in the navigation panel. ([36762](https://github.com/WordPress/gutenberg/pull/36762))
107
+ - Show all templates and template parts on the site editor list screens. ([36761](https://github.com/WordPress/gutenberg/pull/36761))
108
+
109
+ #### Design Tools
110
+ - Border panel: Update to display multiple palette origins. ([36753](https://github.com/WordPress/gutenberg/pull/36753))
111
+ - Cover: Move BoxControlVisualizer in the markup to make it visible. ([36635](https://github.com/WordPress/gutenberg/pull/36635))
112
+
113
+ #### Icons
114
+ - [Icons]: Fix Comment Author Name icon. ([36738](https://github.com/WordPress/gutenberg/pull/36738))
115
+ - [Icons]: Fix property names for Comment Author Avatar icon. ([36737](https://github.com/WordPress/gutenberg/pull/36737))
116
+
117
+ #### Block Variations
118
+ - Block Styles: Check for existence of scroll container. ([37010](https://github.com/WordPress/gutenberg/pull/37010))
119
+
120
+ #### Style Variations
121
+ - Block Styles: Add a separating margin to the default picker. ([36976](https://github.com/WordPress/gutenberg/pull/36976))
122
+
123
+ #### Testing
124
+ - Fix: Failing PHPUnit test. ([36931](https://github.com/WordPress/gutenberg/pull/36931))
125
+
126
+ #### Widgets Editor
127
+ - Add CSS fix for 33580. ([36759](https://github.com/WordPress/gutenberg/pull/36759))
128
+
129
+ #### Post Editor
130
+ - Multi-entity save: Only set site entity to pending if really saving. ([36573](https://github.com/WordPress/gutenberg/pull/36573))
131
+
132
+ #### Global Styles
133
+ - Make the core color palette opt-in for themes with not `theme.json`. ([36496](https://github.com/WordPress/gutenberg/pull/36496))
134
+
135
+ #### Data Layer
136
+ - Data: Update types and fix type error. ([36190](https://github.com/WordPress/gutenberg/pull/36190))
137
+
138
+
139
+ ### Performance
140
+
141
+ #### Block Library
142
+ - Improve performance of wp_navigation lookup.. ([36891](https://github.com/WordPress/gutenberg/pull/36891))
143
+
144
+
145
+ ### Experiments
146
+
147
+ #### Global Styles
148
+ - Add elements support to the typography panel in global styles. ([36718](https://github.com/WordPress/gutenberg/pull/36718))
149
+ - Add: Border indication to global styles colors. ([36959](https://github.com/WordPress/gutenberg/pull/36959))
150
+ - Add: Corners to custom color picker popover. ([37015](https://github.com/WordPress/gutenberg/pull/37015))
151
+ - Add: Gradient palette editor. ([36820](https://github.com/WordPress/gutenberg/pull/36820))
152
+ - Add: Missing margin to the color picker clear button. ([37016](https://github.com/WordPress/gutenberg/pull/37016))
153
+ - Add: Transparency support on global styles colors. ([36840](https://github.com/WordPress/gutenberg/pull/36840))
154
+ - Add: Uneditable duotone palette on the palette gradient panel. ([36920](https://github.com/WordPress/gutenberg/pull/36920))
155
+ - Call "palettes" and not "color palettes" on panel label. ([36921](https://github.com/WordPress/gutenberg/pull/36921))
156
+ - Color Picker: Improve border, padding, and box shadow styles. ([36963](https://github.com/WordPress/gutenberg/pull/36963))
157
+ - Color UI component: Reorder palettes and update names (core by defaults, user by custom). ([36622](https://github.com/WordPress/gutenberg/pull/36622))
158
+ - Fix: Apply by slug on all origins. ([36841](https://github.com/WordPress/gutenberg/pull/36841))
159
+ - Fix: Color palette is not being stored. ([36817](https://github.com/WordPress/gutenberg/pull/36817))
160
+ - Fix: Custom color picker popover position. ([36965](https://github.com/WordPress/gutenberg/pull/36965))
161
+ - Fix: Theme colors cannot override defaults. ([36811](https://github.com/WordPress/gutenberg/pull/36811))
162
+ - GlobalStyles sidebar: Do not show default palette if theme opts-out. ([36639](https://github.com/WordPress/gutenberg/pull/36639))
163
+ - Make links plural in global styles. ([36819](https://github.com/WordPress/gutenberg/pull/36819))
164
+ - Make user able to change all color palette origins. ([36674](https://github.com/WordPress/gutenberg/pull/36674))
165
+ - Rename `core` origin key to `default` for presets. ([36645](https://github.com/WordPress/gutenberg/pull/36645))
166
+ - Update function names for the public global styles API functions. ([36907](https://github.com/WordPress/gutenberg/pull/36907))
167
+ - Update: Global Styes: Count all color palette origins on the palette counter. ([36922](https://github.com/WordPress/gutenberg/pull/36922))
168
+ - Update: Rename user preset origin to custom. ([36748](https://github.com/WordPress/gutenberg/pull/36748))
169
+ - theme.json: Add `appearanceTools` flag to opt-in into appearance UI controls. ([36646](https://github.com/WordPress/gutenberg/pull/36646))
170
+
171
+ #### Block Library
172
+ - Allow filtering of Nav block fallback. ([36850](https://github.com/WordPress/gutenberg/pull/36850))
173
+ - Deprecate navigation areas. ([36727](https://github.com/WordPress/gutenberg/pull/36727))
174
+ - Implement suitable fallback for Nav block on front end of site when no menu selected. ([36724](https://github.com/WordPress/gutenberg/pull/36724))
175
+ - Navigation: Fix space-between. ([36441](https://github.com/WordPress/gutenberg/pull/36441))
176
+ - Remove navigationArea context. ([36981](https://github.com/WordPress/gutenberg/pull/36981))
177
+ - Remove unstable max pages attribute from Nav block. ([36877](https://github.com/WordPress/gutenberg/pull/36877))
178
+ - Rename navigationMenuId to ref. ([36739](https://github.com/WordPress/gutenberg/pull/36739))
179
+ - Render empty Nav block if no fallback block can be utilised. ([36849](https://github.com/WordPress/gutenberg/pull/36849))
180
+ - Try always generating navigation post title. ([36760](https://github.com/WordPress/gutenberg/pull/36760))
181
+ - Use first non-empty Nav post as primary fallback for Nav block. ([36740](https://github.com/WordPress/gutenberg/pull/36740))
182
+
183
+ #### Full Site Editing
184
+ - Add success and error snackbars to the templates list page. ([36808](https://github.com/WordPress/gutenberg/pull/36808))
185
+ - Add templates list page for site editor. ([36379](https://github.com/WordPress/gutenberg/pull/36379))
186
+ - Implement "Add New" for templates list in Site Editor. ([36592](https://github.com/WordPress/gutenberg/pull/36592))
187
+ - Remove block template resolution unit tests. ([36855](https://github.com/WordPress/gutenberg/pull/36855))
188
+ - Remove the Styles link in Site Editor. ([36637](https://github.com/WordPress/gutenberg/pull/36637))
189
+ - Update and align template descriptions. ([36000](https://github.com/WordPress/gutenberg/pull/36000))
190
+ - [REST] Restore the missing double slash in the ID received by /templates. ([36881](https://github.com/WordPress/gutenberg/pull/36881))
191
+
192
+ #### Accessibility
193
+ - Use table layout in templates list screen. ([36707](https://github.com/WordPress/gutenberg/pull/36707))
194
+
195
+
196
+ ### Documentation
197
+
198
+ - Add brief information about blockGap to the theme.json how-to guide. ([36558](https://github.com/WordPress/gutenberg/pull/36558))
199
+ - Add placeholder in URLInput documentation. ([36799](https://github.com/WordPress/gutenberg/pull/36799))
200
+ - Block Supports: Update block supports documentation after typography reshaping. ([36894](https://github.com/WordPress/gutenberg/pull/36894))
201
+ - Docs: Alphabetize the How to Guides section. ([35904](https://github.com/WordPress/gutenberg/pull/35904))
202
+ - Docs: Fix broken link to @wordpress/stylelint-config. ([36936](https://github.com/WordPress/gutenberg/pull/36936))
203
+ - Docs: Improvements on `Create a Block Tutorial` from `Block Editor handbook`. ([36553](https://github.com/WordPress/gutenberg/pull/36553))
204
+ - Docs: Update history.md with description of the page. ([36888](https://github.com/WordPress/gutenberg/pull/36888))
205
+ - Update Getting Started with info to stay informed. ([36498](https://github.com/WordPress/gutenberg/pull/36498))
206
+ - Update Pattern block category and add documentation. ([36144](https://github.com/WordPress/gutenberg/pull/36144))
207
+ - Various inline docblock corrections. ([36793](https://github.com/WordPress/gutenberg/pull/36793))
208
+
209
+ #### Components
210
+ - ToolsPanel: Update panel readme and stories. ([36557](https://github.com/WordPress/gutenberg/pull/36557))
211
+
212
+
213
+ ### Code Quality
214
+
215
+ - Blocks: Refactor generator-based actions to thunks. ([36468](https://github.com/WordPress/gutenberg/pull/36468))
216
+ - Remove useless bubblesVirtually prop from BlockInspector. ([37024](https://github.com/WordPress/gutenberg/pull/37024))
217
+
218
+ #### Global Styles
219
+ - Move Global Styles code to `lib/compat/wordpress-5.9` folder. ([36978](https://github.com/WordPress/gutenberg/pull/36978))
220
+ - Rename `gutenberg_` to `wp_` for some functions that land in WordPress 5.9. ([36913](https://github.com/WordPress/gutenberg/pull/36913))
221
+ - Update global styles public API. ([36610](https://github.com/WordPress/gutenberg/pull/36610))
222
+ - Update the `WP_Theme_JSON_Gutenberg` class to be like the core one. ([36973](https://github.com/WordPress/gutenberg/pull/36973))
223
+ - Update the `WP_Theme_JSON_Resolver_Gutenberg` class to be like the core one. ([36974](https://github.com/WordPress/gutenberg/pull/36974))
224
+ - `theme.json`: Sort keys alphabetically. ([36968](https://github.com/WordPress/gutenberg/pull/36968))
225
+
226
+ #### Block Library
227
+ - Navigation: Remove outdated separate "Home" link styles. ([36608](https://github.com/WordPress/gutenberg/pull/36608))
228
+ - Post Featured Image: Remove withNotices HOC. ([36596](https://github.com/WordPress/gutenberg/pull/36596))
229
+ - [Comment Author Avatar]: Remove extraneous color link support flag. ([36956](https://github.com/WordPress/gutenberg/pull/36956))
230
+
231
+ #### Post Editor
232
+ - [Edit Post]: Remove EditPostSettings context provider. ([36949](https://github.com/WordPress/gutenberg/pull/36949))
233
+
234
+
235
+ ### Tools
236
+
237
+ - Add ajlende to JSON Schema codeowners. ([36580](https://github.com/WordPress/gutenberg/pull/36580))
238
+ - Report dependencies externalized with Dependency Extraction Plugin. ([35106](https://github.com/WordPress/gutenberg/pull/35106))
239
+ - Update CODEOWNERS for @mkaz and documentation cleanup. ([36581](https://github.com/WordPress/gutenberg/pull/36581))
240
+ - Update mkaz codeowner on schemas. ([36686](https://github.com/WordPress/gutenberg/pull/36686))
241
+
242
+ #### Testing
243
+ - Reorganize end-to-end tests folders and files. ([36734](https://github.com/WordPress/gutenberg/pull/36734))
244
+ - Scripts: Upgrade Puppeteer to v11. ([36040](https://github.com/WordPress/gutenberg/pull/36040))
245
+ - Update template controller unit test now that author support is in WP core. ([36987](https://github.com/WordPress/gutenberg/pull/36987))
246
+ - end-to-end Tests: Fix failing image end-to-end test by waiting for required element. ([36982](https://github.com/WordPress/gutenberg/pull/36982))
247
+
248
+
249
+ ### Security
250
+
251
+ #### Block Library
252
+ - [ Comment Author Avatar Block ] - Escape styles attribute. ([36988](https://github.com/WordPress/gutenberg/pull/36988))
253
+
254
+
255
+ ### Various
256
+
257
+ - Add button text when no colors found. ([36684](https://github.com/WordPress/gutenberg/pull/36684))
258
+ - Add origin and author to template rest api. ([36896](https://github.com/WordPress/gutenberg/pull/36896))
259
+ - Change .nvmrc and documentation for Node.js version (LTS to 14.18.1). ([36744](https://github.com/WordPress/gutenberg/pull/36744))
260
+ - Clarify i18n context for PostTemplateActions's "New" label. ([36679](https://github.com/WordPress/gutenberg/pull/36679))
261
+ - Mobile - Preformatted block - Fix showing the default background color. ([36883](https://github.com/WordPress/gutenberg/pull/36883))
262
+ - Mobile - RichText - Fixes an issue where the font size value won't update. ([36621](https://github.com/WordPress/gutenberg/pull/36621))
263
+ - Revert erroneous native editor package version bumps. ([36633](https://github.com/WordPress/gutenberg/pull/36633))
264
+ - Schemas: Allow custom blocks in theme.json styles. ([36411](https://github.com/WordPress/gutenberg/pull/36411))
265
+ - Site Editor: Sync export API. ([36908](https://github.com/WordPress/gutenberg/pull/36908))
266
+ - Update: Migrate global styles user database data on the rest endpoint. ([36747](https://github.com/WordPress/gutenberg/pull/36747))
267
+
268
+ #### Site Editor
269
+ - Add 'Clear customizations' button to template list page. ([36802](https://github.com/WordPress/gutenberg/pull/36802))
270
+ - Make Reusable blocks available in the Site Editor. ([36511](https://github.com/WordPress/gutenberg/pull/36511))
271
+ - Remove color, spacing, and layout options for Template Part block. ([36571](https://github.com/WordPress/gutenberg/pull/36571))
272
+ - Set the <title> on the list page to be same as the CPT name. ([36805](https://github.com/WordPress/gutenberg/pull/36805))
273
+ - Template list add rename action. ([36879](https://github.com/WordPress/gutenberg/pull/36879))
274
+ - Update delete template button. ([36815](https://github.com/WordPress/gutenberg/pull/36815))
275
+ - Update some small style regressions in the template list. ([36822](https://github.com/WordPress/gutenberg/pull/36822))
276
+
277
+ #### Block Library
278
+ - Block Library: Add the Comments Pagination block. ([36872](https://github.com/WordPress/gutenberg/pull/36872))
279
+ - Gallery block: Turn on auto-migration of v1 Gallery blocks to v2 format when edited. ([36191](https://github.com/WordPress/gutenberg/pull/36191))
280
+ - Remove reference to gutenberg_, swap with wp_. ([36652](https://github.com/WordPress/gutenberg/pull/36652))
281
+ - Update featured image placeholder graphic. ([36712](https://github.com/WordPress/gutenberg/pull/36712))
282
+ - [Template Part]:Remove support for conversion to Reusable block. ([36918](https://github.com/WordPress/gutenberg/pull/36918))
283
+
284
+ #### Components
285
+ - Add experimental `ConfirmDialog`. ([34153](https://github.com/WordPress/gutenberg/pull/34153))
286
+ - Offset the parent iframe when computing Popover position. ([36876](https://github.com/WordPress/gutenberg/pull/36876))
287
+ - ToolsPanel: Prevent tools panel menu increasing empty panel height. ([36895](https://github.com/WordPress/gutenberg/pull/36895))
288
+ - Update destructive tertiary button styles, and template list. ([36915](https://github.com/WordPress/gutenberg/pull/36915))
289
+
290
+ #### Themes
291
+ - Move the theme editor under tools for FSE themes. ([36723](https://github.com/WordPress/gutenberg/pull/36723))
292
+ - Update the block theme folders to templates and parts. ([36647](https://github.com/WordPress/gutenberg/pull/36647))
293
+
294
+ #### Block Editor
295
+ - Make appender fixed position to avoid jumps in the UI. ([36605](https://github.com/WordPress/gutenberg/pull/36605))
296
+ - [Inserter]: Adjust order of theme blocks and reorder inserter items. ([36719](https://github.com/WordPress/gutenberg/pull/36719))
297
+
298
+ #### Block Validation/Deprecation
299
+ - Add plugin meta data to Nav Area block deprecation notice. ([36777](https://github.com/WordPress/gutenberg/pull/36777))
300
+
301
+ #### Design Tools
302
+ - Post Featured Image: Move width and height controls into the Dimensions panel via SlotFill. ([36540](https://github.com/WordPress/gutenberg/pull/36540))
303
+
304
+ #### Template Editor
305
+ - Update resize handle styling in template part focus mode. ([36410](https://github.com/WordPress/gutenberg/pull/36410))
306
+
307
+ #### Data Layer
308
+ - Data: Remove usage of deprecated register methods. ([36344](https://github.com/WordPress/gutenberg/pull/36344))
309
+
310
+ #### Accessibility
311
+ - Block Editor List View: Use anchor elements instead of buttons. ([35655](https://github.com/WordPress/gutenberg/pull/35655))
312
+
313
+
314
+
315
+
316
+
317
+ = 12.0.1 =
318
+
319
+ ### Enhancements
320
+
321
+ #### Global Styles
322
  - Add caching to `WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()`. ([36584](https://github.com/WordPress/gutenberg/pull/36584))
323
 
324
 
gutenberg.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.7
7
  * Requires PHP: 5.6
8
- * Version: 12.0.1
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
@@ -13,8 +13,8 @@
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
- define( 'GUTENBERG_VERSION', '12.0.1' );
17
- define( 'GUTENBERG_GIT_COMMIT', '5469411715871c2d2f33b2501c571a5cadafee93' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.7
7
  * Requires PHP: 5.6
8
+ * Version: 12.0.2
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
+ define( 'GUTENBERG_VERSION', '12.0.2' );
17
+ define( 'GUTENBERG_GIT_COMMIT', '1695ed17acc66b746576bab1e7261b9e93b9d2c2' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.8
4
- Stable tag: 12.0.0
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
@@ -56,4 +56,4 @@ The four phases of the project are Editing, Customization, Collaboration, and Mu
56
 
57
  == Changelog ==
58
 
59
- To read the changelog for Gutenberg 12.0.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v12.0.1">release page</a>.
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 5.8
4
+ Stable tag: 12.0.1
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
56
 
57
  == Changelog ==
58
 
59
+ To read the changelog for Gutenberg 12.0.2, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v12.0.2">release page</a>.