WordPress/wp-includes/js/dist/block-editor.min.js
youknowriad a41c798835 Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes.
In addition to all the packages being updated to the latest versions, 
this commit also includes some mandatory changes to avoid editor breakage:

 - Update React to to 18.2.0.
 - Add the right stylesheets to support iframed block editors.

Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.

Built from https://develop.svn.wordpress.org/trunk@55246


git-svn-id: http://core.svn.wordpress.org/trunk@54779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 07:04:52 +00:00

41 lines
647 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
!function(){var e={6411:function(e,t){var n,o,r;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:p}),a()}function a(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var f=d&&d.newPos+1<a,h=m&&0<=g&&g<c;if(f||h){if(!f||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var f=g();if(f)return f}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=o.offset(e),g=o.outerHeight(e),f=o.outerWidth(e),h=void 0,v=void 0,b=void 0,_=void 0,k=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0;p?(E=t,w=o.height(E),S=o.width(E),C={left:o.scrollLeft(E),top:o.scrollTop(E)},k={left:m.left-C.left-c,top:m.top-C.top-a},y={left:m.left+f-(C.left+S)+d,top:m.top+g-(C.top+w)+u},_=C):(h=o.offset(t),v=t.clientHeight,b=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},k={left:m.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},y={left:m.left+f-(h.left+b+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+g-(h.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),k.top<0||y.top>0?!0===i?o.scrollTop(t,_.top+k.top):!1===i?o.scrollTop(t,_.top+y.top):k.top<0?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top)),r&&(k.left<0||y.left>0?!0===s?o.scrollLeft(t,_.left+k.left):!1===s?o.scrollLeft(t,_.left+y.left):k.left<0?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/;var c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s=void 0;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function f(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(f(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function k(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&k(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);h["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){if(void 0===o)return t&&_(t,e,-1);if(t){c(t);return d(t)&&(o+=g(t,["padding","border"],n)),k(t,e,o)}}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===k(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:f,each:u,css:k,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(f(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(f(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},h)},5619:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,l;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,l[r]))return!1;for(r=o;0!=r--;){var i=l[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML="&nbsp;","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7970:function(e,t,n){e.exports=n(195)},3110:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},3812:function(e){var t,n,o,r,l,i,s,a,c,u,d,p,m,g,f,h=!1;function v(){if(!h){h=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),g=/FBAN\/\w+;/i.exec(e),f=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(r=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(b){if(b[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!k||parseFloat(k[1].replace("_","."))}else s=!1;a=!!b[2],c=!!b[3]}else s=a=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||i>t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||o},webkit:function(){return v()||r},safari:function(){return b.webkit()},chrome:function(){return v()||l},windows:function(){return v()||a},osx:function(){return v()||s},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||f},nativeApp:function(){return v()||g},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},7939:function(e,t,n){"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,l=n in document;if(!l){var i=document.createElement("div");i.setAttribute(n,"return;"),l="function"==typeof i[n]}return!l&&o&&"wheel"===e&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function l(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(o=e.deltaX),(o||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),o&&!t&&(t=o<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:t,spinY:n,pixelX:o,pixelY:r}}l.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=l},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:function(e,t,n){e.exports=n(5372)()},9567:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","ß":"ss","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z","й":"и","Й":"И","ё":"е","Ё":"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function l(e){return t[e]}var i=function(e){return e.replace(o,l)};e.exports=i,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=i},3124:function(e){"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)}var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},l=Object.prototype.hasOwnProperty||function(e,t){return t in e};function i(e){if("object"==typeof e&&null!==e){var l;if(n(e))l=[];else if("[object Date]"===t(e))l=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===t(e)}(e))l=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))l={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))l=Object(e);else if(Object.create&&Object.getPrototypeOf)l=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)l={};else{var i=e.constructor&&e.constructor.prototype||e.__proto__||{},s=function(){};s.prototype=i,l=new s}return o(r(e),(function(t){l[t]=e[t]})),l}return e}function s(e,t,s){var a=[],c=[],u=!0;return function e(d){var p=s?i(d):d,m={},g=!0,f={node:p,node_:d,path:[].concat(a),parent:c[c.length-1],parents:c,key:a[a.length-1],isRoot:0===a.length,level:a.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(g=!1)},delete:function(e){delete f.parent.node[f.key],e&&(g=!1)},remove:function(e){n(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return f;function h(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=r(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<c.length;e++)if(c[e].node_===d){f.circular=c[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}h();var v=t.call(f,f.node);return void 0!==v&&f.update&&f.update(v),m.before&&m.before.call(f,f.node),g?("object"!=typeof f.node||null===f.node||f.circular||(c.push(f),h(),o(f.keys,(function(t,n){a.push(t),m.pre&&m.pre.call(f,f.node[t],t);var o=e(f.node[t]);s&&l.call(f.node,t)&&(f.node[t]=o.node),o.isLast=n===f.keys.length-1,o.isFirst=0===n,m.post&&m.post.call(f,o),a.pop()})),c.pop()),m.after&&m.after.call(f,f.node),f):f}(e).node}function a(e){this.value=e}function c(e){return new a(e)}a.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return;t=t[o]}return t},a.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return!1;t=t[o]}return!0},a.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];l.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},a.prototype.map=function(e){return s(this.value,e,!0)},a.prototype.forEach=function(e){return this.value=s(this.value,e,!1),this.value},a.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},a.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},a.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},a.prototype.clone=function(){var e=[],t=[];return function n(l){for(var s=0;s<e.length;s++)if(e[s]===l)return t[s];if("object"==typeof l&&null!==l){var a=i(l);return e.push(l),t.push(a),o(r(l),(function(e){a[e]=n(l[e])})),e.pop(),t.pop(),a}return l}(this.value)},o(r(a.prototype),(function(e){c[e]=function(t){var n=[].slice.call(arguments,1),o=new a(t);return o[e].apply(o,n)}})),e.exports=c},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return sC},AlignmentToolbar:function(){return aC},Autocomplete:function(){return vC},BlockAlignmentControl:function(){return V_},BlockAlignmentToolbar:function(){return H_},BlockBreadcrumb:function(){return EC},BlockColorsStyleSelector:function(){return BC},BlockContextProvider:function(){return Fi},BlockControls:function(){return x_},BlockEdit:function(){return Ui},BlockEditorKeyboardShortcuts:function(){return tI},BlockEditorProvider:function(){return Bi},BlockFormatControls:function(){return I_},BlockIcon:function(){return Ai},BlockInspector:function(){return qB},BlockList:function(){return Sf},BlockMover:function(){return Wp},BlockNavigationDropdown:function(){return qC},BlockPreview:function(){return yh},BlockSelectionClearer:function(){return Jg},BlockSettingsMenu:function(){return _g},BlockSettingsMenuControls:function(){return gg},BlockStyles:function(){return XC},BlockTitle:function(){return Rp},BlockToolbar:function(){return xg},BlockTools:function(){return QB},BlockVerticalAlignmentControl:function(){return Dd},BlockVerticalAlignmentToolbar:function(){return zd},ButtonBlockAppender:function(){return _p},ButtonBlockerAppender:function(){return bp},ColorPalette:function(){return fS},ColorPaletteControl:function(){return hS},ContrastChecker:function(){return Uk},CopyHandler:function(){return Am},DefaultBlockAppender:function(){return hp},FontSizePicker:function(){return Ny},HeightControl:function(){return Ol},InnerBlocks:function(){return _f},Inserter:function(){return eb},InspectorAdvancedControls:function(){return Sl},InspectorControls:function(){return wl},JustifyContentControl:function(){return Hd},JustifyToolbar:function(){return Gd},LineHeightControl:function(){return my},MediaPlaceholder:function(){return kw},MediaReplaceFlow:function(){return mw},MediaUpload:function(){return Dv},MediaUploadCheck:function(){return Ov},MultiSelectScrollIntoView:function(){return nI},NavigableToolbar:function(){return Zp},ObserveTyping:function(){return iI},PanelColorSettings:function(){return yw},PlainText:function(){return tB},RichText:function(){return Xw},RichTextShortcut:function(){return rB},RichTextToolbarButton:function(){return lB},SETTINGS_DEFAULTS:function(){return E},SkipToSelectedBlock:function(){return CB},ToolSelector:function(){return aB},Typewriter:function(){return uI},URLInput:function(){return hb},URLInputButton:function(){return pB},URLPopover:function(){return vw},Warning:function(){return ji},WritingFlow:function(){return Ff},__experimentalBlockAlignmentMatrixControl:function(){return yC},__experimentalBlockFullHeightAligmentControl:function(){return _C},__experimentalBlockPatternSetup:function(){return uS},__experimentalBlockPatternsList:function(){return Vh},__experimentalBlockVariationPicker:function(){return eS},__experimentalBlockVariationTransforms:function(){return mS},__experimentalBorderRadiusControl:function(){return ck},__experimentalColorGradientControl:function(){return zk},__experimentalColorGradientSettingsDropdown:function(){return Gk},__experimentalDateFormatPicker:function(){return _S},__experimentalDuotoneControl:function(){return _E},__experimentalFontAppearanceControl:function(){return uy},__experimentalFontFamilyControl:function(){return Cy},__experimentalGetBorderClassesAndStyles:function(){return zE},__experimentalGetColorClassesAndStyles:function(){return VE},__experimentalGetElementClassName:function(){return bI},__experimentalGetGapCSSValue:function(){return ii},__experimentalGetGradientClass:function(){return Ik},__experimentalGetGradientObjectByGradientValue:function(){return Tk},__experimentalGetMatchingVariation:function(){return kI},__experimentalGetSpacingClassesAndStyles:function(){return UE},__experimentalImageEditor:function(){return rw},__experimentalImageSizeControl:function(){return sw},__experimentalImageURLInputUI:function(){return kB},__experimentalInspectorPopoverHeader:function(){return fI},__experimentalLayoutStyle:function(){return cp},__experimentalLetterSpacingControl:function(){return eE},__experimentalLibrary:function(){return JB},__experimentalLinkControl:function(){return Xb},__experimentalLinkControlSearchInput:function(){return Vb},__experimentalLinkControlSearchItem:function(){return Bb},__experimentalLinkControlSearchResults:function(){return Pb},__experimentalListView:function(){return WC},__experimentalPanelColorGradientSettings:function(){return SS},__experimentalPreviewOptions:function(){return yB},__experimentalPublishDateTimePicker:function(){return hI},__experimentalRecursionProvider:function(){return pI},__experimentalResponsiveBlockControl:function(){return oB},__experimentalSpacingSizesControl:function(){return rl},__experimentalTextDecorationControl:function(){return Gy},__experimentalTextTransformControl:function(){return Zy},__experimentalUnitControl:function(){return cB},__experimentalUseBlockOverlayActive:function(){return vd},__experimentalUseBlockPreview:function(){return Eh},__experimentalUseBorderProps:function(){return FE},__experimentalUseColorProps:function(){return GE},__experimentalUseCustomSides:function(){return ni},__experimentalUseGradient:function(){return Nk},__experimentalUseHasRecursion:function(){return mI},__experimentalUseMultipleOriginColorsAndGradients:function(){return gk},__experimentalUseResizeCanvas:function(){return EB},__experimentaluseLayoutClasses:function(){return IE},__experimentaluseLayoutStyles:function(){return xE},__unstableBlockNameContext:function(){return Ig},__unstableBlockSettingsMenuFirstItem:function(){return eg},__unstableBlockToolbarLastItem:function(){return Tm},__unstableDuotoneFilter:function(){return Sr},__unstableDuotoneStylesheet:function(){return Er},__unstableDuotoneUnsetStylesheet:function(){return Cr},__unstableEditorStyles:function(){return hh},__unstableGetValuesFromColors:function(){return yr},__unstableIframe:function(){return Gf},__unstableInserterMenuExtension:function(){return Gv},__unstablePresetDuotoneFilter:function(){return wr},__unstableRichTextInputEvent:function(){return iB},__unstableUseBlockSelectionClearer:function(){return Xg},__unstableUseClipboardHandler:function(){return Rm},__unstableUseMouseMoveTypingReset:function(){return rI},__unstableUseTypewriter:function(){return cI},__unstableUseTypingObserver:function(){return lI},createCustomColorsHOC:function(){return ZE},experiments:function(){return k_},getColorClassName:function(){return mk},getColorObjectByAttributeValues:function(){return dk},getColorObjectByColorValue:function(){return pk},getComputedFluidTypographyValue:function(){return Mo},getFontSize:function(){return xy},getFontSizeClass:function(){return My},getFontSizeObjectByValue:function(){return Ty},getGradientSlugByValue:function(){return Mk},getGradientValueBySlug:function(){return xk},getPxFromCssUnit:function(){return MI},getTypographyClassesAndStyles:function(){return $E},store:function(){return E_},storeConfig:function(){return y_},transformStyles:function(){return mh},useBlockDisplayInformation:function(){return Ii},useBlockEditContext:function(){return $r},useBlockProps:function(){return bd},useCachedTruthy:function(){return jE},useInnerBlocksProps:function(){return bf},useSetting:function(){return qr},withColorContext:function(){return gS},withColors:function(){return QE},withFontSizes:function(){return eC}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Qt},__experimentalGetAllowedBlocks:function(){return Tt},__experimentalGetAllowedPatterns:function(){return Lt},__experimentalGetBlockListSettingsForBlocks:function(){return Vt},__experimentalGetDirectInsertBlock:function(){return Mt},__experimentalGetGlobalBlocksByName:function(){return ae},__experimentalGetLastBlockAttributeChanges:function(){return Ut},__experimentalGetParsedPattern:function(){return Nt},__experimentalGetPatternTransformItems:function(){return Ot},__experimentalGetPatternsByBlockTypes:function(){return At},__experimentalGetReusableBlockTitle:function(){return Ht},__unstableGetBlockWithoutInnerBlocks:function(){return te},__unstableGetClientIdWithClientIdsTree:function(){return oe},__unstableGetClientIdsTree:function(){return re},__unstableGetContentLockingParent:function(){return tn},__unstableGetEditorMode:function(){return Wt},__unstableGetSelectedBlocksWithPartialSelection:function(){return Ue},__unstableGetTemporarilyEditingAsBlocks:function(){return nn},__unstableGetVisibleBlocks:function(){return en},__unstableHasActiveBlockOverlayActive:function(){return on},__unstableIsFullySelected:function(){return Fe},__unstableIsLastBlockChangeIgnored:function(){return Gt},__unstableIsSelectionCollapsed:function(){return Ve},__unstableIsSelectionMergeable:function(){return Ge},__unstableIsWithinBlockOverlay:function(){return rn},__unstableSelectionHasUnmergeableBlock:function(){return He},areInnerBlocksControlled:function(){return Zt},canEditBlock:function(){return bt},canInsertBlockType:function(){return pt},canInsertBlocks:function(){return mt},canLockBlockType:function(){return _t},canMoveBlock:function(){return ht},canMoveBlocks:function(){return vt},canRemoveBlock:function(){return gt},canRemoveBlocks:function(){return ft},didAutomaticChange:function(){return qt},getAdjacentBlockClientId:function(){return we},getAllowedBlocks:function(){return xt},getBlock:function(){return ee},getBlockAttributes:function(){return J},getBlockCount:function(){return de},getBlockHierarchyRootClientId:function(){return Ce},getBlockIndex:function(){return je},getBlockInsertionPoint:function(){return lt},getBlockListSettings:function(){return Dt},getBlockMode:function(){return Xe},getBlockName:function(){return Q},getBlockNamesByClientId:function(){return ue},getBlockOrder:function(){return $e},getBlockParents:function(){return ye},getBlockParentsByBlockName:function(){return Ee},getBlockRootClientId:function(){return ke},getBlockSelectionEnd:function(){return fe},getBlockSelectionStart:function(){return ge},getBlockTransformItems:function(){return Bt},getBlocks:function(){return ne},getBlocksByClientId:function(){return ce},getClientIdsOfDescendants:function(){return le},getClientIdsWithDescendants:function(){return ie},getDraggedBlockClientIds:function(){return tt},getFirstMultiSelectedBlockClientId:function(){return Pe},getGlobalBlockCount:function(){return se},getInserterItems:function(){return wt},getLastMultiSelectedBlockClientId:function(){return Le},getLowestCommonAncestorWithSelectedBlock:function(){return Se},getMultiSelectedBlockClientIds:function(){return Me},getMultiSelectedBlocks:function(){return Ne},getMultiSelectedBlocksEndClientId:function(){return ze},getMultiSelectedBlocksStartClientId:function(){return De},getNextBlockClientId:function(){return Ie},getPatternsByBlockTypes:function(){return Rt},getPreviousBlockClientId:function(){return Be},getSelectedBlock:function(){return _e},getSelectedBlockClientId:function(){return be},getSelectedBlockClientIds:function(){return Te},getSelectedBlockCount:function(){return he},getSelectedBlocksInitialCaretPosition:function(){return xe},getSelectionEnd:function(){return me},getSelectionStart:function(){return pe},getSettings:function(){return zt},getTemplate:function(){return at},getTemplateLock:function(){return ct},hasBlockMovingClientId:function(){return Kt},hasInserterItems:function(){return It},hasMultiSelection:function(){return Ye},hasSelectedBlock:function(){return ve},hasSelectedInnerBlock:function(){return Ke},isAncestorBeingDragged:function(){return ot},isAncestorMultiSelected:function(){return Oe},isBlockBeingDragged:function(){return nt},isBlockHighlighted:function(){return Yt},isBlockInsertionPointVisible:function(){return it},isBlockMultiSelected:function(){return Ae},isBlockSelected:function(){return We},isBlockValid:function(){return X},isBlockVisible:function(){return Jt},isBlockWithinSelection:function(){return qe},isCaretWithinFormattedText:function(){return rt},isDraggingBlocks:function(){return et},isFirstMultiSelectedBlock:function(){return Re},isLastBlockChangePersistent:function(){return Ft},isMultiSelecting:function(){return Ze},isNavigationMode:function(){return jt},isSelectionEnabled:function(){return Qe},isTyping:function(){return Je},isValidTemplate:function(){return st},wasBlockJustInserted:function(){return Xt}});var t={};n.r(t),n.d(t,{__experimentalUpdateSettings:function(){return sn},hideBlockInterface:function(){return an},showBlockInterface:function(){return cn}});var r={};n.r(r),n.d(r,{getLastInsertedBlocksClientIds:function(){return dn},isBlockInterfaceHidden:function(){return un}});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:function(){return $n},__unstableExpandSelection:function(){return Wn},__unstableMarkAutomaticChange:function(){return po},__unstableMarkLastChangeAsPersistent:function(){return co},__unstableMarkNextChangeAsNotPersistent:function(){return uo},__unstableSaveReusableBlock:function(){return ao},__unstableSetEditorMode:function(){return go},__unstableSetTemporarilyEditingAsBlocks:function(){return Co},__unstableSplitSelection:function(){return jn},clearSelectedBlock:function(){return xn},duplicateBlocks:function(){return ho},enterFormattedText:function(){return no},exitFormattedText:function(){return oo},flashBlock:function(){return ko},hideInsertionPoint:function(){return Hn},insertAfterBlock:function(){return bo},insertBeforeBlock:function(){return vo},insertBlock:function(){return zn},insertBlocks:function(){return Fn},insertDefaultBlock:function(){return lo},mergeBlocks:function(){return Kn},moveBlockToPosition:function(){return Dn},moveBlocksDown:function(){return Rn},moveBlocksToPosition:function(){return On},moveBlocksUp:function(){return An},multiSelect:function(){return In},receiveBlocks:function(){return _n},removeBlock:function(){return Yn},removeBlocks:function(){return qn},replaceBlock:function(){return Pn},replaceBlocks:function(){return Nn},replaceInnerBlocks:function(){return Zn},resetBlocks:function(){return hn},resetSelection:function(){return bn},selectBlock:function(){return En},selectNextBlock:function(){return Sn},selectPreviousBlock:function(){return Cn},selectionChange:function(){return ro},setBlockMovingClientId:function(){return fo},setBlockVisibility:function(){return Eo},setHasControlledInnerBlocks:function(){return yo},setNavigationMode:function(){return mo},setTemplateValidity:function(){return Gn},showInsertionPoint:function(){return Vn},startDraggingBlocks:function(){return eo},startMultiSelect:function(){return wn},startTyping:function(){return Xn},stopDraggingBlocks:function(){return to},stopMultiSelect:function(){return Bn},stopTyping:function(){return Jn},synchronizeTemplate:function(){return Un},toggleBlockHighlight:function(){return _o},toggleBlockMode:function(){return Qn},toggleSelection:function(){return Tn},updateBlock:function(){return yn},updateBlockAttributes:function(){return kn},updateBlockListSettings:function(){return io},updateSettings:function(){return so},validateBlocksToTemplate:function(){return vn}});var i={};n.r(i),n.d(i,{GlobalStylesContext:function(){return Vo},useGlobalSetting:function(){return Uo},useGlobalStyle:function(){return $o},useGlobalStylesOutput:function(){return yi},useGlobalStylesReset:function(){return Go}});var s=window.wp.blocks,a=window.wp.hooks;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(this,arguments)}(0,a.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,s.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var u=window.wp.element,d=n(4403),p=n.n(d),m=window.wp.compose,g=window.wp.data,f=window.lodash,h=window.wp.components;var v={default:(0,h.createSlotFill)("BlockControls"),block:(0,h.createSlotFill)("BlockControlsBlock"),inline:(0,h.createSlotFill)("BlockFormatControls"),other:(0,h.createSlotFill)("BlockControlsOther"),parent:(0,h.createSlotFill)("BlockControlsParent")},b=n(5619),_=n.n(b),k=window.wp.i18n;const y={insertUsage:{}},E={alignWide:!1,supportsLayout:!0,colors:[{name:(0,k.__)("Black"),slug:"black",color:"#000000"},{name:(0,k.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,k.__)("White"),slug:"white",color:"#ffffff"},{name:(0,k.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,k.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,k.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,k.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,k.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,k.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,k.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,k.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,k.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,k._x)("Small","font size name"),size:13,slug:"small"},{name:(0,k._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,k._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,k._x)("Large","font size name"),size:36,slug:"large"},{name:(0,k._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,k.__)("Thumbnail")},{slug:"medium",name:(0,k.__)("Medium")},{slug:"large",name:(0,k.__)("Large")},{slug:"full",name:(0,k.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,generateAnchors:!1,gradients:[{name:(0,k.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,k.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,k.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,k.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,k.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,k.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,k.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,k.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,k.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,k.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,k.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,k.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function C(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function S(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),C(r,e.slice(t,t+o),n)}const w=e=>e;function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),B(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((t=>{let{innerBlocks:r,...l}=t;n.push([l.clientId,e]),null!=r&&r.length&&o.push([l.clientId,r])}))}return n}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w;const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function T(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}function M(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return x(e,(e=>e.attributes))}function P(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&_()(e.clientIds,t.clientIds)&&function(e,t){return _()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function L(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function R(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const A=(0,m.pipe)(g.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),L(o,n.blocks),R(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),R(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),R(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=T(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),L(o,n.blocks),R(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));R(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),R(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),R(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),R(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),R(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order.get(o[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[r])));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(M(n.blocks)),attributes:new Map(N(n.blocks)),order:B(n.blocks),parents:new Map(I(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),L(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!P(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),M(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let s=!1;const a=e.get(l),c={};i.forEach((e=>{let[t,n]=e;a[t]!==n&&(s=!0,c[t]=n)})),o=o||s,s&&r.set(l,{...a,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=B(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=B(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,C(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o,r;const{fromRootClientId:n="",toRootClientId:l="",clientIds:i}=t,{index:s=e.get(l).length}=t;if(n===l){const t=e.get(l).indexOf(i[0]),n=new Map(e);return n.set(l,S(e.get(l),t,s,i.length)),n}const a=new Map(e);return a.set(n,null!==(o=null===(r=e.get(n))||void 0===r?void 0:r.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),a.set(l,C(e.get(l),i,s)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),s=new Map(e);return s.set(o,S(l,i,i-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const s=i.indexOf(r),a=new Map(e);return a.set(o,S(i,s,s+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=B(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks,t.rootClientId||"").forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,o]=e;n.set(t,o)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var D=(0,g.combineReducers)({blocks:A,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:O(r.selectionStart,l),selectionEnd:O(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return _()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return _()(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n,l=(0,g.select)(s.store).getActiveBlockVariation(r,o);let i=null!=l&&l.name?`${r}/${l.name}`:r;const a={name:i};return"core/block"===r&&(a.ref=o.ref,i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":case"UPDATE_BLOCK_LIST_SETTINGS":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const o=n.blocks.map((e=>e.clientId));return{clientIds:o,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}}),z={};function F(e){return[e]}function V(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function H(e,t){var n,o=t||F;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(z)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(z,l)),s.get(z)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!V(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(V(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}var G=window.wp.primitives;var U=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),$=window.wp.richText,j=window.wp.deprecated,W=n.n(j);function K(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const q=(e,t,n)=>(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const s=t.findIndex((e=>e===o)),a=t.findIndex((e=>e===r));return s>a?1:a>s?-1:0};function Y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(q(t,e,n))}const Z=[];function Q(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`core/social-link-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function J(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ee(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const te=H(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:J(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function ne(e,t){var n;const o=t&&Zt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(o))||void 0===n?void 0:n.innerBlocks)||Z}const oe=H(((e,t)=>({clientId:t,innerBlocks:re(e,t)})),(e=>[e.blocks.order])),re=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return $e(e,t).map((t=>oe(e,t)))}),(e=>[e.blocks.order])),le=H(((e,t)=>{const n=[];for(const o of t)for(const t of $e(e,o))n.push(t,...le(e,[t]));return n}),(e=>[e.blocks.order])),ie=H((e=>{const t=[];for(const n of $e(e))t.push(n,...le(e,[n]));return t}),(e=>[e.blocks.order])),se=H(((e,t)=>{const n=ie(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ae=H(((e,t)=>{if(!t)return Z;const n=ie(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:Z}),(e=>[e.blocks.order,e.blocks.byClientId])),ce=H(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ee(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ue=H(((e,t)=>ce(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ce(e,t)));function de(e,t){return $e(e,t).length}function pe(e){return e.selection.selectionStart}function me(e){return e.selection.selectionEnd}function ge(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function he(e){const t=Me(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function _e(e){const t=be(e);return t?ee(e,t):null}function ke(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ye=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),Ee=H((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ye(e,t,o);return r.map((t=>({id:t,name:Q(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function Ce(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Se(e,t){const n=be(e),o=[...ye(e,t),t],r=[...ye(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function we(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Le(e)),!t)return null;const o=ke(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function Be(e,t){return we(e,t,-1)}function Ie(e,t){return we(e,t,1)}function xe(e){return e.initialPosition}const Te=H((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Z;if(t.clientId===n.clientId)return[t.clientId];const o=ke(e,t.clientId);if(null===o)return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Z:Te(e)}const Ne=H((e=>{const t=Me(e);return t.length?t.map((t=>ee(e,t))):Z}),(e=>[...Te.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Me(e)[0]||null}function Le(e){const t=Me(e);return t[t.length-1]||null}function Re(e,t){return Pe(e)===t}function Ae(e,t){return-1!==Me(e).indexOf(t)}const Oe=H(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ke(e,n),o=Ae(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Fe(e){const t=pe(e),n=me(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=pe(e),n=me(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function He(e){return Te(e).some((t=>{const n=Q(e,t);return!(0,s.getBlockType)(n).merge}))}function Ge(e,t){const n=pe(e),o=me(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=ke(e,n.clientId);if(r!==ke(e,o.clientId))return!1;const l=$e(e,r);let i,a;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,a=n):(i=n,a=o);const c=t?a.clientId:i.clientId,u=t?i.clientId:a.clientId,d=Q(e,c);if(!(0,s.getBlockType)(d).merge)return!1;const p=ee(e,u);if(p.name===d)return!0;const m=(0,s.switchToBlockType)(p,d);return m&&m.length}const Ue=e=>{const t=pe(e),n=me(e);if(t.clientId===n.clientId)return Z;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Z;const o=ke(e,t.clientId);if(o!==ke(e,n.clientId))return Z;const r=$e(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[a,c]=l>i?[n,t]:[t,n],u=ee(e,a.clientId),d=(0,s.getBlockType)(u.name),p=ee(e,c.clientId),m=(0,s.getBlockType)(p.name),g=u.attributes[a.attributeKey],f=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,$.create)({html:g,...K(h)}),_=(0,$.create)({html:f,...K(v)});return b=(0,$.remove)(b,0,a.offset),_=(0,$.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,$.toHTMLString)({value:b,...K(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,$.toHTMLString)({value:_,...K(v)})}}]};function $e(e,t){return e.blocks.order.get(t||"")||Z}function je(e,t){return $e(e,ke(e,t)).indexOf(t)}function We(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return $e(e,t).some((t=>We(e,t)||Ae(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Me(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ze(e){return e.isMultiSelecting}function Qe(e){return e.isSelectionEnabled}function Xe(e,t){return e.blocksMode[t]||"visual"}function Je(e){return e.isTyping}function et(e){return!!e.draggedBlocks.length}function tt(e){return e.draggedBlocks}function nt(e,t){return e.draggedBlocks.includes(t)}function ot(e,t){if(!et(e))return!1;return ye(e,t).some((t=>nt(e,t)))}function rt(){return W()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=H((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ke(e,l)||void 0,n=je(e,r.clientId)+1):n=$e(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function st(e){return e.template.isValid}function at(e){return e.settings.template}function ct(e,t){var n,o,r;return t?null!==(n=null===(o=Dt(e,t))||void 0===o?void 0:o.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const ut=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},dt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,s.getBlockType)(t),!n)return!1;const{allowedBlockTypes:r}=zt(e),l=ut(r,t,!0);if(!l)return!1;const i=!!ct(e,o);if(i)return!1;const c=Dt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=ut(u,t),p=n.parent,m=Q(e,o),g=ut(p,m);let f=!0;const h=n.ancestor;if(h){f=[o,...ye(e,o)].some((t=>ut(h,Q(e,t))))}const v=f&&(null===d&&null===g||!0===d||!0===g);return v?(0,a.applyFilters)("blockEditor.__unstableCanInsertBlockType",v,n,o,{getBlock:ee.bind(null,e),getBlockParentsByBlockName:Ee.bind(null,e)}):v},pt=H(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>pt(e,Q(e,t),n)))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return!0;const{lock:r}=o,l=!!ct(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>gt(e,t,n)))}function ht(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=J(e,t);if(null===o)return;const{lock:r}=o,l="all"===ct(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function vt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ht(e,t,n)))}function bt(e,t){const n=J(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function _t(e,t){var n;return!!(0,s.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function kt(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const yt=(e,t,n)=>!!(0,s.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=kt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Ct(r,l)}},Ct=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},St=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let r=!1;(0,s.hasBlockSupport)(t.name,"multiple",!0)||(r=ce(e,ie(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:l,count:i=0}=kt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:r,frecency:Ct(l,i)};if("transform"===n)return a;const c=(0,s.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},wt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=St(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,r=t=>{let n=U;if("web"===u.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,r=(0,s.getBlockType)(t+o);r&&(n=r.icon)}}const r=`core/block/${t.id}`,{time:l,count:i=0}=kt(e,r)||{},a=Ct(l,i);return{id:r,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}},l=(0,s.getBlockTypes)().filter((n=>yt(e,n,t))).map(n),i=dt(e,"core/block",t)?$t(e).map(r):[],a=l.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=Et(e,n);t.push(...o.map(r))}return t}),[]),c=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=a.reduce(c,{core:[],noncore:[]}),m=[...d,...p];return[...m,...i]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,s.getBlockTypes)()])),Bt=H((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Array.isArray(t)?t:[t],[l]=r,i=St(e,{buildScope:"transform"}),a=(0,s.getBlockTypes)().filter((t=>yt(e,t,o))).map(i),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,k.__)("Unwrap"),icon:null===(n=c[null==l?void 0:l.name])||void 0===n?void 0:n.icon};const u=(0,s.getPossibleBlockTransformations)(r).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return Y(u,(e=>c[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,s.getBlockTypes)()])),It=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,s.getBlockTypes)().some((n=>yt(e,n,t)));if(n)return!0;const o=dt(e,"core/block",t)&&$t(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,$t(e),(0,s.getBlockTypes)()])),xt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,s.getBlockTypes)().filter((n=>yt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,s.getBlockTypes)()])),Tt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),xt(e,t)}),((e,t)=>[...xt.getDependants(e,t)])),Mt=H((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(ee(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Nt=H(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,s.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Pt=H((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=zt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Nt(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!ut(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return r}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Lt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Pt(e),o=n.filter((n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return pt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Rt=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;const o=Lt(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}));return 0===l.length?Z:l}),((e,t,n)=>[...Lt.getDependants(e,n)])),At=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return W()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Rt(e,t,n)}),((e,t,n)=>[...Lt.getDependants(e,n)])),Ot=H((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return Z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Zt(e,n)})))return Z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Rt(e,o,n)}),((e,t,n)=>[...Rt.getDependants(e,n)]));function Dt(e,t){return e.blockListSettings[t]}function zt(e){return e.settings}function Ft(e){return e.blocks.isPersistentChange}const Vt=H((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Ht=H(((e,t)=>{var n;const o=$t(e).find((e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[$t(e)]));function Gt(e){return e.blocks.isIgnoredChange}function Ut(e){return e.lastBlockAttributesChange}function $t(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:Z}function jt(e){return"navigation"===e.editorMode}function Wt(e){return e.editorMode}function Kt(e){return e.hasBlockMovingClientId}function qt(e){return!!e.automaticChangeStatus}function Yt(e,t){return e.highlightedBlock===t}function Zt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Qt=H(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Q(e,n)))return n;const o=Me(e),r=Ee(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Xt(e,t,n){var o;const{lastBlockInserted:r}=e;return(null===(o=r.clientIds)||void 0===o?void 0:o.includes(t))&&r.source===n}function Jt(e,t){var n,o;return null===(n=null===(o=e.blockVisibility)||void 0===o?void 0:o[t])||void 0===n||n}const en=H((e=>new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])))),(e=>[e.blockVisibility])),tn=H(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function nn(e){return e.temporarilyEditingAsBlocks}function on(e,t){if(!bt(e,t))return!0;const n=Wt(e);if("zoom-out"===n&&t&&!ke(e,t))return!0;const o=(0,s.hasBlockSupport)(Q(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Zt(e,t))&&!We(e,t)&&!Ke(e,t,!0)}function rn(e,t){let n=e.blocks.parents[t];for(;n;){if(on(e,n))return!0;n=e.blocks.parents[n]}return!1}const ln=["inserterMediaCategories"];function sn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===u.Platform.OS){n={};for(const t in e)ln.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function an(){return{type:"HIDE_BLOCK_INTERFACE"}}function cn(){return{type:"SHOW_BLOCK_INTERFACE"}}function un(e){return e.isBlockInterfaceHidden}function dn(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}var pn=window.wp.a11y;const mn="†";function gn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(mn)}))}const fn=e=>Array.isArray(e)?e:[e],hn=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(vn(e))},vn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getTemplate(),l=n.getTemplateLock(),i=!r||"all"!==l||(0,s.doBlocksMatchTemplate)(e,r);if(i!==n.isValidTemplate())return o.setTemplateValidity(i),i};function bn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function _n(e){return W()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function kn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:fn(e),attributes:t,uniqueByBlock:n}}function yn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Cn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Sn=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function wn(){return{type:"START_MULTI_SELECT"}}function Bn(){return{type:"STOP_MULTI_SELECT"}}const In=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,pn.speak)((0,k.sprintf)((0,k._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function xn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Mn(e,t){var n,o;const r=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,s.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!r[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:l={}}=e,i=r[n];return{...e,attributes:{...l,className:`${o||""} is-style-${i}`.trim()}}}))}const Nn=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=fn(e),t=Mn(fn(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Pn(e,t){return Nn(e,t)}const Ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:fn(t),rootClientId:n})},Rn=Ln("MOVE_BLOCKS_DOWN"),An=Ln("MOVE_BLOCKS_UP"),On=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function Dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return On([e],t,n,o)}function zn(e,t,n,o,r){return Fn([e],t,n,o,0,r)}const Fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,W()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Mn(fn(e),s.getSettings());const c=[];for(const t of e){s.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function Vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const Hn=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Un=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),r=t.getTemplate(),l=(0,s.synchronizeBlocksWithTemplate)(o,r);n.resetBlocks(l)},$n=e=>t=>{let{registry:n,select:o,dispatch:r}=t;const l=o.getSelectionStart(),i=o.getSelectionEnd();if(l.clientId===i.clientId)return;if(!l.attributeKey||!i.attributeKey||void 0===l.offset||void 0===i.offset)return!1;const a=o.getBlockRootClientId(l.clientId);if(a!==o.getBlockRootClientId(i.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(l.clientId)>c.indexOf(i.clientId)?(u=i,d=l):(u=l,d=i);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,s.getBlockType)(m.name);if(!g.merge)return;const f=u,h=d,v=o.getBlock(f.clientId),b=(0,s.getBlockType)(v.name),_=o.getBlock(h.clientId),k=(0,s.getBlockType)(_.name),y=v.attributes[f.attributeKey],E=_.attributes[h.attributeKey],C=b.attributes[f.attributeKey],S=k.attributes[h.attributeKey];let w=(0,$.create)({html:y,...K(C)}),B=(0,$.create)({html:E,...K(S)});w=(0,$.remove)(w,f.offset,w.text.length),B=(0,$.insert)(B,mn,0,h.offset);const I=(0,s.cloneBlock)(v,{[f.attributeKey]:(0,$.toHTMLString)({value:w,...K(C)})}),x=(0,s.cloneBlock)(_,{[h.attributeKey]:(0,$.toHTMLString)({value:B,...K(S)})}),T=e?I:x,M=v.name===_.name?[T]:(0,s.switchToBlockType)(T,g.name);if(!M||!M.length)return;let N;if(e){const e=M.pop();N=g.merge(e.attributes,x.attributes)}else{const e=M.shift();N=g.merge(I.attributes,e.attributes)}const P=gn(N),L=N[P],R=(0,$.create)({html:L,...K(g.attributes[P])}),A=R.text.indexOf(mn),O=(0,$.remove)(R,A,A+1),D=(0,$.toHTMLString)({value:O,...K(g.attributes[P])});N[P]=D;const z=o.getSelectedBlockClientIds(),F=[...e?M:[],{...m,attributes:{...m.attributes,...N}},...e?[]:M];n.batch((()=>{r.selectionChange(m.clientId,P,A,A),r.replaceBlocks(z,F,0,o.getSelectedBlocksInitialCaretPosition())}))},jn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();if(o.clientId===r.clientId)return;if(!o.attributeKey||!r.attributeKey||void 0===o.offset||void 0===r.offset)return;const l=t.getBlockRootClientId(o.clientId);if(l!==t.getBlockRootClientId(r.clientId))return;const i=t.getBlockOrder(l);let a,c;i.indexOf(o.clientId)>i.indexOf(r.clientId)?(a=r,c=o):(a=o,c=r);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,s.getBlockType)(p.name),g=t.getBlock(d.clientId),f=(0,s.getBlockType)(g.name),h=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=f.attributes[d.attributeKey];let k=(0,$.create)({html:h,...K(b)}),y=(0,$.create)({html:v,...K(_)});k=(0,$.remove)(k,u.offset,k.text.length),y=(0,$.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,$.toHTMLString)({value:k,...K(b)})}},(0,s.createBlock)((0,s.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,$.toHTMLString)({value:y,...K(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Wn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},Kn=(e,t)=>n=>{let{registry:o,select:r,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[a,c]=i,u=r.getBlock(a),d=(0,s.getBlockType)(u.name);if(!d)return;const p=r.getBlock(c);if(d&&!d.merge){const e=(0,s.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void l.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void l.selectBlock(u.clientId):void o.batch((()=>{l.insertBlocks(t.innerBlocks,void 0,a),l.removeBlock(c),l.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,s.getBlockType)(p.name),{clientId:g,attributeKey:f,offset:h}=r.getSelectionStart(),v=(g===a?d:m).attributes[f],b=(g===a||g===c)&&void 0!==f&&void 0!==h&&!!v;v||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const _=(0,s.cloneBlock)(u),k=(0,s.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[f],n=(0,$.insert)((0,$.create)({html:t,...K(v)}),mn,h,h);e.attributes[f]=(0,$.toHTMLString)({value:n,...K(v)})}const y=u.name===p.name?[k]:(0,s.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=gn(E),t=E[e],n=(0,$.create)({html:t,...K(d.attributes[e])}),o=n.text.indexOf(mn),r=(0,$.remove)(n,o,o+1),i=(0,$.toHTMLString)({value:r,...K(d.attributes[e])});E[e]=i,l.selectionChange(u.clientId,e,o,o)}l.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},qn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=fn(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function Yn(e,t){return qn([e],t)}function Zn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Qn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Xn(){return{type:"START_TYPING"}}function Jn(){return{type:"STOP_TYPING"}}function eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function to(){return{type:"STOP_DRAGGING_BLOCKS"}}function no(){return W()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function oo(){return W()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ro(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const lo=(e,t,n)=>o=>{let{dispatch:r}=o;const l=(0,s.getDefaultBlockName)();if(!l)return;const i=(0,s.createBlock)(l,e);return r.insertBlock(i,n,t)};function io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function so(e){return sn(e,!0)}function ao(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function co(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function uo(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const po=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},mo=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},go=e=>t=>{let{dispatch:n,select:o}=t;if("zoom-out"===e){const e=o.getBlockSelectionStart();e&&n.selectBlock(o.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,pn.speak)((0,k.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,pn.speak)((0,k.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,pn.speak)((0,k.__)("You are currently in zoom-out mode."))},fo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,pn.speak)((0,k.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},ho=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;const l=o.getBlocksByClientId(e);if(l.some((e=>!e)))return;const i=l.map((e=>e.name));if(i.some((e=>!(0,s.hasBlockSupport)(e,"multiple",!0))))return;const a=o.getBlockRootClientId(e[0]),c=fn(e),u=o.getBlockIndex(c[c.length-1]),d=l.map((e=>(0,s.__experimentalCloneSanitizedBlock)(e)));return r.insertBlocks(d,u+1,a,t),d.length>1&&t&&r.multiSelect(d[0].clientId,d[d.length-1].clientId),d.map((e=>e.clientId))}},vo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},bo=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function _o(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const ko=e=>async t=>{let{dispatch:n}=t;n(_o(e,!0)),await new Promise((e=>setTimeout(e,150))),n(_o(e,!1))};function yo(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Eo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Co(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const So="core/block-editor";var wo=window.wp.experiments;const Bo="1600px",Io="768px",xo=1,To=.75;function Mo(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:o,minimumViewPortWidth:r=Io,maximumViewPortWidth:l=Bo,scaleFactor:i=xo,minimumFontSizeFactor:s=To,minimumFontSizeLimit:a}=e;if(a=No(a)?a:"14px",o){const e=No(o);if(null==e||!e.unit)return null;const r=No(a,{coerceTo:e.unit});if(null!=r&&r.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==r?void 0:r.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=Po(e.value*s,3);t=null!=r&&r.value&&n<(null==r?void 0:r.value)?`${r.value}${r.unit}`:`${n}${e.unit}`}}const c=No(t),u=(null==c?void 0:c.unit)||"rem",d=No(n,{coerceTo:u});if(!c||!d)return null;const p=No(t,{coerceTo:"rem"}),m=No(l,{coerceTo:u}),g=No(r,{coerceTo:u});if(!m||!g||!p)return null;const f=Po(g.value/100,3),h=Po(f,3)+u,v=Po(((d.value-c.value)/(m.value-g.value)*100||1)*i,3);return`clamp(${t}, ${`${p.value}${p.unit} + ((1vw - ${h}) * ${v})`}, ${n})`}function No(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=null==r?void 0:r.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),s=e.match(i);if(!s||s.length<3)return null;let[,a,c]=s,u=parseFloat(a);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:Po(u,3),unit:c}}function Po(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Lo(e,t){var n,o;const{size:r}=e;if(!r||"0"===r)return r;if(null==t||!t.fluid||"object"==typeof(null==t?void 0:t.fluid)&&0===Object.keys(t.fluid).length)return r;if(!1===(null==e?void 0:e.fluid))return r;const l="object"==typeof(null==t?void 0:t.fluid)?null==t?void 0:t.fluid:{},i=Mo({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(o=e.fluid)||void 0===o?void 0:o.max,fontSize:r,minimumFontSizeLimit:null==l?void 0:l.minFontSize});return i||r}const Ro="body",Ao=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return Lo(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}],Oo={"color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Do(e,t,n,o,r){const l=[(0,f.get)(e,["blocks",t,...n]),(0,f.get)(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const s of l){const l=i[s];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return Do(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function zo(e,t,n,o){if(!o)return o;const r=Oo[n],l=Ao.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:s}=l,a=Do(e,t,s,i,o);return a?`var:preset|${r}|${a.slug}`:o}function Fo(e,t,n){if(!n||"string"!=typeof n){var o,r;if(null===(o=n)||void 0===o||!o.ref||"string"!=typeof(null===(r=n)||void 0===r?void 0:r.ref))return n;{var l;const t=n.ref.split(".");if(!(n=(0,f.get)(e,t))||null!==(l=n)&&void 0!==l&&l.ref)return n}}const i="var:",s="var(--wp--";let a;if(n.startsWith(i))a=n.slice(i.length).split("|");else{if(!n.startsWith(s)||!n.endsWith(")"))return n;a=n.slice(s.length,-")".length).split("--")}const[c,...u]=a;return"preset"===c?function(e,t,n,o){let[r,l]=o;const i=Ao.find((e=>e.cssVarInfix===r));if(!i)return n;const s=Do(e.settings,t,i.path,"slug",l);if(s){const{valueKey:n}=i;return Fo(e,t,s[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,o){var r;const l=null!==(r=(0,f.get)(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:(0,f.get)(e.settings,["custom",...o]);return l?Fo(e,t,l):n}(e,t,n,u):n}const Vo=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Ho={settings:{},styles:{}},Go=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(Vo);return[!!e&&!_()(e,Ho),(0,u.useCallback)((()=>t((()=>Ho))),[t])]};function Uo(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:s}=(0,u.useContext)(Vo),a=t?`settings.blocks.${t}.${e}`:`settings.${e}`,c=e=>{s((t=>{const n=JSON.parse(JSON.stringify(t));return(0,f.set)(n,a,e),n}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`;let s;switch(o){case"all":s=(0,f.get)(r,n);break;case"user":s=(0,f.get)(i,n);break;case"base":s=(0,f.get)(l,n);break;default:throw"Unsupported source"}return s},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,c]}function $o(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:r,base:l,user:i,setUserConfig:s}=(0,u.useContext)(Vo),a=t?`styles.blocks.${t}.${e}`:`styles.${e}`,c=n=>{s((o=>{const l=JSON.parse(JSON.stringify(o));return(0,f.set)(l,a,zo(r.settings,t,e,n)),l}))};let d;switch(o){case"all":d=Fo(r,t,"styles.css"===a?(0,f.get)(i,a):null!==(n=(0,f.get)(i,a))&&void 0!==n?n:(0,f.get)(l,a));break;case"user":d=Fo(r,t,(0,f.get)(i,a));break;case"base":d=Fo(l,t,(0,f.get)(l,a));break;default:throw"Unsupported source"}return[d,c]}var jo=window.wp.styleEngine,Wo={grad:.9,turn:360,rad:360/(2*Math.PI)},Ko=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},qo=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Yo=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Zo=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Qo=function(e){return{r:Yo(e.r,0,255),g:Yo(e.g,0,255),b:Yo(e.b,0,255),a:Yo(e.a)}},Xo=function(e){return{r:qo(e.r),g:qo(e.g),b:qo(e.b),a:qo(e.a,3)}},Jo=/^#([0-9a-f]{3,8})$/i,er=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},tr=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},nr=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},or=function(e){return{h:Zo(e.h),s:Yo(e.s,0,100),l:Yo(e.l,0,100),a:Yo(e.a)}},rr=function(e){return{h:qo(e.h),s:qo(e.s),l:qo(e.l),a:qo(e.a,3)}},lr=function(e){return nr((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},ir=function(e){return{h:(t=tr(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},sr=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ar=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cr=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ur=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dr={string:[[function(e){var t=Jo.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?qo(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?qo(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=cr.exec(e)||ur.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Qo({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=sr.exec(e)||ar.exec(e);if(!t)return null;var n,o,r=or({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Wo[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return lr(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return Ko(t)&&Ko(n)&&Ko(o)?Qo({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!Ko(t)||!Ko(n)||!Ko(o))return null;var i=or({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return lr(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Ko(t)||!Ko(n)||!Ko(o))return null;var i=function(e){return{h:Zo(e.h),s:Yo(e.s,0,100),v:Yo(e.v,0,100),a:Yo(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return nr(i)},"hsv"]]},pr=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},mr=function(e){return"string"==typeof e?pr(e.trim(),dr.string):"object"==typeof e&&null!==e?pr(e,dr.object):[null,void 0]},gr=function(e,t){var n=ir(e);return{h:n.h,s:Yo(n.s+100*t,0,100),l:n.l,a:n.a}},fr=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},hr=function(e,t){var n=ir(e);return{h:n.h,s:n.s,l:Yo(n.l+100*t,0,100),a:n.a}},vr=function(){function e(e){this.parsed=mr(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return qo(fr(this.rgba),2)},e.prototype.isDark=function(){return fr(this.rgba)<.5},e.prototype.isLight=function(){return fr(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Xo(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?er(qo(255*r)):"","#"+er(t)+er(n)+er(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Xo(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Xo(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return rr(ir(this.rgba))},e.prototype.toHslString=function(){return t=(e=rr(ir(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=tr(this.rgba),{h:qo(e.h),s:qo(e.s),v:qo(e.v),a:qo(e.a,3)};var e},e.prototype.invert=function(){return br({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),br(gr(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),br(gr(this.rgba,-e))},e.prototype.grayscale=function(){return br(gr(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),br(hr(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),br(hr(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?br({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):qo(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=ir(this.rgba);return"number"==typeof e?br({h:e,s:t.s,l:t.l,a:t.a}):qo(t.h)},e.prototype.isEqual=function(e){return this.toHex()===br(e).toHex()},e}(),br=function(e){return e instanceof vr?e:new vr(e)},_r=[],kr=function(e){e.forEach((function(e){_r.indexOf(e)<0&&(e(vr,dr),_r.push(e))}))};function yr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=br(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 Er(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,u.createElement)("style",null,o)}function Cr(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,u.createElement)("style",null,n)}function Sr(e){let{id:t,colors:n}=e;const o=yr(n);return(0,u.createElement)(h.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,u.createElement)("defs",null,(0,u.createElement)("filter",{id:t},(0,u.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,u.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,u.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,u.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,u.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,u.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,u.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function wr(e){let{preset:t}=e;return(0,u.createElement)(Sr,{id:`wp-duotone-${t.slug}`,colors:t.colors})}const Br=(0,u.createContext)({refs:new Map,callbacks:new Map});function Ir(e){let{children:t}=e;const n=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,u.createElement)(Br.Provider,{value:n},t)}function xr(e){const{refs:t,callbacks:n}=(0,u.useContext)(Br),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,m.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Tr(e){const{refs:t}=(0,u.useContext)(Br),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Mr(e){const{callbacks:t}=(0,u.useContext)(Br),n=Tr(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Nr(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function Pr(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Lr(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Rr={all:(0,k.__)("All sides"),top:(0,k.__)("Top"),bottom:(0,k.__)("Bottom"),left:(0,k.__)("Left"),right:(0,k.__)("Right"),mixed:(0,k.__)("Mixed"),vertical:(0,k.__)("Vertical"),horizontal:(0,k.__)("Horizontal")},Ar={top:void 0,right:void 0,bottom:void 0,left:void 0},Or=["top","right","bottom","left"];function Dr(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function zr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Or;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Fr(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}var Vr=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));const Hr={name:"",isSelected:!1},Gr=(0,u.createContext)(Hr),{Provider:Ur}=Gr;function $r(){return(0,u.useContext)(Gr)}const jr=["color","border","dimensions","typography","spacing"],Wr={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},Kr={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function qr(e){const{name:t,clientId:n}=$r();return(0,g.useSelect)((o=>{if(jr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,a.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=(e=>Kr[e]||e)(e),i=[n,...o(E_).getBlockParents(n,!0)];for(const e of i){const n=o(E_).getBlockName(e);if((0,s.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(E_).getBlockAttributes(e);if(r=null!==(c=(0,f.get)(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:(0,f.get)(n,`settings.${l}`),void 0!==r)break}}const u=o(E_).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`,n=`__experimentalFeatures.blocks.${t}.${l}`;r=null!==(d=(0,f.get)(u,n))&&void 0!==d?d:(0,f.get)(u,e)}var p,m;if(void 0!==r)return s.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const g=Wr[l]?Wr[l](u):void 0;return void 0!==g?g:"typography.dropCap"===l||void 0}),[t,n,e])}const Yr={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function Zr(e){var t,n,o,r,l;let{spacingSizes:i,value:s,side:a,onChange:c,isMixed:d=!1,type:m,minimumCustomValue:f,onMouseOver:v,onMouseOut:b}=e;s=function(e,t){if(Nr(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(s,i);let _=i;const y=i.length<=8,E=(0,g.useSelect)((e=>{const t=e(E_).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[C,S]=(0,u.useState)(!E&&void 0!==s&&!Nr(s)),w=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["px","em","rem"]});let B=null;!y&&!C&&void 0!==s&&(!Nr(s)||Nr(s)&&d)?(_=[...i,{name:d?(0,k.__)("Mixed"):(0,k.sprintf)((0,k.__)("Custom (%s)"),s),slug:"custom",size:s}],B=_.length-1):d||(B=C?function(e,t){if(!Nr(e))return e;const n=Lr(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}(s,i):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Lr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(s,i));const I=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(B)),[B])[1]||w[0].value,x=e=>{var t;return void 0===s||null===(t=i[e])||void 0===t?void 0:t.name},T=parseFloat(B,10),M=(e,t)=>{var n;const o=parseInt(e,10);if("selectList"===t){if(0===o)return;if(1===o)return"0"}else if(0===o)return"0";return`var:preset|spacing|${null===(n=i[e])||void 0===n?void 0:n.slug}`},N=d?(0,k.__)("Mixed"):null,P=d?(0,k.__)("Mixed"):x(B),L=_.map(((e,t)=>({key:t,name:e.name}))),R=i.map(((e,t)=>({value:t,label:void 0}))),A=(0,k.sprintf)((0,k.__)("%1$s %2$s"),Rr[a],null==m?void 0:m.toLowerCase()),O=y&&!C&&void 0!==P;return(0,u.createElement)(u.Fragment,null,"all"!==a&&(0,u.createElement)(h.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__side-label"},Rr[a]),O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},P)),"all"===a&&O&&(0,u.createElement)(h.BaseControl.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},P),!E&&(0,u.createElement)(h.Button,{label:C?(0,k.__)("Use size preset"):(0,k.__)("Set custom size"),icon:Vr,onClick:()=>{S(!C)},isPressed:C,isSmall:!0,className:p()({"components-spacing-sizes-control__custom-toggle-all":"all"===a,"components-spacing-sizes-control__custom-toggle-single":"all"!==a}),iconSize:24}),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalUnitControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:B,units:w,min:f,placeholder:N,disableUnits:d,label:A,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b,value:T,min:0,max:null!==(t=null===(n=Yr[I])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(o=null===(r=Yr[I])||void 0===r?void 0:r.steps)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{c([e,I].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),y&&!C&&(0,u.createElement)(h.RangeControl,{onMouseOver:v,onMouseOut:b,className:"components-spacing-sizes-control__range-control",value:B,onChange:e=>c(M(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===s&&c("0")},withInputField:!1,"aria-valuenow":B,"aria-valuetext":null===(l=i[B])||void 0===l?void 0:l.name,renderTooltipContent:x,min:0,max:i.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:v,onBlur:b}),!y&&!C&&(0,u.createElement)(h.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:L.find((e=>e.key===B))||"",onChange:e=>{c(M(e.selectedItem.key,"selectList"))},options:L,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:v,onMouseOut:b,onFocus:v,onBlur:b}))}function Qr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Dr(Object.values(e))}(n),d=Fr(n)&&zr(n,o);return(0,u.createElement)(Zr,{value:c,onChange:e=>{const r=(0,h.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:d,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a})}function Xr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a}=e;const c=null!=n&&n.length?Or.filter((e=>n.includes(e))):Or,d=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,u.createElement)(u.Fragment,null,c.map((e=>(0,u.createElement)(Zr,{value:t[e],label:Rr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:d(e),spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a}))))}const Jr=["vertical","horizontal"];function el(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a}=e;const c=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},d=null!=o&&o.length?Jr.filter((e=>o.includes(e))):Jr;return(0,u.createElement)(u.Fragment,null,d.map((e=>{const t="vertical"===e?n.top:n.left;return(0,u.createElement)(Zr,{value:t,onChange:c(e),label:Rr[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i,onMouseOver:s,onMouseOut:a})})))}var tl=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var nl=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function ol(e){let{isLinked:t,onClick:n}=e;const o=t?(0,k.__)("Unlink sides"):(0,k.__)("Link sides");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,u.createElement)(h.Button,{isSmall:!0,icon:t?tl:nl,iconSize:24,"aria-label":o,onClick:n})))}function rl(e){let{inputProps:t,onChange:n,label:o=(0,k.__)("Spacing Control"),values:r,sides:l,splitOnAxis:i=!1,useSelect:s,minimumCustomValue:a=0,onMouseOver:d,onMouseOut:m}=e;const g=[{name:0,slug:"0",size:0},...qr("spacing.spacingSizes")||[]];g.length>8&&g.unshift({name:(0,k.__)("Default"),slug:"default",size:void 0});const f=r||Ar,v=Fr(r),b=1===(null==l?void 0:l.length),[_,y]=(0,u.useState)(!v||!zr(f,l)||b),E={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:_,sides:l,values:f,spacingSizes:g,useSelect:s,type:o,minimumCustomValue:a,onMouseOver:d,onMouseOut:m};return(0,u.createElement)("fieldset",{className:p()("component-spacing-sizes-control",{"is-unlinked":!_})},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},o),!b&&(0,u.createElement)(ol,{onClick:()=>{y(!_)},isLinked:_}),_&&(0,u.createElement)(Qr,c({"aria-label":o},E)),!_&&i&&(0,u.createElement)(el,E),!_&&!i&&(0,u.createElement)(Xr,E))}window.wp.warning;function ll(){const{isSelected:e,clientId:t,name:n}=$r();return(0,g.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(E_);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}const il=(0,h.createSlotFill)("InspectorControls"),sl=(0,h.createSlotFill)("InspectorAdvancedControls"),al=(0,h.createSlotFill)("InspectorControlsBorder"),cl=(0,h.createSlotFill)("InspectorControlsColor"),ul=(0,h.createSlotFill)("InspectorControlsDimensions"),dl=(0,h.createSlotFill)("InspectorControlsPosition"),pl=(0,h.createSlotFill)("InspectorControlsTypography");var ml={default:il,advanced:sl,border:al,color:cl,dimensions:ul,list:(0,h.createSlotFill)("InspectorControlsListView"),settings:il,styles:(0,h.createSlotFill)("InspectorControlsStyles"),typography:pl,position:dl};function gl(e){var t;let{children:n,group:o="default",__experimentalGroup:r}=e;r&&(W()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=r);const l=ll(),i=null===(t=ml[o])||void 0===t?void 0:t.Fill;return i?l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(i,null,(e=>{const t=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolsPanelContext.Provider,{value:t},n)}))):null:("undefined"!=typeof process&&process.env,null)}const fl=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,f.mapValues)(e,fl)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,f.isEmpty)(t)?void 0:t};function hl(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,hl(n)]})))}:e}function vl(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?hl(e):{};return o.reduce(((e,t,r)=>(void 0===e[t]&&(e[t]={}),r===o.length-1&&(e[t]=n),e[t])),r),r}function bl(e,t,n,o,r,l){var i;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,o]=e;o&&t[n].forEach((e=>{const t=(0,f.get)(s,e);t&&(c={...c,attributes:vl(c.attributes,e,t)})}))})),c}function _l(e,t,n){const o=(0,s.getBlockSupport)(e,t),r=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function kl(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,g.useDispatch)(E_),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,g.useSelect)(E_),c=s(),d=(0,u.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=a()?i():[c];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:fl(r.style)},t[n]=r})),r(n,t,!0)}),[fl,l,i,a,c,r]);return(0,u.createElement)(h.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function yl(e){let{Slot:t,...n}=e;const o=(0,u.useContext)(h.__experimentalToolsPanelContext);return(0,u.createElement)(t,c({},n,{fillProps:o,bubblesVirtually:!0}))}function El(e){var t;let{__experimentalGroup:n,group:o="default",label:r,...l}=e;n&&(W()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),o=n);const i=null===(t=ml[o])||void 0===t?void 0:t.Slot,s=(0,h.__experimentalUseSlot)(null==i?void 0:i.__unstableName),a=(0,h.__experimentalUseSlotFills)(null==i?void 0:i.__unstableName);if(!i||!s)return"undefined"!=typeof process&&process.env,null;return Boolean(a&&a.length)?r?(0,u.createElement)(kl,{group:o,label:r},(0,u.createElement)(yl,c({},l,{Slot:i}))):(0,u.createElement)(i,c({},l,{bubblesVirtually:!0})):null}const Cl=gl;Cl.Slot=El;const Sl=e=>(0,u.createElement)(gl,c({},e,{group:"advanced"}));Sl.Slot=e=>(0,u.createElement)(El,c({},e,{group:"advanced"})),Sl.slotName="InspectorAdvancedControls";var wl=Cl,Bl=window.wp.isShallowEqual,Il=n.n(Bl);var xl=function(e){return(0,m.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};const Tl=Number.MAX_SAFE_INTEGER;var Ml=(0,u.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:i=!1,__unstablePopoverSlot:s,__unstableContentRef:a,shift:d=!0,...g}=e;const f=Mr(n),v=Mr(null!=o?o:n),b=(0,m.useMergeRefs)([t,xl(a)]),[_,k]=(0,u.useReducer)((e=>(e+1)%Tl),0);(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(k);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const y=(0,u.useMemo)((()=>_<0||!f||v!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,v,l,_]),E=(0,u.useMemo)((()=>{if(!(_<0||!f||o&&!v))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=null==v?void 0:v.getBoundingClientRect(),i=Math.min(r.left,null!==(e=null==l?void 0:l.left)&&void 0!==e?e:1/0),s=Math.min(r.top,null!==(t=null==l?void 0:l.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},ownerDocument:f.ownerDocument}}),[o,v,f,_]);return!f||o&&!v?null:(0,u.createElement)(h.Popover,c({ref:b,animate:!1,focusOnMount:!1,anchor:E,__unstableSlotName:s||null,placement:"top-start",resize:!1,flip:!1,shift:d},g,{className:p()("block-editor-block-popover",g.className),variant:"unstyled"}),i&&(0,u.createElement)("div",{style:y},r),!i&&r)}));function Nl(e){const t=(0,s.getBlockSupport)(e,Zl);return!!(!0===t||null!=t&&t.margin)}function Pl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qr("spacing.margin"),n=!oi(e,"margin");return!Nl(e)||t||n}function Ll(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:s}=e,a=qr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vw"]}),d=ni(o,"margin"),p=d&&d.some((e=>Xl.includes(e)));if(Pl(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:fl(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!a||0===(null==a?void 0:a.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:m,label:(0,k.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:s}),(null==a?void 0:a.length)>0&&(0,u.createElement)(rl,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:m,label:(0,k.__)("Margin"),sides:d,units:c,allowReset:!1,splitOnAxis:!1,onMouseOver:i,onMouseOut:s})),native:null})}function Rl(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,s=(0,u.useMemo)((()=>{const e=null!=i&&i.top?Pr(null==i?void 0:i.top):0,t=null!=i&&i.right?Pr(null==i?void 0:i.right):0,n=null!=i&&i.bottom?Pr(null==i?void 0:i.bottom):0,o=null!=i&&i.left?Pr(null==i?void 0:i.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:o?`calc(${o} * -1)`:0}}),[i]),[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Il()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),a||l?(0,u.createElement)(Ml,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:s})):null}const Al={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function Ol(e){var t,n,o,r,l;let{label:i=(0,k.__)("Height"),onChange:s,value:a}=e;const c=parseFloat(a),d=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vh","vw"]}),p=(0,u.useMemo)((()=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a)),[a])[1]||(null===(t=d[0])||void 0===t?void 0:t.value)||"px";return(0,u.createElement)("fieldset",{className:"block-editor-height-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},i),(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalUnitControl,{value:a,units:d,onChange:s,onUnitChange:e=>{const[t,n]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(a);["em","rem"].includes(e)&&"px"===n?s((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?s(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&s(100+e)},min:0,size:"__unstable-large"})),(0,u.createElement)(h.FlexItem,{isBlock:!0},(0,u.createElement)(h.__experimentalSpacer,{marginX:2,marginBottom:0},(0,u.createElement)(h.RangeControl,{value:c,min:0,max:null!==(n=null===(o=Al[p])||void 0===o?void 0:o.max)&&void 0!==n?n:100,step:null!==(r=null===(l=Al[p])||void 0===l?void 0:l.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{s([e,p].join(""))},__nextHasNoMarginBottom:!0})))))}function Dl(e){const t=(0,s.getBlockSupport)(e,Yl);return!!(!0===t||null!=t&&t.minHeight)}function zl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qr("dimensions.minHeight");return!Dl(e)||t}function Fl(e){var t;const{attributes:{style:n},setAttributes:o}=e;if(zl(e))return null;return(0,u.createElement)(Ol,{label:(0,k.__)("Min. height"),value:null==n||null===(t=n.dimensions)||void 0===t?void 0:t.minHeight,onChange:e=>{const t={...n,dimensions:{...null==n?void 0:n.dimensions,minHeight:e}};o({style:fl(t)})}})}function Vl(e){const t=(0,s.getBlockSupport)(e,Zl);return!!(!0===t||null!=t&&t.padding)}function Hl(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qr("spacing.padding"),n=!oi(e,"padding");return!Vl(e)||t||n}function Gl(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l,onMouseOver:i,onMouseOut:s}=e,a=qr("spacing.spacingSizes"),c=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vw"]}),d=ni(o,"padding"),p=d&&d.some((e=>Xl.includes(e)));if(Hl(e))return null;const m=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:fl(t)})};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!a||0===(null==a?void 0:a.length))&&(0,u.createElement)(h.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:m,label:(0,k.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:s}),(null==a?void 0:a.length)>0&&(0,u.createElement)(rl,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:m,label:(0,k.__)("Padding"),sides:d,units:c,allowReset:!1,splitOnAxis:p,onMouseOver:i,onMouseOut:s})),native:null})}function Ul(e){var t,n;let{clientId:o,attributes:r,forceShow:l}=e;const i=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,s=(0,u.useMemo)((()=>({borderTopWidth:null!=i&&i.top?Pr(null==i?void 0:i.top):0,borderRightWidth:null!=i&&i.right?Pr(null==i?void 0:i.right):0,borderBottomWidth:null!=i&&i.bottom?Pr(null==i?void 0:i.bottom):0,borderLeftWidth:null!=i&&i.left?Pr(null==i?void 0:i.left):0})),[i]),[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(Il()(i,d.current)||l||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,l]),a||l?(0,u.createElement)(Ml,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,u.createElement)("div",{className:"block-editor__padding-visualizer",style:s})):null}function $l(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,k.__)("Stretch to fill available space."):"fixed"===e?"horizontal"===n?(0,k.__)("Specify a fixed width."):(0,k.__)("Specify a fixed height."):(0,k.__)("Fit contents.")}function jl(e){let{attributes:t,setAttributes:n,__unstableParentLayout:o}=e;const{style:r={}}=t,{layout:l={}}=r,{selfStretch:i,flexSize:s}=l;return(0,u.useEffect)((()=>{"fixed"!==i||s||n({style:{...r,layout:{...l,selfStretch:"fit"}}})}),[]),(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:ql(o),value:i||"fit",help:$l(i,o),onChange:e=>{const t="fixed"!==e?null:s;n({style:{...r,layout:{...l,selfStretch:e,flexSize:t}}})},isBlock:!0},(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,k.__)("Fit")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,k.__)("Fill")}),(0,u.createElement)(h.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,k.__)("Fixed")})),"fixed"===i&&(0,u.createElement)(h.__experimentalUnitControl,{size:"__unstable-large",onChange:e=>{n({style:{...r,layout:{...l,flexSize:e}}})},value:s}))}function Wl(e){let{__unstableParentLayout:t={}}=e;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=t;return("flex"===o||"flex"===n)&&r}function Kl(e){const t=!qr("layout");return!Wl(e)||t}function ql(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,k.__)("Width"):(0,k.__)("Height")}const Yl="dimensions",Zl="spacing",Ql=["top","right","bottom","left"],Xl=["vertical","horizontal"];function Jl(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=__((0,g.useDispatch)(E_));return{isMouseOver:e,onMouseOver:e=>{e.stopPropagation(),n(),t(!0)},onMouseOut:e=>{e.stopPropagation(),o(),t(!1)}}}function ei(e){const t=si(e),n=Hl(e),o=Pl(e),r=zl(e),l=Kl(e),i=ti(e),a=function(e){if("web"!==u.Platform.OS)return!1;const{name:t}=e;return ri(t)||Dl(t)||Vl(t)||Nl(t)||Wl(e)}(e),d=qr("spacing.spacingSizes"),m=Jl(),g=Jl();if(i||!a)return null;const f=(0,s.getBlockSupport)(e.name,[Yl,"__experimentalDefaultControls"]),v=(0,s.getBlockSupport)(e.name,[Zl,"__experimentalDefaultControls"]),b=(e,t)=>n=>{var o;return{...n,style:{...n.style,[t]:{...null===(o=n.style)||void 0===o?void 0:o[t],[e]:void 0}}}},_=p()({"tools-panel-item-spacing":d&&d.length>0}),{__unstableParentLayout:y}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(wl,{group:"dimensions"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:_,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,k.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:b("padding","spacing"),isShownByDefault:null==v?void 0:v.padding,panelId:e.clientId},(0,u.createElement)(Gl,c({onMouseOver:m.onMouseOver,onMouseOut:m.onMouseOut},e))),!o&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:_,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,k.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:b("margin","spacing"),isShownByDefault:null==v?void 0:v.margin,panelId:e.clientId},(0,u.createElement)(Ll,c({onMouseOver:g.onMouseOver,onMouseOut:g.onMouseOut},e))),!t&&(0,u.createElement)(h.__experimentalToolsPanelItem,{className:_,hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,k.__)("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:b("blockGap","spacing"),isShownByDefault:null==v?void 0:v.blockGap,panelId:e.clientId},(0,u.createElement)(ai,e)),!r&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.dimensions)||void 0===n?void 0:n.minHeight)}(e),label:(0,k.__)("Min. height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,dimensions:{...null==o?void 0:o.dimensions,minHeight:void 0}})})}(e),resetAllFilter:b("minHeight","dimensions"),isShownByDefault:null==f?void 0:f.minHeight,panelId:e.clientId},(0,u.createElement)(Fl,e)),!l&&(0,u.createElement)(h.__experimentalVStack,{as:h.__experimentalToolsPanelItem,spacing:2,hasValue:()=>function(e){var t;return void 0!==(null===(t=e.attributes.style)||void 0===t?void 0:t.layout)}(e),label:ql(y),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,layout:void 0}})}(e),resetAllFilter:b("selfStretch","layout"),isShownByDefault:!1,panelId:e.clientId},(0,u.createElement)(jl,e))),!n&&(0,u.createElement)(Ul,c({forceShow:m.isMouseOver},e)),!o&&(0,u.createElement)(Rl,c({forceShow:g.isMouseOver},e)))}const ti=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=si(e),n=zl(e),o=Hl(e),r=Pl(e),l=Kl(e);return t&&n&&o&&r&&l};function ni(e,t){var n;const o=(0,s.getBlockSupport)(e,Zl);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function oi(e,t){const n=ni(e,t);return!(n&&n.some((e=>Ql.includes(e)))&&n.some((e=>Xl.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function ri(e){const t=(0,s.getBlockSupport)(e,Zl);return!!(!0===t||null!=t&&t.blockGap)}function li(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function ii(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=li(e);if(!n)return null;const o=Pr(null==n?void 0:n.top)||t,r=Pr(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function si(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qr("spacing.blockGap");return!ri(e)||t}function ai(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=qr("spacing.spacingSizes"),s=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vw"]}),a=ni(r,"blockGap"),c=Tr(n);if(si(e))return null;const d=a&&a.some((e=>Xl.includes(e))),p=e=>{var t;let n=e;e&&d?n={...li(e)}:null!=e&&e.hasOwnProperty("top")&&(n=e.top);const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:fl(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=li(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:{top:null==m?void 0:m.top};return u.Platform.select({web:(0,u.createElement)(u.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(d?(0,u.createElement)(h.__experimentalBoxControl,{label:(0,k.__)("Block spacing"),min:0,onChange:p,units:s,sides:a,values:g,allowReset:!1,splitOnAxis:d}):(0,u.createElement)(h.__experimentalUnitControl,{label:(0,k.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:p,units:s,value:g})),(null==i?void 0:i.length)>0&&(0,u.createElement)(rl,{values:g,onChange:p,label:(0,k.__)("Block spacing"),sides:d?a:["top"],units:s,allowReset:!1,splitOnAxis:d})),native:null})}const ci={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function ui(e){var t;const n="var:";if(null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,n)){return`var(--wp--${e.slice(n.length).split("|").join("--")})`}return e}function di(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ao.reduce(((n,o)=>{let{path:r,cssVarInfix:l,classes:i}=o;if(!i)return n;const s=(0,f.get)(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((t=>{let{slug:o}=t;i.forEach((t=>{let{classSuffix:r,propertyName:i}=t;const s=`.has-${(0,f.kebabCase)(o)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),c=`var(--wp--preset--${l}--${(0,f.kebabCase)(o)})`;n+=`${a}{${i}: ${c} !important;}`}))}))})),n}),"")}function pi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=[];return Object.keys(e).forEach((r=>{const l=t+(0,f.kebabCase)(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=l+n;o=[...o,...pi(i,e,n)]}else o.push(`${l}: ${i}`)})),o}function mi(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}function gi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Ro===t,l=Object.entries(s.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,o)=>{let[l,{value:i,properties:s,useEngine:a,rootOnly:c}]=o;if(c&&!r)return t;const u=i;if("elements"===u[0]||a)return t;const d=(0,f.get)(e,u);if("--wp--style--root--padding"===l&&("string"==typeof d||!n))return t;if(s&&"string"!=typeof d)Object.entries(s).forEach((e=>{const[n,o]=e;if(!(0,f.get)(d,[o],!1))return;const r=n.startsWith("--")?n:(0,f.kebabCase)(n);t.push(`${r}: ${ui((0,f.get)(d,[o]))}`)}));else if((0,f.get)(e,u,!1)){const n=l.startsWith("--")?l:(0,f.kebabCase)(l);t.push(`${n}: ${ui((0,f.get)(e,u))}`)}return t}),[]),i=(0,jo.getCSSRules)(e);return i.forEach((e=>{var t;if(r&&n&&e.key.startsWith("padding"))return;const i=e.key.startsWith("--")?e.key:(0,f.kebabCase)(e.key);let s=e.value;if("string"!=typeof s&&null!==(t=s)&&void 0!==t&&t.ref){var a;const e=s.ref.split(".");if(s=(0,f.get)(o,e),!s||null!==(a=s)&&void 0!==a&&a.ref)return}var c;"font-size"===i&&(s=Lo({size:s},null==o||null===(c=o.settings)||void 0===c?void 0:c.typography));l.push(`${i}: ${s}`)})),l}function fi(e){var t,n,o,r,l;let{tree:i,style:s,selector:a,hasBlockGapSupport:c,hasFallbackGapSupport:u,fallbackGapValue:d}=e,p="",m=c?ii(null==s||null===(t=s.spacing)||void 0===t?void 0:t.blockGap):"";if(u&&(a===Ro?m=m||"0.5em":!c&&d&&(m=d)),m&&null!=i&&null!==(n=i.settings)&&void 0!==n&&null!==(o=n.layout)&&void 0!==o&&o.definitions&&(Object.values(i.settings.layout.definitions).forEach((e=>{let{className:t,name:n,spacingStyles:o}=e;(c||"flex"===n)&&null!=o&&o.length&&o.forEach((e=>{const n=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[t,o]=e;n.push(`${t}: ${o||m}`)})),n.length){let o="";o=c?a===Ro?`${a} .${t}${(null==e?void 0:e.selector)||""}`:`${a}.${t}${(null==e?void 0:e.selector)||""}`:a===Ro?`:where(.${t}${(null==e?void 0:e.selector)||""})`:`:where(${a}.${t}${(null==e?void 0:e.selector)||""})`,p+=`${o} { ${n.join("; ")}; }`}}))})),a===Ro&&c&&(p+=`${a} { --wp--style--block-gap: ${m}; }`)),a===Ro&&null!=i&&null!==(r=i.settings)&&void 0!==r&&null!==(l=r.layout)&&void 0!==l&&l.definitions){const e=["block","flex","grid"];Object.values(i.settings.layout.definitions).forEach((t=>{let{className:n,displayMode:o,baseStyles:r}=t;o&&e.includes(o)&&(p+=`${a} .${n} { display:${o}; }`),null!=r&&r.length&&r.forEach((e=>{const t=[];if(e.rules&&Object.entries(e.rules).forEach((e=>{let[n,o]=e;t.push(`${n}: ${o}`)})),t.length){const o=`${a} .${n}${(null==e?void 0:e.selector)||""}`;p+=`${o} { ${t.join("; ")}; }`}}))}))}return p}const hi=(e,t)=>{var n,o;const r=[];if(null==e||!e.styles)return r;const l=e=>Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["border","color","dimensions","spacing","typography","filter","outline","shadow"].includes(t)}))),i=l(e.styles);return i&&r.push({styles:i,selector:Ro}),Object.entries(s.__EXPERIMENTAL_ELEMENTS).forEach((t=>{var n;let[o,l]=t;var i;null!==(n=e.styles)&&void 0!==n&&n.elements[o]&&r.push({styles:null===(i=e.styles)||void 0===i?void 0:i.elements[o],selector:l})})),Object.entries(null!==(n=null===(o=e.styles)||void 0===o?void 0:o.blocks)&&void 0!==n?n:{}).forEach((e=>{var n,o;let[i,a]=e;const c=l(a);if(null!=a&&a.variations){const e={};Object.keys(a.variations).forEach((t=>{e[t]=l(a.variations[t])})),c.variations=e}c&&null!=t&&null!==(n=t[i])&&void 0!==n&&n.selector&&r.push({duotoneSelector:t[i].duotoneSelector,fallbackGapValue:t[i].fallbackGapValue,hasLayoutSupport:t[i].hasLayoutSupport,selector:t[i].selector,styles:c,featureSelectors:t[i].featureSelectors,styleVariationSelectors:t[i].styleVariationSelectors}),Object.entries(null!==(o=null==a?void 0:a.elements)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;o&&null!=t&&t[i]&&null!==s.__EXPERIMENTAL_ELEMENTS&&void 0!==s.__EXPERIMENTAL_ELEMENTS&&s.__EXPERIMENTAL_ELEMENTS[n]&&r.push({styles:o,selector:t[i].selector.split(",").map((e=>s.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r},vi=(e,t)=>{var n,o,r;const l=[];if(null==e||!e.settings)return l;const i=e=>{const t={};return Ao.forEach((n=>{let{path:o}=n;const r=(0,f.get)(e,o,!1);!1!==r&&(0,f.set)(t,o,r)})),t},s=i(e.settings),a=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,f.isEmpty)(s)&&!a||l.push({presets:s,custom:a,selector:Ro}),Object.entries(null!==(o=null===(r=e.settings)||void 0===r?void 0:r.blocks)&&void 0!==o?o:{}).forEach((e=>{let[n,o]=e;const r=i(o),s=o.custom;(0,f.isEmpty)(r)&&!s||l.push({presets:r,custom:s,selector:t[n].selector})})),l},bi=(e,t)=>{const n=vi(e,t);let o="";return n.forEach((t=>{let{presets:n,custom:r,selector:l}=t;const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return Ao.reduce(((n,o)=>{let{path:r,valueKey:l,valueFunc:i,cssVarInfix:s}=o;const a=(0,f.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{l&&!i?n.push(`--wp--preset--${s}--${(0,f.kebabCase)(e.slug)}: ${e[l]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${(0,f.kebabCase)(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(n,null==e?void 0:e.settings),s=pi(r,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(o+=`${l}{${i.join(";")};}`)})),o};function _i(e,t){return vi(e,t).flatMap((e=>{let{presets:t}=e;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ao.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=(0,f.get)(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>(0,u.createElement)(wr,{preset:e,key:e.slug})))))}))}(t)}))}const ki=(e,t)=>{let n="";return e.split("&").forEach((e=>{n+=e.includes("{")?t+e:t+"{"+e+"}"})),n};function yi(){let{merged:e}=(0,u.useContext)(Vo);const[t]=Uo("spacing.blockGap"),n=null!==t,o=!n,r=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return!!t().disableLayoutStyles})),l=(0,g.useSelect)((e=>e(s.store).getBlockStyles),[]);return(0,u.useMemo)((()=>{var t,i,a;if(null===(t=e)||void 0===t||!t.styles||null===(i=e)||void 0===i||!i.settings)return[];e=function(e){var t,n,o,r,l,i,s,a;return!(null===(t=e.styles)||void 0===t?void 0:t.blocks["core/separator"])||!(null===(n=e.styles)||void 0===n||null===(o=n.blocks["core/separator"].color)||void 0===o?void 0:o.background)||null!==(r=e.styles)&&void 0!==r&&null!==(l=r.blocks["core/separator"].color)&&void 0!==l&&l.text||null!==(i=e.styles)&&void 0!==i&&null!==(s=i.blocks["core/separator"].border)&&void 0!==s&&s.color?e:{...e,styles:{...e.styles,blocks:{...e.styles.blocks,"core/separator":{...e.styles.blocks["core/separator"],color:{...e.styles.blocks["core/separator"].color,text:null===(a=e.styles)||void 0===a?void 0:a.blocks["core/separator"].color.background}}}}}}(e);const c=((e,t)=>{const n={};return e.forEach((e=>{var o,r,l,i,s,a,c,u,d;const p=e.name,m=null!==(o=null==e||null===(r=e.supports)||void 0===r?void 0:r.__experimentalSelector)&&void 0!==o?o:".wp-block-"+p.replace("core/","").replace("/","-"),g=null!==(l=null==e||null===(i=e.supports)||void 0===i||null===(s=i.color)||void 0===s?void 0:s.__experimentalDuotone)&&void 0!==l?l:null,f=!(null==e||null===(a=e.supports)||void 0===a||!a.__experimentalLayout),h=null==e||null===(c=e.supports)||void 0===c||null===(u=c.spacing)||void 0===u||null===(d=u.blockGap)||void 0===d?void 0:d.__experimentalDefault,v=t(p),b={};null!=v&&v.length&&v.forEach((e=>{const t=`.is-style-${e.name}${m}`;b[e.name]=t}));const _={};Object.entries(ci).forEach((t=>{var n,o;let[r,l]=t;const i=null==e||null===(n=e.supports)||void 0===n||null===(o=n[r])||void 0===o?void 0:o.__experimentalSelector;i&&(_[l]=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(", ")}(m,i))})),n[p]={duotoneSelector:g,fallbackGapValue:h,featureSelectors:Object.keys(_).length?_:void 0,hasLayoutSupport:f,name:p,selector:m,styleVariationSelectors:Object.keys(b).length?b:void 0}})),n})((0,s.getBlockTypes)(),l),u=bi(e,c),d=function(e,t,n,o){var r,l;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=hi(e,t),a=vi(e,t),c=null==e||null===(r=e.settings)||void 0===r?void 0:r.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=(null==e||null===(l=e.settings)||void 0===l?void 0:l.layout)||{};let p="body {margin: 0;";if(u&&(p+=` --wp--style--global--content-size: ${u};`),d&&(p+=` --wp--style--global--wide-size: ${d};`),c&&(p+='padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;'),p+="}",s.forEach((t=>{let{selector:r,duotoneSelector:l,styles:s,fallbackGapValue:a,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m}=t;d&&Object.entries(d).forEach((e=>{let[t,n]=e;if(null!=s&&s[t]){const e=gi({[t]:s[t]});delete s[t],e.length&&(p+=`${n}{${e.join(";")} }`)}})),m&&Object.entries(m).forEach((t=>{var n;let[o,r]=t;if(null!=s&&null!==(n=s.variations)&&void 0!==n&&n[o]){var l;d&&Object.entries(d).forEach((e=>{var t,n;let[l,i]=e;if(null!=s&&null!==(t=s.variations)&&void 0!==t&&null!==(n=t[o])&&void 0!==n&&n[l]){const e=gi({[l]:s.variations[o][l]});delete s.variations[o][l],e.length&&(p+=`${mi(i,r)}{${e.join(";")} }`)}}));const t=gi(null==s||null===(l=s.variations)||void 0===l?void 0:l[o],r,c,e);t.length&&(p+=`${r}{${t.join(";")}}`)}}));const g={};if(null!=s&&s.filter&&(g.filter=s.filter,delete s.filter),l){const e=gi(g);e.length>0&&(p+=`${l}{${e.join(";")};}`)}i||Ro!==r&&!u||(p+=fi({tree:e,style:s,selector:r,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:a}));const f=gi(s,r,c,e);null!=f&&f.length&&(p+=`${r}{${f.join(";")};}`);const h=Object.entries(s).filter((e=>{let[t]=e;return t.startsWith(":")}));null!=h&&h.length&&h.forEach((e=>{let[t,n]=e;const o=gi(n);if(null==o||!o.length)return;const l=`${r.split(",").map((e=>e+t)).join(",")}{${o.join(";")};}`;p+=l}))})),p+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){var m,g;const t=ii(null==e||null===(m=e.styles)||void 0===m||null===(g=m.spacing)||void 0===g?void 0:g.blockGap)||"0.5em";p+=".wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }",p+=`.wp-site-blocks > * + * { margin-block-start: ${t}; }`}return a.forEach((e=>{let{selector:t,presets:n}=e;Ro===t&&(t="");const o=di(t,n);(0,f.isEmpty)(o)||(p+=o)})),p}(e,c,n,o,r),p=_i(e,c),m=[{css:u,isGlobalStyles:!0},{css:d,isGlobalStyles:!0},{css:null!==(a=e.styles.css)&&void 0!==a?a:"",isGlobalStyles:!0}];return(0,s.getBlockTypes)().forEach((t=>{var n;if(null!==(n=e.styles.blocks[t.name])&&void 0!==n&&n.css){var o;const n=c[t.name].selector;m.push({css:ki(null===(o=e.styles.blocks[t.name])||void 0===o?void 0:o.css,n),isGlobalStyles:!0})}})),[m,e.settings,p]}),[n,o,e,r])}const Ei=(0,m.createHigherOrderComponent)((e=>(0,g.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,u.createElement)(e,c({registry:o},r));const[l,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,g.createRegistry)({},o);e.registerStore(So,y_),i(e)}),[o]),l?(0,u.createElement)(g.RegistryProvider,{value:l},(0,u.createElement)(e,c({registry:l},r))):null}))),"withRegistryProvider");const Ci=()=>{};function Si(e){let{clientId:t=null,value:n,selection:o,onChange:r=Ci,onInput:l=Ci}=e;const i=(0,g.useRegistry)(),{resetBlocks:a,resetSelection:c,replaceInnerBlocks:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(E_),{getBlockName:f,getBlocks:h}=i.select(E_),v=(0,g.useSelect)((e=>!t||e(E_).areInnerBlocksControlled(t)),[t]),b=(0,u.useRef)({incoming:null,outgoing:[]}),_=(0,u.useRef)(!1),k=()=>{n&&(m(),t?i.batch((()=>{p(t,!0);const e=n.map((e=>(0,s.cloneBlock)(e)));_.current&&(b.current.incoming=e),m(),d(t,e)})):(_.current&&(b.current.incoming=n),a(n)))},y=(0,u.useRef)(l),E=(0,u.useRef)(r);(0,u.useEffect)((()=>{y.current=l,E.current=r}),[l,r]),(0,u.useEffect)((()=>{b.current.outgoing.includes(n)?b.current.outgoing[b.current.outgoing.length-1]===n&&(b.current.outgoing=[]):h(t)!==n&&(b.current.outgoing=[],k(),o&&c(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,u.useEffect)((()=>{v||(b.current.outgoing=[],k())}),[v]),(0,u.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:s}=i.select(E_);let a=h(t),c=r(),u=!1;_.current=!0;const d=i.subscribe((()=>{if(null!==t&&null===f(t))return;if(!(!t||s(t)))return;const i=r(),d=h(t),p=d!==a;if(a=d,p&&(b.current.incoming||l()))return b.current.incoming=null,void(c=i);if(p||u&&!p&&i&&!c){c=i,b.current.outgoing.push(a);(c?E.current:y.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[i,t])}const wi=Ei((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=__((0,g.useDispatch)(E_));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},o)}),[n]),Si(e),(0,u.createElement)(Ir,null,t)}));var Bi=e=>(0,u.createElement)(wi,c({},e,{stripExperimentalSettings:!0}),e.children);function Ii(e){return(0,g.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(E_),{getBlockType:r,getActiveBlockVariation:l}=t(s.store),i=n(e),a=r(i);if(!a)return null;const c=o(e),u=l(i,c),d=(0,s.isReusableBlock)(a)||(0,s.isTemplatePart)(a),p={isSynced:d,title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{isSynced:d,title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:p}),[e])}function xi(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:r,name:l,reusableBlockTitle:i}=(0,g.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=e(E_),l=n(t);if(!l)return{};const i=(0,s.isReusableBlock)((0,s.getBlockType)(l));return{attributes:o(t),name:l,reusableBlockTitle:i&&r(o(t).ref)}}),[t]),a=Ii(t);if(!l||!a)return null;const c=(0,s.getBlockType)(l),u=c?(0,s.__experimentalGetBlockLabel)(c,r,o):null,d=i||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}var Ti=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Mi=[(0,u.createInterpolateElement)((0,k.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,k.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,k.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,u.createElement)("kbd",null)}),(0,k.__)("Drag files into the editor to automatically insert media blocks."),(0,k.__)("Change a block's type by pressing the block icon on the toolbar.")];var Ni=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*Mi.length));return(0,u.createElement)(h.Tip,null,Mi[e])};var Pi=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Li=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Ri=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var Ai=(0,u.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r,context:l}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Ri});const i=(0,u.createElement)(h.Icon,{icon:n&&n.src?n.src:n,context:l}),s=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,u.createElement)("span",{style:s,className:p()("block-editor-block-icon",r,{"has-colors":o})},i)}));var Oi=function(e){let{title:t,icon:n,description:o,blockType:r,className:l}=e;r&&(W()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r));const{parentNavBlockClientId:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(E_);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:s}=(0,g.useDispatch)(E_);return(0,u.createElement)("div",{className:p()("block-editor-block-card",l)},i&&(0,u.createElement)(h.Button,{onClick:()=>s(i),label:(0,k.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,k.isRTL)()?Pi:Li,isSmall:!0}),(0,u.createElement)(Ai,{icon:n,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-block-card__content"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,u.createElement)("span",{className:"block-editor-block-card__description"},o)))},Di=window.wp.dom;const zi=(0,u.createContext)({});function Fi(e){let{value:t,children:n}=e;const o=(0,u.useContext)(zi),r=(0,u.useMemo)((()=>({...o,...t})),[o,t]);return(0,u.createElement)(zi.Provider,{value:r,children:n})}var Vi=zi;const Hi={};var Gi=(0,h.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,s.getBlockType)(n),r=(0,u.useContext)(Vi),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return o.usesContext.includes(t)}))):Hi),[o,r]);if(!o)return null;const i=o.edit||o.save;if(o.apiVersion>1)return(0,u.createElement)(i,c({},e,{context:l}));const a=(0,s.hasBlockSupport)(o,"className",!0)?(0,s.getBlockDefaultClassName)(n):null,d=p()(a,t.className,e.className);return(0,u.createElement)(i,c({},e,{context:l,className:d}))}));function Ui(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,a={name:t,isSelected:n,clientId:o,layout:(0,s.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,u.createElement)(Ur,{value:(0,u.useMemo)((()=>a),Object.values(a))},(0,u.createElement)(Gi,e))}var $i=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var ji=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,u.createElement)("div",{style:{display:"contents",all:"initial"}},(0,u.createElement)("div",{className:p()(t,"block-editor-warning")},(0,u.createElement)("div",{className:"block-editor-warning__contents"},(0,u.createElement)("p",{className:"block-editor-warning__message"},o),(u.Children.count(n)>0||r)&&(0,u.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(n)>0&&u.Children.map(n,((e,t)=>(0,u.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,u.createElement)(h.DropdownMenu,{className:"block-editor-warning__secondary",icon:$i,label:(0,k.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,u.createElement)(h.MenuGroup,null,r.map(((e,t)=>(0,u.createElement)(h.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Wi=n(1973);function Ki(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,u.createElement)("div",{className:i},(0,u.createElement)("div",{className:"block-editor-block-compare__content"},(0,u.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,u.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,u.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,u.createElement)(u.RawHTML,null,(0,Di.safeHTML)(o)))),(0,u.createElement)("div",{className:"block-editor-block-compare__action"},(0,u.createElement)(h.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var qi=function(e){let{block:t,onKeep:n,onConvert:o,convertor:r,convertButtonText:l}=e;const i=(a=r(t),(Array.isArray(a)?a:[a]).map((e=>(0,s.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var a;const c=(d=t.originalContent,m=i,(0,Wi.Kx)(d,m).map(((e,t)=>{const n=p()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,u.createElement)("span",{key:t,className:n},e.value)})));var d,m;return(0,u.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,u.createElement)(Ki,{title:(0,k.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,k.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,u.createElement)(Ki,{title:(0,k.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:l,rawContent:c,renderedContent:i}))};const Yi=e=>(0,s.rawHandler)({HTML:e.originalContent});var Zi=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(E_).getBlock(n)}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(E_);return{convertToClassic(){o(n.clientId,(e=>(0,s.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,s.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,Yi(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,s.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:r,block:l}=e;const i=!!(0,s.getBlockType)("core/html"),[a,c]=(0,u.useState)(!1),d=(0,u.useCallback)((()=>c(!0)),[]),p=(0,u.useCallback)((()=>c(!1)),[]),m=(0,u.useMemo)((()=>[{title:(0,k._x)("Resolve","imperative verb"),onClick:d},i&&{title:(0,k.__)("Convert to HTML"),onClick:t},{title:(0,k.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(ji,{actions:[(0,u.createElement)(h.Button,{key:"recover",onClick:r,variant:"primary"},(0,k.__)("Attempt Block Recovery"))],secondaryActions:m},(0,k.__)("This block contains unexpected or invalid content.")),a&&(0,u.createElement)(h.Modal,{title:(0,k.__)("Resolve Block"),onRequestClose:p,className:"block-editor-block-compare"},(0,u.createElement)(qi,{block:l,onKeep:t,onConvert:n,convertor:Yi,convertButtonText:(0,k.__)("Convert to Blocks")})))}));const Qi=(0,u.createElement)(ji,{className:"block-editor-block-list__block-crash-warning"},(0,k.__)("This block has encountered an error and cannot be previewed."));var Xi=()=>Qi;class Ji extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var es=Ji,ts=n(773);var ns=function(e){let{clientId:t}=e;const[n,o]=(0,u.useState)(""),r=(0,g.useSelect)((e=>e(E_).getBlock(t)),[t]),{updateBlock:l}=(0,g.useDispatch)(E_);return(0,u.useEffect)((()=>{o((0,s.getBlockContent)(r))}),[r]),(0,u.createElement)(ts.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,s.getBlockType)(r.name);if(!e)return;const i=(0,s.getBlockAttributes)(e,n,r.attributes),a=n||(0,s.getSaveContent)(e,i),[c]=n?(0,s.validateBlock)({...r,attributes:i,originalContent:a}):[!0];l(t,{attributes:i,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let os=_s();const rs=e=>fs(e,os);let ls=_s();rs.write=e=>fs(e,ls);let is=_s();rs.onStart=e=>fs(e,is);let ss=_s();rs.onFrame=e=>fs(e,ss);let as=_s();rs.onFinish=e=>fs(e,as);let cs=[];rs.setTimeout=(e,t)=>{let n=rs.now()+t,o=()=>{let e=cs.findIndex((e=>e.cancel==o));~e&&cs.splice(e,1),ms-=~e?1:0},r={time:n,handler:e,cancel:o};return cs.splice(us(n),0,r),ms+=1,hs(),r};let us=e=>~(~cs.findIndex((t=>t.time>e))||~cs.length);rs.cancel=e=>{is.delete(e),ss.delete(e),as.delete(e),os.delete(e),ls.delete(e)},rs.sync=e=>{gs=!0,rs.batchedUpdates(e),gs=!1},rs.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,rs.onStart(n)}return o.handler=e,o.cancel=()=>{is.delete(n),t=null},o};let ds="undefined"!=typeof window?window.requestAnimationFrame:()=>{};rs.use=e=>ds=e,rs.now="undefined"!=typeof performance?()=>performance.now():Date.now,rs.batchedUpdates=e=>e(),rs.catch=console.error,rs.frameLoop="always",rs.advance=()=>{"demand"!==rs.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):bs()};let ps=-1,ms=0,gs=!1;function fs(e,t){gs?(t.delete(e),e(0)):(t.add(e),hs())}function hs(){ps<0&&(ps=0,"demand"!==rs.frameLoop&&ds(vs))}function vs(){~ps&&(ds(vs),rs.batchedUpdates(bs))}function bs(){let e=ps;ps=rs.now();let t=us(ps);t&&(ks(cs.splice(0,t),(e=>e.handler())),ms-=t),ms?(is.flush(),os.flush(e?Math.min(64,ps-e):16.667),ss.flush(),ls.flush(),as.flush()):ps=-1}function _s(){let e=new Set,t=e;return{add(n){ms+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return ms-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ms-=t.size,ks(t,(t=>t(n)&&e.add(t))),ms+=e.size,t=e)}}}function ks(e,t){e.forEach((e=>{try{t(e)}catch(e){rs.catch(e)}}))}var ys=n(9196),Es=n.n(ys);function Cs(){}const Ss={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function ws(e,t){if(Ss.arr(e)){if(!Ss.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Bs=(e,t)=>e.forEach(t);function Is(e,t,n){if(Ss.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const xs=e=>Ss.und(e)?[]:Ss.arr(e)?e:[e];function Ts(e,t){if(e.size){const n=Array.from(e);e.clear(),Bs(n,t)}}const Ms=(e,...t)=>Ts(e,(e=>e(...t))),Ns=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Ps,Ls,Rs=null,As=!1,Os=Cs;const Ds=e=>{e.to&&(Ls=e.to),e.now&&(rs.now=e.now),void 0!==e.colors&&(Rs=e.colors),null!=e.skipAnimation&&(As=e.skipAnimation),e.createStringInterpolator&&(Ps=e.createStringInterpolator),e.requestAnimationFrame&&rs.use(e.requestAnimationFrame),e.batchedUpdates&&(rs.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Os=e.willAdvance),e.frameLoop&&(rs.frameLoop=e.frameLoop)};var zs=Object.freeze({__proto__:null,get createStringInterpolator(){return Ps},get to(){return Ls},get colors(){return Rs},get skipAnimation(){return As},get willAdvance(){return Os},assign:Ds});const Fs=new Set;let Vs=[],Hs=[],Gs=0;const Us={get idle(){return!Fs.size&&!Vs.length},start(e){Gs>e.priority?(Fs.add(e),rs.onStart($s)):(js(e),rs(Ks))},advance:Ks,sort(e){if(Gs)rs.onFrame((()=>Us.sort(e)));else{const t=Vs.indexOf(e);~t&&(Vs.splice(t,1),Ws(e))}},clear(){Vs=[],Fs.clear()}};function $s(){Fs.forEach(js),Fs.clear(),rs(Ks)}function js(e){Vs.includes(e)||Ws(e)}function Ws(e){Vs.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(Vs,(t=>t.priority>e.priority)),0,e)}function Ks(e){const t=Hs;for(let n=0;n<Vs.length;n++){const o=Vs[n];Gs=o.priority,o.idle||(Os(o),o.advance(e),o.idle||t.push(o))}return Gs=0,Hs=Vs,Hs.length=0,Vs=t,Vs.length>0}const qs="[-+]?\\d*\\.?\\d+",Ys=qs+"%";function Zs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Qs=new RegExp("rgb"+Zs(qs,qs,qs)),Xs=new RegExp("rgba"+Zs(qs,qs,qs,qs)),Js=new RegExp("hsl"+Zs(qs,Ys,Ys)),ea=new RegExp("hsla"+Zs(qs,Ys,Ys,qs)),ta=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,na=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,oa=/^#([0-9a-fA-F]{6})$/,ra=/^#([0-9a-fA-F]{8})$/;function la(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ia(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=la(r,o,e+1/3),i=la(r,o,e),s=la(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function sa(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function aa(e){return(parseFloat(e)%360+360)%360/360}function ca(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ua(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function da(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=oa.exec(e))?parseInt(t[1]+"ff",16)>>>0:Rs&&void 0!==Rs[e]?Rs[e]:(t=Qs.exec(e))?(sa(t[1])<<24|sa(t[2])<<16|sa(t[3])<<8|255)>>>0:(t=Xs.exec(e))?(sa(t[1])<<24|sa(t[2])<<16|sa(t[3])<<8|ca(t[4]))>>>0:(t=ta.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ra.exec(e))?parseInt(t[1],16)>>>0:(t=na.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Js.exec(e))?(255|ia(aa(t[1]),ua(t[2]),ua(t[3])))>>>0:(t=ea.exec(e))?(ia(aa(t[1]),ua(t[2]),ua(t[3]))|ca(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const pa=(e,t,n)=>{if(Ss.fun(e))return e;if(Ss.arr(e))return pa({range:e,output:t,extrapolate:n});if(Ss.str(e.output[0]))return Ps(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}if(o===r)return o;if(t===n)return e<=t?o:r;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o;return c}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};const ma=1.70158,ga=1.525*ma,fa=ma+1,ha=2*Math.PI/3,va=2*Math.PI/4.5,ba=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},_a={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>fa*e*e*e-ma*e*e,easeOutBack:e=>1+fa*Math.pow(e-1,3)+ma*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-ga)/2:(Math.pow(2*e-2,2)*((ga+1)*(2*e-2)+ga)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*ha),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*ha)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*va)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*va)/2+1,easeInBounce:e=>1-ba(1-e),easeOutBounce:ba,easeInOutBounce:e=>e<.5?(1-ba(1-2*e))/2:(1+ba(2*e-1))/2,steps:(e,t="end")=>n=>{const o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}};function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ka.apply(this,arguments)}const ya=Symbol.for("FluidValue.get"),Ea=Symbol.for("FluidValue.observers"),Ca=e=>Boolean(e&&e[ya]),Sa=e=>e&&e[ya]?e[ya]():e,wa=e=>e[Ea]||null;function Ba(e,t){let n=e[Ea];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ia{constructor(e){if(this[ya]=void 0,this[Ea]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");xa(this,e)}}const xa=(e,t)=>Na(e,ya,t);function Ta(e,t){if(e[ya]){let n=e[Ea];n||Na(e,Ea,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ma(e,t){let n=e[Ea];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ea]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Na=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Pa=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,La=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ra=new RegExp(`(${Pa.source})(%|[a-z]+)`,"i"),Aa=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Oa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Da=e=>{const[t,n]=za(e);if(!t||Ns())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){const t=window.getComputedStyle(document.documentElement).getPropertyValue(n);return t||e}return n&&Oa.test(n)?Da(n):n||e},za=e=>{const t=Oa.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Fa;const Va=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Ha=e=>{Fa||(Fa=Rs?new RegExp(`(${Object.keys(Rs).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Sa(e).replace(Oa,Da).replace(La,da).replace(Fa,da))),n=t.map((e=>e.match(Pa).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),r=o.map((t=>pa(ka({},e,{output:t}))));return e=>{var n;const o=!Ra.test(t[0])&&(null==(n=t.find((e=>Ra.test(e))))?void 0:n.replace(Pa,""));let l=0;return t[0].replace(Pa,(()=>`${r[l++](e)}${o||""}`)).replace(Aa,Va)}},Ga="react-spring: ",Ua=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ga}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},$a=Ua(console.warn);const ja=Ua(console.warn);function Wa(e){return Ss.str(e)&&("#"==e[0]||/\d/.test(e)||!Ns()&&Oa.test(e)||e in(Rs||{}))}new WeakMap;new Set;new WeakMap,new WeakMap,new WeakMap;const Ka=Ns()?ys.useEffect:ys.useLayoutEffect;function qa(){const e=(0,ys.useState)()[1],t=(()=>{const e=(0,ys.useRef)(!1);return Ka((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ya=e=>(0,ys.useEffect)(e,Za),Za=[];function Qa(e){const t=(0,ys.useRef)();return(0,ys.useEffect)((()=>{t.current=e})),t.current}const Xa=Symbol.for("Animated:node"),Ja=e=>e&&e[Xa],ec=(e,t)=>{return n=e,o=Xa,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},tc=e=>e&&e[Xa]&&e[Xa].getPayload();class nc{constructor(){this.payload=void 0,ec(this,this)}getPayload(){return this.payload||[]}}class oc extends nc{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Ss.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new oc(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ss.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Ss.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class rc extends oc{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=pa({output:[e,e]})}static create(e){return new rc(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Ss.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=pa({output:[this.getValue(),e]})),this._value=0,super.reset()}}const lc={dependencies:null};class ic extends nc{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Is(this.source,((n,o)=>{var r;(r=n)&&r[Xa]===r?t[o]=n.getValue(e):Ca(n)?t[o]=Sa(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Bs(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Is(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){lc.dependencies&&Ca(e)&&lc.dependencies.add(e);const t=tc(e);t&&Bs(t,(e=>this.add(e)))}}class sc extends ic{constructor(e){super(e)}static create(e){return new sc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(ac)),!0)}}function ac(e){return(Wa(e)?rc:oc).create(e)}function cc(e){const t=Ja(e);return t?t.constructor:Ss.arr(e)?sc:Wa(e)?rc:oc}function uc(){return uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},uc.apply(this,arguments)}const dc=(e,t)=>{const n=!Ss.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,ys.forwardRef)(((o,r)=>{const l=(0,ys.useRef)(null),i=n&&(0,ys.useCallback)((e=>{l.current=function(e,t){e&&(Ss.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;lc.dependencies=n,e.style&&(e=uc({},e,{style:t.createAnimatedStyle(e.style)}));return e=new ic(e),lc.dependencies=null,[e,n]}(o,t),c=qa(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new pc(u,a),p=(0,ys.useRef)();Ka((()=>(p.current=d,Bs(a,(e=>Ta(e,d))),()=>{p.current&&(Bs(p.current.deps,(e=>Ma(e,p.current))),rs.cancel(p.current.update))}))),(0,ys.useEffect)(u,[]),Ya((()=>()=>{const e=p.current;Bs(e.deps,(t=>Ma(t,e)))}));const m=t.getComponentProps(s.getValue());return ys.createElement(e,uc({},m,{ref:i}))}))};class pc{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&rs.write(this.update)}}const mc=Symbol.for("AnimatedComponent"),gc=e=>Ss.str(e)?e:e&&Ss.str(e.displayName)?e.displayName:Ss.fun(e)&&e.name||null;function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},fc.apply(this,arguments)}function hc(e,...t){return Ss.fun(e)?e(...t):e}const vc=(e,t)=>!0===e||!!(t&&e&&(Ss.fun(e)?e(t):xs(e).includes(t))),bc=(e,t)=>Ss.obj(e)?t&&e[t]:e,_c=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,kc=e=>e,yc=(e,t=kc)=>{let n=Ec;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Ss.und(n)||(o[r]=n)}return o},Ec=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Cc={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Sc(e){const t=function(e){const t={};let n=0;if(Is(e,((e,o)=>{Cc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Is(e,((e,o)=>o in t||(n[o]=e))),n}return fc({},e)}function wc(e){return e=Sa(e),Ss.arr(e)?e.map(wc):Wa(e)?zs.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Bc(e){for(const t in e)return!0;return!1}function Ic(e){return Ss.fun(e)||Ss.arr(e)&&Ss.obj(e[0])}function xc(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Tc(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Mc=fc({},{tension:170,friction:26},{mass:1,damping:1,easing:_a.linear,clamp:!1});class Nc{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Mc)}}function Pc(e,t){if(Ss.und(t.decay)){const n=!Ss.und(t.tension)||!Ss.und(t.friction);!n&&Ss.und(t.frequency)&&Ss.und(t.damping)&&Ss.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Lc=[];class Rc{constructor(){this.changed=!1,this.values=Lc,this.toValues=null,this.fromValues=Lc,this.to=void 0,this.from=void 0,this.config=new Nc,this.immediate=!1}}function Ac(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=vc(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Ss.und(n.pause)||(r.paused=vc(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||vc(e,t)),c=hc(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-rs.now()}function m(){c>0&&!zs.skipAnimation?(r.delayed=!0,u=rs.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(fc({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Oc=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Fc(e.get()):t.every((e=>e.noop))?Dc(e.get()):zc(e.get(),t.every((e=>e.finished))),Dc=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),zc=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Fc=e=>({value:e,cancelled:!0,finished:!1});function Vc(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=yc(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Fc(o)||r!==n.asyncId&&zc(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Gc,i=new Uc;return(async()=>{if(zs.skipAnimation)throw Hc(n),i.result=zc(o,!1),d(i),i;m(l);const s=Ss.obj(e)?fc({},e):fc({},t,{to:e});s.parentId=r,Is(c,((e,t)=>{Ss.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let f;if(zs.skipAnimation)return Hc(n),zc(o,!1);try{let t;t=Ss.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),f=zc(o.get(),!0,!1)}catch(e){if(e instanceof Gc)f=e.result;else{if(!(e instanceof Uc))throw e;f=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Ss.fun(i)&&rs.batchedUpdates((()=>{i(f,o,o.item)})),f})():a}function Hc(e,t){Ts(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Gc extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Uc extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const $c=e=>e instanceof Wc;let jc=1;class Wc extends Ia{constructor(...e){super(...e),this.id=jc++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Ja(this);return e&&e.getValue()}to(...e){return zs.to(this,e)}interpolate(...e){return $a(`${Ga}The "interpolate" function is deprecated in v9 (use "to" instead)`),zs.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ba(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Us.sort(this),Ba(this,{type:"priority",parent:this,priority:e})}}const Kc=Symbol.for("SpringPhase"),qc=e=>(1&e[Kc])>0,Yc=e=>(2&e[Kc])>0,Zc=e=>(4&e[Kc])>0,Qc=(e,t)=>t?e[Kc]|=3:e[Kc]&=-3,Xc=(e,t)=>t?e[Kc]|=4:e[Kc]&=-5;class Jc extends Wc{constructor(e,t){if(super(),this.key=void 0,this.animation=new Rc,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ss.und(e)||!Ss.und(t)){const n=Ss.obj(e)?fc({},e):fc({},t,{from:e});Ss.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Yc(this)||this._state.asyncTo)||Zc(this)}get goal(){return Sa(this.animation.to)}get velocity(){const e=Ja(this);return e instanceof oc?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return qc(this)}get isAnimating(){return Yc(this)}get isPaused(){return Zc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=tc(o.to);!i&&Ca(o.to)&&(l=xs(Sa(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==rc?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Ss.arr(r.velocity)?r.velocity[a]:r.velocity;let i;const p=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(Ss.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.restVelocity||p/10,o=r.clamp?0:r.bounce,a=!Ss.und(o),m=n==c?s.v0>0:n<c;let g,f=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(g=Math.abs(i)>t,g||(u=Math.abs(c-d)<=p,!u));++e){a&&(f=d==c||d>c==m,f&&(i=-i*o,d=c));i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=Ja(this),a=s.getValue();if(t){const e=Sa(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return rs.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Yc(this)){const{to:e,config:t}=this.animation;rs.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ss.und(e)?(n=this.queue||[],this.queue=[]):n=[Ss.obj(e)?e:fc({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Oc(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Hc(this._state,e&&this._lastCallId),rs.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Ss.obj(n)?n[t]:n,(null==n||Ic(n))&&(n=void 0),o=Ss.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return qc(this)||(e.reverse&&([n,o]=[o,n]),o=Sa(o),Ss.und(o)?Ja(this)||this._set(n):this._set(o)),r}_update(e,t){let n=fc({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,yc(n,((e,t)=>/^on/.test(t)?bc(e,o):e))),iu(this,n,"onProps"),su(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Ac(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{Zc(this)||(Xc(this,!0),Ms(i.pauseQueue),su(this,"onPause",zc(this,eu(this,this.animation.to)),this))},resume:()=>{Zc(this)&&(Xc(this,!1),Yc(this)&&this._resume(),Ms(i.resumeQueue),su(this,"onResume",zc(this,eu(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=tu(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Fc(this));const o=!Ss.und(e.to),r=!Ss.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Fc(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Ss.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!ws(d,c);p&&(s.from=d),d=Sa(d);const m=!ws(u,a);m&&this._focus(u);const g=Ic(t.to),{config:f}=s,{decay:h,velocity:v}=f;(o||r)&&(f.velocity=0),t.config&&!g&&function(e,t,n){n&&(Pc(n=fc({},n),t),t=fc({},n,t)),Pc(e,t),Object.assign(e,t);for(const t in Mc)null==e[t]&&(e[t]=Mc[t]);let{mass:o,frequency:r,damping:l}=e;Ss.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(f,hc(t.config,l),t.config!==i.config?hc(i.config,l):void 0);let b=Ja(this);if(!b||Ss.und(u))return n(zc(this,!0));const _=Ss.und(t.reset)?r&&!t.default:!Ss.und(d)&&vc(t.reset,l),k=_?d:this.get(),y=wc(u),E=Ss.num(y)||Ss.arr(y)||Wa(y),C=!g&&(!E||vc(i.immediate||t.immediate,l));if(m){const e=cc(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Ca(u),B=!1;if(!w){const e=_||!qc(this)&&p;(m||e)&&(B=ws(wc(k),y),w=!B),(ws(s.immediate,C)||C)&&ws(f.decay,h)&&ws(f.velocity,v)||(w=!0)}if(B&&Yc(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||Ca(a))&&(s.values=b.getPayload(),s.toValues=Ca(u)?null:S==rc?[1]:xs(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Bs(lu,(e=>iu(this,t,e)));const o=zc(this,eu(this,a));Ms(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&rs.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?hc(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(Vc(t.to,t,this._state,this)):w?this._start():Yc(this)&&!m?this._pendingCalls.add(n):n(Dc(k))}_focus(e){const t=this.animation;e!==t.to&&(wa(this)&&this._detach(),t.to=e,wa(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ca(t)&&(Ta(t,this),$c(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ca(e)&&Ma(e,this)}_set(e,t=!0){const n=Sa(e);if(!Ss.und(n)){const e=Ja(this);if(!e||!ws(n,e.getValue())){const o=cc(n);e&&e.constructor==o?e.setValue(n):ec(this,o.create(n)),e&&rs.batchedUpdates((()=>{this._onChange(n,t)}))}}return Ja(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,su(this,"onStart",zc(this,eu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),hc(this.animation.onChange,e,this)),hc(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Ja(this).reset(Sa(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Yc(this)||(Qc(this,!0),Zc(this)||this._resume())}_resume(){zs.skipAnimation?this.finish():Us.start(this)}_stop(e,t){if(Yc(this)){Qc(this,!1);const n=this.animation;Bs(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ba(this,{type:"idle",parent:this});const o=t?Fc(this.get()):zc(this.get(),eu(this,null!=e?e:n.to));Ms(this._pendingCalls,o),n.changed&&(n.changed=!1,su(this,"onRest",o,this))}}}function eu(e,t){const n=wc(t);return ws(wc(e.get()),n)}function tu(e,t=e.loop,n=e.to){let o=hc(t);if(o){const r=!0!==o&&Sc(o),l=(r||e).reverse,i=!r||r.reset;return nu(fc({},e,{loop:t,default:!1,pause:void 0,to:!l||Ic(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function nu(e){const{to:t,from:n}=e=Sc(e),o=new Set;return Ss.obj(t)&&ru(t,o),Ss.obj(n)&&ru(n,o),e.keys=o.size?Array.from(o):null,e}function ou(e){const t=nu(e);return Ss.und(t.default)&&(t.default=yc(t)),t}function ru(e,t){Is(e,((e,n)=>null!=e&&t.add(n)))}const lu=["onStart","onRest","onChange","onPause","onResume"];function iu(e,t,n){e.animation[n]=t[n]!==_c(t,n)?bc(t[n],e.key):void 0}function su(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const au=["onStart","onChange","onRest"];let cu=1;class uu{constructor(e,t){this.id=cu++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(fc({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Ss.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(nu(e)),this}start(e){let{queue:t}=this;return e?t=xs(e).map(nu):this.queue=[],this._flush?this._flush(this,t):(vu(this,t),du(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Bs(xs(t),(t=>n[t].stop(!!e)))}else Hc(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Ss.und(e))this.start({pause:!0});else{const t=this.springs;Bs(xs(e),(e=>t[e].pause()))}return this}resume(e){if(Ss.und(e))this.start({pause:!1});else{const t=this.springs;Bs(xs(e),(e=>t[e].resume()))}return this}each(e){Is(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Ts(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&Ts(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Ts(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}rs.onFrame(this._onFrame)}}function du(e,t){return Promise.all(t.map((t=>pu(e,t)))).then((t=>Oc(e,t)))}async function pu(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Ss.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Ss.arr(r)||Ss.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Bs(au,(n=>{const o=t[n];if(Ss.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Ms(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===_c(t,"cancel");(u||m&&d.asyncId)&&p.push(Ac(++e._lastAsyncId,{props:t,state:d,actions:{pause:Cs,resume:Cs,start(t,n){m?(Hc(d,e._lastAsyncId),n(Fc(e))):(t.onRest=s,n(Vc(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Oc(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=tu(t,i,r);if(n)return vu(e,[n]),pu(e,n,!0)}return a&&rs.batchedUpdates((()=>a(g,e,e.item))),g}function mu(e,t){const n=fc({},e.springs);return t&&Bs(xs(t),(e=>{Ss.und(e.keys)&&(e=nu(e)),Ss.obj(e.to)||(e=fc({},e,{to:void 0})),hu(n,e,(e=>fu(e)))})),gu(e,n),n}function gu(e,t){Is(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ta(t,e))}))}function fu(e,t){const n=new Jc;return n.key=e,t&&Ta(n,t),n}function hu(e,t,n){t.keys&&Bs(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function vu(e,t){Bs(t,(t=>{hu(e.springs,t,(t=>fu(t,e)))}))}function bu(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const _u=["children"],ku=e=>{let{children:t}=e,n=bu(e,_u);const o=(0,ys.useContext)(yu),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,ys.useState)((()=>({inputs:t,result:e()}))),o=(0,ys.useRef)(),r=o.current;let l=r;if(l){const n=Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,ys.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=yu;return ys.createElement(i,{value:n},t)},yu=(Eu=ku,Cu={},Object.assign(Eu,ys.createContext(Cu)),Eu.Provider._context=Eu,Eu.Consumer._context=Eu,Eu);var Eu,Cu;ku.Provider=yu.Provider,ku.Consumer=yu.Consumer;const Su=()=>{const e=[],t=function(t){ja(`${Ga}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Bs(e,((e,r)=>{if(Ss.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Bs(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Bs(e,(e=>e.resume(...arguments))),this},t.set=function(t){Bs(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Bs(e,((e,o)=>{if(Ss.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Bs(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Bs(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Ss.fun(e)?e(n,t):e};return t._getProps=n,t};function wu(e,t,n){const o=Ss.fun(t)&&t;o&&!n&&(n=[]);const r=(0,ys.useMemo)((()=>o||3==arguments.length?Su():void 0),[]),l=(0,ys.useRef)(0),i=qa(),s=(0,ys.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=mu(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?du(e,t):new Promise((o=>{gu(e,n),s.queue.push((()=>{o(du(e,t))})),i()}))}})),[]),a=(0,ys.useRef)([...s.ctrls]),c=[],u=Qa(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new uu(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=ou(n))}}(0,ys.useMemo)((()=>{Bs(a.current.slice(e,u),(e=>{xc(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,ys.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>mu(e,c[t]))),m=(0,ys.useContext)(ku),g=Qa(m),f=m!==g&&Bc(m);Ka((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Bs(e,(e=>e()))),Bs(a.current,((e,t)=>{null==r||r.add(e),f&&e.start({default:m});const n=c[t];n&&(Tc(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ya((()=>()=>{Bs(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>fc({},e)));return r?[h,r]:h}function Bu(e,t){const n=Ss.fun(e),[[o],r]=wu(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let Iu;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Iu||(Iu={}));class xu extends Wc{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=pa(...t);const n=this._get(),o=cc(n);ec(this,o.create(n))}advance(e){const t=this._get();ws(t,this.get())||(Ja(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Mu(this._active)&&Nu(this)}_get(){const e=Ss.arr(this.source)?this.source.map(Sa):xs(Sa(this.source));return this.calc(...e)}_start(){this.idle&&!Mu(this._active)&&(this.idle=!1,Bs(tc(this),(e=>{e.done=!1})),zs.skipAnimation?(rs.batchedUpdates((()=>this.advance())),Nu(this)):Us.start(this))}_attach(){let e=1;Bs(xs(this.source),(t=>{Ca(t)&&Ta(t,this),$c(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Bs(xs(this.source),(e=>{Ca(e)&&Ma(e,this)})),this._active.clear(),Nu(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=xs(this.source).reduce(((e,t)=>Math.max(e,($c(t)?t.priority:0)+1)),0))}}function Tu(e){return!1!==e.idle}function Mu(e){return!e.size||Array.from(e).every(Tu)}function Nu(e){e.idle||(e.idle=!0,Bs(tc(e),(e=>{e.done=!0})),Ba(e,{type:"idle",parent:e}))}zs.assign({createStringInterpolator:Ha,to:(e,t)=>new xu(e,t)});Us.advance;var Pu=window.ReactDOM;function Lu(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const Ru=["style","children","scrollTop","scrollLeft","viewBox"],Au=/^--/;function Ou(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Au.test(e)||zu.hasOwnProperty(e)&&zu[e]?(""+t).trim():t+"px"}const Du={};let zu={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Fu=["Webkit","Ms","Moz","O"];zu=Object.keys(zu).reduce(((e,t)=>(Fu.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),zu);const Vu=["x","y","z"],Hu=/^(matrix|translate|scale|rotate|skew)/,Gu=/^(translate)/,Uu=/^(rotate|skew)/,$u=(e,t)=>Ss.num(e)&&0!==e?e+t:e,ju=(e,t)=>Ss.arr(e)?e.every((e=>ju(e,t))):Ss.num(e)?e===t:parseFloat(e)===t;class Wu extends ic{constructor(e){let{x:t,y:n,z:o}=e,r=Lu(e,Vu);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>$u(e,"px"))).join(",")})`,ju(e,0)]))),Is(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Hu.test(t)){if(delete r[t],Ss.und(e))return;const n=Gu.test(t)?"px":Uu.test(t)?"deg":"";l.push(xs(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${$u(r,n)})`,ju(r,0)]:e=>[`${t}(${e.map((e=>$u(e,n))).join(",")})`,ju(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ku(l,i)),super(r)}}class Ku extends Ia{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Bs(this.inputs,((n,o)=>{const r=Sa(n[0]),[l,i]=this.transforms[o](Ss.arr(r)?r:n.map(Sa));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Bs(this.inputs,(e=>Bs(e,(e=>Ca(e)&&Ta(e,this)))))}observerRemoved(e){0==e&&Bs(this.inputs,(e=>Bs(e,(e=>Ca(e)&&Ma(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ba(this,e)}}const qu=["scrollTop","scrollLeft"];zs.assign({batchedUpdates:Pu.unstable_batchedUpdates,createStringInterpolator:Ha,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const Yu=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ic(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=gc(e)||"Anonymous";return(e=Ss.str(e)?l[e]||(l[e]=dc(e,r)):e[mc]||(e[mc]=dc(e,r))).displayName=`Animated(${t})`,e};return Is(e,((t,n)=>{Ss.arr(e)&&(n=gc(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s,viewBox:a}=o,c=Lu(o,Ru),u=Object.values(c),d=Object.keys(c).map((t=>n||e.hasAttribute(t)?t:Du[t]||(Du[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Ou(t,r[t]);Au.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach(((t,n)=>{e.setAttribute(t,u[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new Wu(e),getComponentProps:e=>Lu(e,qu)}),Zu=Yu.animated,Qu=e=>e+1,Xu=e=>({top:e.offsetTop,left:e.offsetLeft});var Ju=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,u.useRef)(),i=(0,m.useReducedMotion)()||!o,[s,a]=(0,u.useReducer)(Qu,0),[c,d]=(0,u.useReducer)(Qu,0),[p,g]=(0,u.useState)({x:0,y:0}),f=(0,u.useMemo)((()=>l.current?Xu(l.current):null),[r]),h=(0,u.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Di.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);return(0,u.useLayoutEffect)((()=>{s&&d()}),[s]),(0,u.useLayoutEffect)((()=>{if(!f)return;if(i)return void h();l.current.style.transform=void 0;const e=Xu(l.current);a(),g({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[r]),Bu({from:{x:p.x,y:p.y},to:{x:0,y:0},reset:s!==c,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:function(e){let{value:n}=e;if(!l.current)return;let{x:o,y:r}=n;o=Math.round(o),r=Math.round(r);const i=0===o&&0===r;l.current.style.transformOrigin="center center",l.current.style.transform=i?void 0:`translate3d(${o}px,${r}px,0)`,l.current.style.zIndex=t?"1":"",h()}}),l};const ed=".block-editor-block-list__block",td=".block-list-appender",nd=".block-editor-button-block-appender";function od(e,t){return t.closest([ed,td,nd].join(","))===e}function rd(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ed);return t?t.id.slice("block-".length):void 0}function ld(e){const t=(0,u.useRef)(),n=function(e){return(0,g.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(E_);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,g.useSelect)(E_);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(od(t.current,l.activeElement))return;const i=Di.focus.tabbable.find(t.current).filter((e=>(0,Di.isTextField)(e))),s=-1===n,a=i[s?i.length-1:0]||t.current;if(od(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Di.focus.tabbable.findNext(t.current);if(e&&od(t.current,e)&&(0,Di.isFormElement)(e))return void e.focus()}(0,Di.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function id(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function sd(){const e=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return t().outlineMode}),[]);return(0,m.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",id),t.addEventListener("mouseover",id),()=>{t.removeEventListener("mouseout",id),t.removeEventListener("mouseover",id),t.classList.remove("is-hovered")}}),[e])}function ad(e){return(0,g.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:a,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:d,__unstableSelectionHasUnmergeableBlock:m}=t(E_),{outlineMode:g}=a(),f=n(e),h=r(e),v=i(e),b=c(e,!0),_=l(e);return p()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!d()&&!m(),"is-reusable":(0,s.isReusableBlock)((0,s.getBlockType)(v)),"is-dragging":f,"has-child-selected":b,"remove-outline":h&&g&&u()})}),[e])}function cd(e){return(0,g.useSelect)((t=>{const n=t(E_).getBlockName(e),o=(0,s.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,s.getBlockDefaultClassName)(n)}),[e])}function ud(e){return(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(E_),r=o(e);if(null==r||!r.className)return;const l=(0,s.getBlockType)(n(e));return(null==l?void 0:l.apiVersion)>1?r.className:void 0}),[e])}function dd(e){return(0,g.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(E_);if(!i(e))return;const s=n();return s?p()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function pd(e){const{isBlockSelected:t}=(0,g.useSelect)(E_),{selectBlock:n,selectionChange:o}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):od(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var md=window.wp.keycodes;function gd(e){const t=(0,g.useSelect)((t=>t(E_).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,g.useSelect)(E_),{insertDefaultBlock:r,removeBlock:l}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==md.ENTER&&s!==md.BACKSPACE&&s!==md.DELETE||a!==i||(0,Di.isTextField)(a)||(t.preventDefault(),s===md.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function fd(e){const{isNavigationMode:t,isBlockSelected:n}=(0,g.useSelect)(E_),{setNavigationMode:o,selectBlock:r}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function hd(){const e=(0,u.useContext)(yf);return(0,m.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function vd(e){return(0,g.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(E_);return n(e)}),[e])}function bd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,u.useContext)(up),{index:i,mode:a,name:c,blockApiVersion:d,blockTitle:f,isPartOfSelection:h,adjustScrolling:v,enableAnimation:b}=(0,g.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:a,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p}=e(E_),{getActiveBlockVariation:m}=e(s.store),g=c(n),f=u(n)||d(n),h=l(n),v=(0,s.getBlockType)(h),b=m(h,t(n));return{index:o(n),mode:r(n),name:h,blockApiVersion:(null==v?void 0:v.apiVersion)||1,blockTitle:(null==b?void 0:b.title)||(null==v?void 0:v.title),isPartOfSelection:g||f,adjustScrolling:g||p(n),enableAnimation:!i()&&a()<=200}}),[n]),_=vd(n),y=(0,k.sprintf)((0,k.__)("Block: %s"),f),E="html"!==a||t?"":"-visual",C=(0,m.useMergeRefs)([e.ref,ld(n),xr(n),pd(n),gd(n),fd(n),sd(),hd(),Ju({isSelected:h,adjustScrolling:v,enableAnimation:b,triggerAnimationOnChange:i}),(0,m.useDisabled)({isDisabled:!_})]),S=$r();return d<2&&n===S.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...r,...e,ref:C,id:`block-${n}${E}`,role:"document","aria-label":y,"data-block":n,"data-type":c,"data-title":f,className:p()(p()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":_}),o,e.className,r.className,ad(n),cd(n),ud(n),dd(n)),style:{...r.style,...e.style}}}bd.save=s.__unstableGetBlockProps;var _d=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var kd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var yd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var Ed=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var Cd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var Sd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var wd=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));function Bd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Id(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${Bd(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function xd(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(o.none=(0,k.sprintf)((0,k.__)("Max %s wide"),t)),r.test(n)&&(o.wide=(0,k.sprintf)((0,k.__)("Max %s wide"),n)),o}const Td=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Md=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Nd=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Pd=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Ld=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Rd={top:{icon:Nd,title:(0,k._x)("Align top","Block vertical alignment setting")},center:{icon:Md,title:(0,k._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Td,title:(0,k._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Pd,title:(0,k._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Ld,title:(0,k._x)("Space between","Block vertical alignment setting")}},Ad=["top","center","bottom"];var Od=function(e){let{value:t,onChange:n,controls:o=Ad,isCollapsed:r=!0,isToolbar:l}=e;const i=Rd[t],s=Rd.top,a=l?h.ToolbarGroup:h.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{popoverProps:{variant:"toolbar"}};return(0,u.createElement)(a,c({icon:i?i.icon:s.icon,label:(0,k._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Rd[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const Dd=e=>(0,u.createElement)(Od,c({},e,{isToolbar:!1})),zd=e=>(0,u.createElement)(Od,c({},e,{isToolbar:!0})),Fd={left:_d,center:kd,right:yd,"space-between":Ed,stretch:Cd};var Vd=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:i}=e;const s=e=>{o(e===r?void 0:e)},a=r?Fd[r]:Fd.left,d=[{name:"left",icon:_d,title:(0,k.__)("Justify items left"),isActive:"left"===r,onClick:()=>s("left")},{name:"center",icon:kd,title:(0,k.__)("Justify items center"),isActive:"center"===r,onClick:()=>s("center")},{name:"right",icon:yd,title:(0,k.__)("Justify items right"),isActive:"right"===r,onClick:()=>s("right")},{name:"space-between",icon:Ed,title:(0,k.__)("Space between items"),isActive:"space-between"===r,onClick:()=>s("space-between")},{name:"stretch",icon:Cd,title:(0,k.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>s("stretch")}],p=i?h.ToolbarGroup:h.ToolbarDropdownMenu,m=i?{isCollapsed:n}:{};return(0,u.createElement)(p,c({icon:a,popoverProps:l,label:(0,k.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},m))};const Hd=e=>(0,u.createElement)(Vd,c({},e,{isToolbar:!1})),Gd=e=>(0,u.createElement)(Vd,c({},e,{isToolbar:!0})),Ud={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},$d={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jd={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Wd=["wrap","nowrap"];var Kd={name:"flex",label:(0,k.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Flex,null,(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Yd,{layout:t,onChange:n})),(0,u.createElement)(h.FlexItem,null,r&&(0,u.createElement)(Qd,{layout:t,onChange:n}))),(0,u.createElement)(Zd,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,u.createElement)(x_,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(Yd,{layout:t,onChange:n,isToolbar:!0}),r&&(0,u.createElement)(qd,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!_l(i,"spacing","blockGap")?ii(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ud[r.justifyContent],p=Wd.includes(r.flexWrap)?r.flexWrap:"wrap",m=jd[r.verticalAlignment],g=$d[r.justifyContent]||$d.left;let f="";const h=[];return p&&"wrap"!==p&&h.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&h.push(`align-items: ${m}`),d&&h.push(`justify-content: ${d}`)):(m&&h.push(`justify-content: ${m}`),h.push("flex-direction: column"),h.push(`align-items: ${g}`)),h.length&&(f=`${Bd(o)} {\n\t\t\t\t${h.join("; ")};\n\t\t\t}`),s&&u&&(f+=Id(o,a,"flex",u)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function qd(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{orientation:r="horizontal"}=t,l="horizontal"===r?jd.center:jd.top,{verticalAlignment:i=l}=t,s=e=>{n({...t,verticalAlignment:e})};if(o)return(0,u.createElement)(Dd,{onChange:s,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,k.__)("Align items top")},{value:"center",label:(0,k.__)("Align items center")},{value:"flex-end",label:(0,k.__)("Align items bottom")}];return(0,u.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,u.createElement)("legend",null,(0,k.__)("Vertical alignment")),(0,u.createElement)("div",null,a.map(((e,t,n)=>(0,u.createElement)(h.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>s(e)})))))}function Yd(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},s=["left","center","right"];if("horizontal"===l?s.push("space-between"):s.push("stretch"),o)return(0,u.createElement)(Hd,{allowedControls:s,value:r,onChange:i,popoverProps:{position:"bottom right",variant:"toolbar"}});const a=[{value:"left",icon:_d,label:(0,k.__)("Justify items left")},{value:"center",icon:kd,label:(0,k.__)("Justify items center")},{value:"right",icon:yd,label:(0,k.__)("Justify items right")}];return"horizontal"===l?a.push({value:"space-between",icon:Ed,label:(0,k.__)("Space between items")}):a.push({value:"stretch",icon:Cd,label:(0,k.__)("Stretch items")}),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})})))}function Zd(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,u.createElement)(h.ToggleControl,{label:(0,k.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Qd(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal",verticalAlignment:r,justifyContent:l}=t;return(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,k.__)("Orientation"),value:o,onChange:e=>{let o=r,i=l;return"horizontal"===e?("space-between"===r&&(o="center"),"stretch"===l&&(i="left")):("stretch"===r&&(o="top"),"space-between"===l&&(i="left")),n({...t,orientation:e,verticalAlignment:o,justifyContent:i})}},(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:Sd,value:"horizontal",label:(0,k.__)("Horizontal")}),(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{icon:wd,value:"vertical",label:(0,k.__)("Vertical")}))}var Xd={name:"default",label:(0,k.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const s=ii(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap);let a="";_l(r,"spacing","blockGap")||(null!=s&&s.top?a=ii(null==s?void 0:s.top):"string"==typeof s&&(a=ii(s)));let c="";return l&&a&&(c+=Id(n,i,"default",a)),c},getOrientation(){return"vertical"},getAlignments(e){const t=xd(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const n=[{name:"left"},{name:"center"},{name:"right"}];return n.unshift({name:"none",info:t.none}),n}};var Jd=function(e){let{icon:t,size:n=24,...o}=e;return(0,u.cloneElement)(t,{width:n,height:n,...o})};var ep=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var tp=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),np={name:"constrained",label:(0,k.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r,justifyContent:l="center"}=t,i=[{value:"left",icon:_d,label:(0,k.__)("Justify items left")},{value:"center",icon:kd,label:(0,k.__)("Justify items center")},{value:"right",icon:yd,label:(0,k.__)("Justify items right")}],s=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vw"]});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,k.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:s}),(0,u.createElement)(Jd,{icon:ep})),(0,u.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,u.createElement)(h.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,k.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:s}),(0,u.createElement)(Jd,{icon:tp}))),(0,u.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,k.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,u.createElement)(h.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Justification"),value:l,onChange:e=>{n({...t,justifyContent:e})}},i.map((e=>{let{value:t,icon:n,label:o}=e;return(0,u.createElement)(h.__experimentalToggleGroupControlOptionIcon,{key:t,value:t,icon:n,label:o})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u,justifyContent:d}=r,p=ii(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap);let m="";_l(i,"spacing","blockGap")||(null!=p&&p.top?m=ii(null==p?void 0:p.top):"string"==typeof p&&(m=ii(p)));const g="left"===d?"0 !important":"auto !important",f="right"===d?"0 !important":"auto !important";let h=c||u?`\n\t\t\t\t\t${Bd(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${g};\n\t\t\t\t\t\tmargin-right: ${f};\n\t\t\t\t\t}\n\t\t\t\t\t${Bd(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${Bd(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===d?h+=`${Bd(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${g}; }`:"right"===d&&(h+=`${Bd(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${f}; }`),null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding){(0,jo.getCSSRules)(l).forEach((e=>{"paddingRight"===e.key?h+=`\n\t\t\t\t\t${Bd(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(h+=`\n\t\t\t\t\t${Bd(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return s&&m&&(h+=Id(o,a,"constrained",m)),h},getOrientation(){return"vertical"},getAlignments(e){const t=xd(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const op=[Xd,Kd,np];function rp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return op.find((t=>t.name===e))}const lp={type:"default"},ip=(0,u.createContext)(lp),sp=ip.Provider;function ap(){return(0,u.useContext)(ip)}function cp(e){let{layout:t={},css:n,...o}=e;const r=rp(t.type),l=null!==qr("spacing.blockGap");if(r){var i;if(n)return(0,u.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,u.createElement)("style",null,e)}return null}const up=(0,u.createContext)();function dp(e){let{children:t,isHtml:n,...o}=e;return(0,u.createElement)("div",bd(o,{__unstableIsHtml:n}),t)}const pp=(0,g.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(E_),d=a(n),p=r(n),m=s(o),g=c(n,o),f=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:f,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),mp=(0,g.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(E_);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(E_),l=r(),{clientId:i}=t,s=l.length?l:[i];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(E_),s=i(o);r(e,s+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:a,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:g,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:v,canInsertBlockType:b}=n.select(E_);function _(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const o=v(e),l=f(e),[i]=l;if(1===l.length&&(0,s.isUnmodifiedBlock)(p(i)))d(e);else{if(b(g(i),o))u([i],e,o,h(e));else{const l=(0,s.switchToBlockType)(p(i),(0,s.getDefaultBlockName)());l&&l.length&&n.batch((()=>{r(l,h(e),o,t),d(i,!1)}))}!f(e).length&&(0,s.isUnmodifiedBlock)(p(e))&&d(e,!1)}}if(e){if(i){const e=c(i);if(e){if(g(i)!==g(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;f(e).length?_(e,!1):l(o,e)}else{const e=a(o);if(e)l(e,o);else if(i){const e=a(i);if(e&&g(i)===g(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(i),i,e),d(i,!1)}))}_(i)}}},onReplace(e,n,o){e.length&&!(0,s.isUnmodifiedDefaultBlock)(e[e.length-1])&&c(),i([t.clientId],e,n,o)},toggleSelection(e){a(e)}}}));var gp=(0,m.compose)(m.pure,pp,mp,(0,m.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,h.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:r,canRemove:l,clientId:i,isSelected:a,isSelectionEnabled:c,className:d,__unstableLayoutClassNames:m,name:f,isValid:h,attributes:v,wrapperProps:b,setAttributes:_,onReplace:k,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const{themeSupportsLayout:S,hasContentLockedParent:w,isContentBlock:B,isContentLocking:I,isTemporarilyEditingAsBlocks:x}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(E_),l=!!n(i);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(s.store).__experimentalHasContentRoleAttribute(f),hasContentLockedParent:l,isContentLocking:"contentOnly"===o(i)&&!l,isTemporarilyEditingAsBlocks:r()===i}}),[f,i]),{removeBlock:T}=(0,g.useDispatch)(E_),M=(0,u.useCallback)((()=>T(i)),[i]),N=ap()||{};let P=(0,u.createElement)(Ui,{name:f,isSelected:a,attributes:v,setAttributes:_,insertBlocksAfter:r?void 0:y,onReplace:l?k:void 0,onRemove:l?M:void 0,mergeBlocks:l?E:void 0,clientId:i,isSelectionEnabled:c,toggleSelection:C,__unstableLayoutClassNames:m,__unstableParentLayout:Object.keys(N).length?N:void 0});const L=(0,s.getBlockType)(f);w&&!B&&(b={...b,tabIndex:-1}),null!=L&&L.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=p()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,L.getEditWrapperProps(v)));const R=b&&!!b["data-align"]&&!S;let A;if(R&&(P=(0,u.createElement)("div",{className:"wp-block","data-align":b["data-align"]},P)),h)A="html"===o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{display:"none"}},P),(0,u.createElement)(dp,{isHtml:!0},(0,u.createElement)(ns,{clientId:i}))):(null==L?void 0:L.apiVersion)>1?P:(0,u.createElement)(dp,b,P);else{const e=n?(0,s.serializeRawBlock)(n):(0,s.getSaveContent)(L,v);A=(0,u.createElement)(dp,{className:"has-warning"},(0,u.createElement)(Zi,{clientId:i}),(0,u.createElement)(u.RawHTML,null,(0,Di.safeHTML)(e)))}const{"data-align":O,...D}=null!==(t=b)&&void 0!==t?t:{},z={clientId:i,className:p()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":x,"is-content-block":w&&B},O&&S&&`align${O}`,d),wrapperProps:D,isAligned:R},F=(0,u.useMemo)((()=>z),Object.values(z));return(0,u.createElement)(up.Provider,{value:F},(0,u.createElement)(es,{fallback:(0,u.createElement)(dp,{className:"has-warning"},(0,u.createElement)(Xi,null))},A))})),fp=window.wp.htmlEntities;var hp=(0,m.compose)((0,g.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(E_),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,g.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(E_);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,fp.decodeEntities)(r)||(0,k.__)("Type / to choose a block");return(0,u.createElement)("div",{"data-root-client-id":l||"",className:p()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,u.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,k.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{md.ENTER!==e.keyCode&&md.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,u.createElement)(eb,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function vp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,u.createElement)(eb,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:s,isOpen:a,blockTitle:c,hasSingleBlockType:d}=e;n=d?(0,k.sprintf)((0,k._x)("Add %s","directly add the only allowed block"),c):(0,k._x)("Add block","Generic label for block inserter button");const m=!d;let g=(0,u.createElement)(h.Button,{ref:t,onFocus:r,tabIndex:l,className:p()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":m?"true":void 0,"aria-expanded":m?a:void 0,disabled:s,label:n},!d&&(0,u.createElement)(h.VisuallyHidden,{as:"span"},n),(0,u.createElement)(Jd,{icon:Ti}));return(m||d)&&(g=(0,u.createElement)(h.Tooltip,{text:n},g)),g},isAppender:!0})}const bp=(0,u.forwardRef)(((e,t)=>(W()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),vp(e,t))));var _p=(0,u.forwardRef)(vp);function kp(e){let{rootClientId:t}=e;return(0,g.useSelect)((e=>e(E_).canInsertBlockType((0,s.getDefaultBlockName)(),t)))?(0,u.createElement)(hp,{rootClientId:t}):(0,u.createElement)(_p,{rootClientId:t,className:"block-list-appender__toggle"})}var yp=function(e){let{rootClientId:t,renderAppender:n,className:o,tagName:r="div"}=e;const l=function(e,t){const{hideInserter:n,isParentSelected:o}=(0,g.useSelect)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:o,__unstableGetEditorMode:r}=t(E_),l=o();return{hideInserter:!!n(e)||"zoom-out"===r(),isParentSelected:e===l||!e&&!l}}),[e]);return n||!1===t?null:t?(0,u.createElement)(t,null):o?(0,u.createElement)(kp,{rootClientId:e}):null}(t,n);return l?(0,u.createElement)(r,{tabIndex:-1,className:p()("block-list-appender wp-block",o),contentEditable:!1,"data-block":!0},l):null};const Ep=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Cp=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...i}=e;const[s,a]=(0,u.useReducer)((e=>(e+1)%Ep),0),{orientation:d,rootClientId:m,isVisible:f}=(0,g.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(E_),s=l(null!=t?t:n);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t,n]),v=Mr(t),b=Mr(n),_="vertical"===d,y=(0,u.useMemo)((()=>{if(s<0||!v&&!b||!f)return{};const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;if(_)return{width:e?e.width:t.width,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,k.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:e?e.height:t.height}}),[v,b,_,s,f]),E=(0,u.useMemo)((()=>{if(s<0||!v&&!b||!f)return;const{ownerDocument:e}=v||b;return{ownerDocument:e,getBoundingClientRect(){const e=v?v.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0;return _?(o=e?e.bottom:t.top,n=(0,k.isRTL)()?e?e.right:t.right:e?e.left:t.left):(o=e?e.top:t.top,n=(0,k.isRTL)()?e?e.left:t.right:e?e.right:t.left),new window.DOMRect(n,o,0,0)}}}),[v,b,s,_,f]),C=xl(l);return(0,u.useLayoutEffect)((()=>{if(!v)return;const e=new window.MutationObserver(a);return e.observe(v,{attributes:!0}),()=>{e.disconnect()}}),[v]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(a);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(v)return v.ownerDocument.defaultView.addEventListener("resize",a),()=>{var e;null===(e=v.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",a)}}),[v]),(v||b)&&f?(0,u.createElement)(h.Popover,c({ref:C,animate:!1,anchor:E,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+m},i,{className:p()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"bottom-start",variant:"unstyled"}),(0,u.createElement)("div",{className:"block-editor-block-popover__inbetween-container",style:y},o)):null};const Sp={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var wp=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:o}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(E_),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),r=(0,m.useReducedMotion)();return(0,u.createElement)(Ml,{clientId:o,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,u.createElement)(h.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Sp.show:Sp.hide,animate:Sp.show,exit:r?Sp.show:Sp.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Bp=(0,u.createContext)();function Ip(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,g.useDispatch)(E_),l=(0,u.useContext)(Bp),i=(0,u.useRef)(),{orientation:s,previousClientId:a,nextClientId:c,rootClientId:d,isInserterShown:f,isDistractionFree:v,isNavigationMode:b}=(0,g.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:c}=e(E_),u=r(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;l(p);)p=i(p);for(;l(m);)m=s(m);const g=a();return{previousClientId:p,nextClientId:m,orientation:(null===(t=o(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:g.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),_=(0,m.useReducedMotion)();const k={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(v&&!b)return null;const E=p()("block-editor-block-list__insertion-point","is-"+s);return(0,u.createElement)(Cp,{previousClientId:a,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,u.createElement)(h.__unstableMotion.div,{layout:!_,initial:_?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&o(c,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:p()(E,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,u.createElement)(h.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,u.createElement)(h.__unstableMotion.div,{variants:y,className:p()("block-editor-block-list__insertion-point-inserter")},(0,u.createElement)(eb,{position:"bottom center",clientId:c,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function xp(e){const{insertionPoint:t,isVisible:n}=(0,g.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(E_);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,u.createElement)(wp,c({key:`${t.rootClientId}-${t.index}`},e)):(0,u.createElement)(Ip,e):null}function Tp(){const e=(0,u.useContext)(Bp),t=(0,g.useSelect)((e=>e(E_).getSettings().isDistractionFree||"zoom-out"===e(E_).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:c}=(0,g.useSelect)(E_),{showInsertionPoint:d,hideInsertionPoint:p}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)};function l(t){var o;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void p();let l;if(!t.target.classList.contains("is-root-container")){l=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(a(l))return;const u=(null===(o=n(l))||void 0===o?void 0:o.orientation)||"vertical",m=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===u&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===u&&t.left>g}));if(!f)return void p();if(!f.id&&(f=f.firstElementChild,!f))return void p();const h=f.id.slice("block-".length);if(!h||c(h))return;if(s().includes(h))return;const v=f.getBoundingClientRect();if("horizontal"===u&&(t.clientY>v.bottom||t.clientY<v.top)||"vertical"===u&&(t.clientX>v.right||t.clientX<v.left))return void p();const b=r(h);0!==b?d(l,b,{__unstableWithInserter:!0}):p()}}),[e,n,o,r,l,i,d,p,s,t])}const Mp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Np="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;var Pp=window.wp.keyboardShortcuts;var Lp=(0,u.createElement)(G.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Rp(e){let{clientId:t,maximumLength:n,context:o}=e;return xi({clientId:t,maximumLength:n,context:o})}function Ap(e){let{count:t,icon:n,isPattern:o}=e;const r=o&&(0,k.__)("Pattern");return(0,u.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,u.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,u.createElement)(h.FlexItem,null,n?(0,u.createElement)(Ai,{icon:n}):r||(0,k.sprintf)((0,k._n)("%d block","%d blocks",t),t)),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Ai,{icon:Lp})))))}var Op=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:r,onDragEnd:l}=e;const{srcRootClientId:i,isDraggable:a,icon:c}=(0,g.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:r,getBlockName:l}=e(E_),i=r(n[0]),a=l(n[0]);return{srcRootClientId:i,isDraggable:o(n,i),icon:null===(t=(0,s.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,u.useRef)(!1),[p,m,f]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,Di.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,u.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,g.useDispatch)(E_);if((0,u.useEffect)((()=>()=>{d.current&&b()}),[]),!a)return t({draggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:i};return(0,u.createElement)(h.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,p(e),r&&r()},onDragOver:m,onDragEnd:()=>{b(),d.current=!1,f(),l&&l()},__experimentalDragComponent:(0,u.createElement)(Ap,{count:n.length,icon:c})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var Dp=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var zp=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Fp=(e,t)=>"up"===e?"horizontal"===t?(0,k.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,k.isRTL)()?"left":"right":"down":null;function Vp(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,k.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Fp("down",l);if("down"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=Fp("down",l);if("down"===e)return(0,k.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,k.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,k.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Fp("up",l);if("up"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,k.sprintf)((0,k.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=Fp("up",l);if("up"===e)return(0,k.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,k.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,k.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,k.sprintf)((0,k.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=Fp("down",i);if("down"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=Fp("down",i);if("down"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the end of the content and cant be moved down"),t);if("left"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the end of the content and cant be moved left"),t);if("right"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the end of the content and cant be moved right"),t)}if(l<0&&!o){const e=Fp("up",i);if("up"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,k.sprintf)((0,k.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=Fp("up",i);if("up"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the beginning of the content and cant be moved up"),t);if("left"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the beginning of the content and cant be moved left"),t);if("right"===e)return(0,k.sprintf)((0,k.__)("Block %1$s is at the beginning of the content and cant be moved right"),t)}}const Hp=(e,t)=>"up"===e?"horizontal"===t?(0,k.isRTL)()?Pi:Li:Dp:"down"===e?"horizontal"===t?(0,k.isRTL)()?Li:Pi:zp:null,Gp=(e,t)=>"up"===e?"horizontal"===t?(0,k.isRTL)()?(0,k.__)("Move right"):(0,k.__)("Move left"):(0,k.__)("Move up"):"down"===e?"horizontal"===t?(0,k.isRTL)()?(0,k.__)("Move left"):(0,k.__)("Move right"):(0,k.__)("Move down"):null,Up=(0,u.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:r,...l}=e;const i=(0,m.useInstanceId)(Up),a=Array.isArray(n)?n:[n],d=a.length,{blockType:f,isDisabled:v,rootClientId:b,isFirst:_,isLast:k,firstIndex:y,orientation:E="vertical"}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:l,getBlock:i,getBlockListSettings:c}=e(E_),u=a[0],d=n(u),p=t(u),m=t(a[a.length-1]),g=l(d),f=i(u),h=0===p,v=m===g.length-1,{orientation:b}=c(d)||{};return{blockType:f?(0,s.getBlockType)(f.name):null,isDisabled:"up"===o?h:v,rootClientId:d,firstIndex:p,isFirst:h,isLast:v,orientation:r||b}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:S}=(0,g.useDispatch)(E_),w="up"===o?S:C,B=`block-editor-block-mover-button__description-${i}`;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,c({ref:t,className:p()("block-editor-block-mover-button",`is-${o}-button`),icon:Hp(o,E),label:Gp(o,E),"aria-describedby":B},l,{onClick:v?null:e=>{w(n,b),l.onClick&&l.onClick(e)},disabled:v,__experimentalIsFocusable:!0})),(0,u.createElement)(h.VisuallyHidden,{id:B},Vp(d,f&&f.title,y,_,k,"up"===o?-1:1,E)))})),$p=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Up,c({direction:"up",ref:t},e)))),jp=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Up,c({direction:"down",ref:t},e))));var Wp=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:i,orientation:s}=(0,g.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(E_),a=Array.isArray(t)?t:[t],c=a[0],u=s(c),d=o(c),p=o(a[a.length-1]),m=i(u);return{canMove:l(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=r(u))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&i&&!r)return null;const a=(0,k.__)("Drag");return(0,u.createElement)(h.ToolbarGroup,{className:p()("block-editor-block-mover",{"is-horizontal":"horizontal"===s})},!n&&(0,u.createElement)(Op,{clientIds:t},(e=>(0,u.createElement)(h.Button,c({icon:Lp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:a,tabIndex:"-1"},e)))),(0,u.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)($p,c({clientIds:t},e)))),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(jp,c({clientIds:t},e))))))};var Kp=function(e){let{clientId:t,rootClientId:n}=e;const o=Ii(t),r=(0,g.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a}=e(E_),c=l(t),{name:u,attributes:d}=r(t);return{index:c,name:u,attributes:d,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation,editorMode:a()}}),[t,n]),{index:l,name:i,attributes:a,blockMovingMode:d,orientation:m,editorMode:f}=r,{setNavigationMode:v,removeBlock:b}=(0,g.useDispatch)(E_),_=(0,u.useRef)(),y=(0,s.getBlockType)(i),E=(0,s.__experimentalGetAccessibleBlockLabel)(y,a,l+1,m);(0,u.useEffect)((()=>{_.current.focus(),(0,pn.speak)(E)}),[E]);const C=Mr(t),{hasBlockMovingClientId:S,getBlockIndex:w,getBlockRootClientId:B,getClientIdsOfDescendants:I,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:T,getPreviousBlockClientId:M,getNextBlockClientId:N}=(0,g.useSelect)(E_),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:A}=(0,g.useDispatch)(E_),O=p()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!d}),D=(0,k.__)("Drag");return(0,u.createElement)("div",{className:O},(0,u.createElement)(h.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(Ai,{icon:null==o?void 0:o.icon,showColors:!0})),(0,u.createElement)(h.FlexItem,null,"zoom-out"===f&&(0,u.createElement)(Wp,{clientIds:[t],hideDragHandle:!0}),"navigation"===f&&(0,u.createElement)(Op,{clientIds:[t]},(e=>(0,u.createElement)(h.Button,c({icon:Lp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{ref:_,onClick:"navigation"===f?()=>v(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,o=n===md.UP,r=n===md.DOWN,l=n===md.LEFT,i=n===md.RIGHT,s=n===md.TAB,a=n===md.ESCAPE,c=n===md.ENTER,u=n===md.SPACE,d=e.shiftKey;if(n===md.BACKSPACE||n===md.DELETE)return b(t),void e.preventDefault();const p=x(),m=T(),g=M(m||p),f=N(m||p),h=s&&d||o,v=s&&!d||r,_=l,k=i;let y;if(h)y=g;else if(v)y=f;else if(_){var E;y=null!==(E=B(p))&&void 0!==E?E:p}else if(k){var O;y=null!==(O=I([p])[0])&&void 0!==O?O:p}const D=S();if(a&&D&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&D){const e=B(D),t=B(p),n=w(D);let o=w(p);n<o&&e===t&&(o-=1),A(D,e,t,o),P(D),R(null)}if(v||h||_||k)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=C;do{t=Di.focus.tabbable.findNext(t)}while(t&&C.contains(t));t||(t=C.ownerDocument.defaultView.frameElement,t=Di.focus.tabbable.findNext(t))}else t=Di.focus.tabbable.findPrevious(C);t&&(e.preventDefault(),t.focus(),L())}},label:E,showTooltip:!1,className:"block-selection-button_select-button"},(0,u.createElement)(Rp,{clientId:t,maximumLength:35})))))};function qp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function Yp(e,t,n,o,r){const[l]=(0,u.useState)(t),[i]=(0,u.useState)(o),s=(0,u.useCallback)((()=>{!function(e){const[t]=Di.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Pp.useShortcut)("core/block-editor/focus-toolbar",s),(0,u.useEffect)((()=>{l&&s()}),[n,l,s]),(0,u.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=qp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=qp(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Zp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const i=(0,u.useRef)(),s=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Di.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||W()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return Yp(i,n,s,o,r),s?(0,u.createElement)(h.Toolbar,c({label:l["aria-label"],ref:i},l),t):(0,u.createElement)(h.NavigableMenu,c({orientation:"horizontal",role:"toolbar",ref:i},l),t)};const{clearTimeout:Qp,setTimeout:Xp}=window,Jp=()=>{},em=200;function tm(e){let{ref:t,isFocused:n,debounceTimeout:o=em,onChange:r=Jp}=e;const[l,i]=(0,u.useState)(!1),s=(0,u.useRef)(),a=e=>{null!=t&&t.current&&i(e),r(e)},c=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},d=()=>{const e=s.current;e&&Qp&&Qp(e)};return(0,u.useEffect)((()=>()=>{a(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||a(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),s.current=Xp((()=>{c()&&a(!1)}),o)}}}function nm(e){let{ref:t,debounceTimeout:n=em,onChange:o=Jp}=e;const[r,l]=(0,u.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:a}=tm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),c=(0,u.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),s())},o=()=>{d()||(l(!1),a())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,c,l,s,a]),{showMovers:i,gestures:{onMouseMove:s,onMouseLeave:a}}}function om(){const{selectBlock:e,toggleBlockHighlight:t}=(0,g.useDispatch)(E_),{firstParentClientId:n,shouldHide:o,isDistractionFree:r}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:r}=e(E_),{hasBlockSupport:l}=e(s.store),i=n(o()),a=i[i.length-1],c=t(a),u=(0,s.getBlockType)(c),d=r();return{firstParentClientId:a,shouldHide:!l(u,"__experimentalParentSelector",!0),isDistractionFree:d.isDistractionFree}}),[]),l=Ii(n),i=(0,u.useRef)(),{gestures:a}=nm({ref:i,onChange(e){e&&r||t(n,e)}});return o||void 0===n?null:(0,u.createElement)("div",c({className:"block-editor-block-parent-selector",key:n,ref:i},a),(0,u.createElement)(h.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,k.sprintf)((0,k.__)("Select %s"),null==l?void 0:l.title),showTooltip:!0,icon:(0,u.createElement)(Ai,{icon:null==l?void 0:l.icon})}))}var rm=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function lm(e){let{blocks:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,k.__)("Preview")),(0,u.createElement)(yh,{viewportWidth:500,blocks:t})))))}function im(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:o}=e;return t.map((e=>(0,u.createElement)(sm,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:o})))}function sm(e){let{item:t,onSelect:n,setHoveredTransformItemName:o}=e;const{name:r,icon:l,title:i,isDisabled:a}=t;return(0,u.createElement)(h.MenuItem,{className:(0,s.getBlockMenuDefaultClassName)(r),onClick:e=>{e.preventDefault(),n(r)},disabled:a,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r)},(0,u.createElement)(Ai,{icon:l,showColors:!0}),i)}var am=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:r}=e;const[l,i]=(0,u.useState)(),{priorityTextTransformations:a,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:o}=e,{name:r}=n;return t[o]<t[r]?-1:1})),n}(n),d=a.length&&c.length,p=!!c.length&&(0,u.createElement)(im,{restTransformations:c,onSelect:o,setHoveredTransformItemName:i});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{label:(0,k.__)("Transform to"),className:t},l&&(0,u.createElement)(lm,{blocks:(0,s.switchToBlockType)(r,l)}),a.map((e=>(0,u.createElement)(sm,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:i}))),!d&&p),!!d&&(0,u.createElement)(h.MenuGroup,{className:t},p))};var cm=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),um=window.wp.tokenList,dm=n.n(um);function pm(e,t,n){const o=new(dm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function mm(e){return null==e?void 0:e.find((e=>e.isDefault))}function gm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:r,blockType:l,className:i}=(0,g.useSelect)((e=>{const{getBlock:n}=e(E_),o=n(t);if(!o)return{};const r=(0,s.getBlockType)(o.name),{getBlockStyles:l}=e(s.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:a}=(0,g.useDispatch)(E_),c=function(e){return e&&0!==e.length?mm(e)?e:[{name:"default",label:(0,k._x)("Default","block style"),isDefault:!0},...e]:[]}(o),d=function(e,t){for(const n of new(dm())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(o)return o}return mm(e)}(c,i),p=function(e,t){return(0,u.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,s.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,s.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(r,l);return{onSelect:e=>{const o=pm(i,d,e);a(t,{className:o}),n()},stylesToRender:c,activeStyle:d,genericPreviewBlock:p,className:i}}const fm=()=>{};function hm(e){let{clientId:t,onSwitch:n=fm}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=gm({clientId:t,onSwitch:n});return r&&0!==r.length?(0,u.createElement)(u.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,u.createElement)(h.MenuItem,{key:e.name,icon:l.name===e.name?cm:null,onClick:()=>o(e)},(0,u.createElement)(h.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function vm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,u.createElement)(h.MenuGroup,{label:(0,k.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,u.createElement)(hm,{clientId:o,onSwitch:n}))}const bm=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=bm(e,t,n);if(o)return o}}},_m=(e,t)=>{const n=((e,t)=>{const n=(0,s.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var km=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,s.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=bm(r,t.name,o);if(n){e=!0,o.add(n.clientId),_m(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function ym(e){let{patterns:t,onSelect:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,u.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,u.createElement)(h.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,u.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,k.__)("Preview")),(0,u.createElement)(Em,{patterns:t,onSelect:n})))))}function Em(e){let{patterns:t,onSelect:n}=e;const o=(0,h.__unstableUseCompositeState)();return(0,u.createElement)(h.__unstableComposite,c({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,k.__)("Patterns list")}),t.map((e=>(0,u.createElement)(Cm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Cm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,m.useInstanceId)(Cm,`${r}-list__item-description`);return(0,u.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,u.createElement)(yh,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,u.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,u.createElement)(h.VisuallyHidden,{id:l},t.description))}var Sm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,u.useState)(!1),i=km(n,t);return i.length?(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,u.createElement)(ym,{patterns:i,onSelect:o}),(0,u.createElement)(h.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:Pi},(0,k.__)("Patterns"))):null};const wm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o,multiSelect:r}=(0,g.useDispatch)(E_),l=Ii(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,patterns:p}=(0,g.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i}=e(E_),{getBlockStyles:a,getBlockType:c}=e(s.store),{canRemoveBlocks:u}=e(E_),d=o(Array.isArray(t)?t[0]:t),[{name:p}]=n,m=1===n.length,g=m&&a(p);let f;if(m)f=null==l?void 0:l.icon;else{var h;f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(h=c(p))||void 0===h?void 0:h.icon:rm}return{possibleBlockTransformations:r(n,d),canRemove:u(t,d),hasBlockStyles:!(null==g||!g.length),icon:f,patterns:i(n,d)}}),[t,n,null==l?void 0:l.icon]),m=xi({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),f=1===n.length&&(0,s.isReusableBlock)(n[0]),v=1===n.length&&(0,s.isTemplatePart)(n[0]);function b(e){e.length>1&&r(e[0].clientId,e[e.length-1].clientId)}const _=!!i.length&&a&&!v,y=!(null==p||!p.length)&&a;if(!c&&!_)return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:m,icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ai,{icon:d,showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m))}));const E=m,C=1===n.length?(0,k.sprintf)((0,k.__)("%s: Change block type or style"),m):(0,k.sprintf)((0,k._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),S=c||_||y;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(h.DropdownMenu,{className:"block-editor-block-switcher",label:E,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ai,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(f||v)&&(0,u.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},m)),toggleProps:{describedBy:C,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:r}=e;return S&&(0,u.createElement)("div",{className:"block-editor-block-switcher__container"},y&&(0,u.createElement)(Sm,{blocks:n,patterns:p,onSelect:e=>{!function(e){o(t,e),b(e)}(e),r()}}),_&&(0,u.createElement)(am,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{!function(e){const r=(0,s.switchToBlockType)(n,e);o(t,r),b(r)}(e),r()}}),c&&(0,u.createElement)(vm,{hoveredBlock:n[0],onSwitch:r}))})))))};var Bm=e=>{let{clientIds:t}=e;const n=(0,g.useSelect)((e=>e(E_).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,u.createElement)(wm,{clientIds:t,blocks:n})};const{Fill:Im,Slot:xm}=(0,h.createSlotFill)("__unstableBlockToolbarLastItem");Im.Slot=xm;var Tm=Im;var Mm=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Nm=window.wp.notices;function Pm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function Lm(){const{getBlockName:e}=(0,g.useSelect)(E_),{getBlockType:t}=(0,g.useSelect)(s.store),{createSuccessNotice:n}=(0,g.useDispatch)(Nm.store);return(0,u.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,k.sprintf)((0,k.__)('Copied "%s" to clipboard.'),s):(0,k.sprintf)((0,k.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,k.sprintf)((0,k._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,k.sprintf)((0,k._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Rm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:a,canInsertBlockType:c}=(0,g.useSelect)(E_),{flashBlock:u,removeBlocks:d,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:h,insertBlocks:v}=(0,g.useDispatch)(E_),b=Lm();return(0,m.useRefEffect)((m=>{function g(g){const _=t();if(0===_.length)return;if(!n()){const{target:e}=g,{ownerDocument:t}=e;if("copy"===g.type||"cut"===g.type?(0,Di.documentHasUncollapsedSelection)(t):(0,Di.documentHasSelection)(t))return}if(!m.contains(g.target.ownerDocument.activeElement))return;const k=g.defaultPrevented;g.preventDefault();const y=i(),E=l()||r(),C=!E&&!y;if("copy"===g.type||"cut"===g.type)if(1===_.length&&u(_[0]),C)h();else{let t;if(b(g.type,_),E)t=e(_);else{const[n,o]=a();t=[n,...e(_.slice(1,_.length-1)),o]}const n=g.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,s.createBlock)(n,JSON.parse(g.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,s.serialize)(t);g.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,Di.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),g.clipboardData.setData("text/html",o)}if("cut"===g.type)E&&!C?d(_):f();else if("paste"===g.type){if(k)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Di.getFilesFromDataTransfer)(t);return r.length&&!Pm(r,o)?{files:r}:{html:o,plainText:n,files:[]}}(g);let l=[];if(r.length){const e=(0,s.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,s.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,s.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===_.length){const[e]=_;if(l.every((t=>c(t.name,e))))return void v(l,void 0,e)}p(_,l,l.length-1,-1)}}return m.ownerDocument.addEventListener("copy",g),m.ownerDocument.addEventListener("cut",g),m.ownerDocument.addEventListener("paste",g),()=>{m.ownerDocument.removeEventListener("copy",g),m.ownerDocument.removeEventListener("cut",g),m.ownerDocument.removeEventListener("paste",g)}}),[])}var Am=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:Rm()},t)};const Om="align",Dm="__experimentalBorder",zm="color",Fm="customClassName",Vm="typography.__experimentalFontFamily",Hm="typography.fontSize",Gm="__experimentalLayout",Um=[...["typography.lineHeight",Hm,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Vm,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"],Dm,zm,"spacing"];const $m={align:e=>(0,s.hasBlockSupport)(e,Om),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,s.getBlockSupport)(e,Dm);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=(0,s.getBlockSupport)(e,zm);return t&&!1!==t.background},textColor:e=>{const t=(0,s.getBlockSupport)(e,zm);return t&&!1!==t.text},gradient:e=>{const t=(0,s.getBlockSupport)(e,zm);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,s.hasBlockSupport)(e,Fm,!0),fontFamily:e=>(0,s.hasBlockSupport)(e,Vm),fontSize:e=>(0,s.hasBlockSupport)(e,Hm),layout:e=>(0,s.hasBlockSupport)(e,Gm),style:e=>Um.some((t=>(0,s.hasBlockSupport)(e,t)))};function jm(e,t){return Object.entries($m).reduce(((n,o)=>{let[r,l]=o;return l(e.name)&&l(t.name)&&(n[r]=e.attributes[r]),n}),{})}function Wm(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,jm(t[o],e[o])),Wm(e[o].innerBlocks,t[o].innerBlocks,n)}function Km(){const e=(0,g.useRegistry)(),{updateBlockAttributes:t}=(0,g.useDispatch)(E_),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,g.useDispatch)(Nm.store);return(0,u.useCallback)((async l=>{let i="";try{if(!window.navigator.clipboard)return void r((0,k.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,k.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,s.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,k.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=(0,s.parse)(i);if(1===a.length?e.batch((()=>{Wm(l,l.map((()=>a[0])),t)})):e.batch((()=>{Wm(l,a,t)})),1===l.length){var c;const e=null===(c=(0,s.getBlockType)(l[0].name))||void 0===c?void 0:c.title;n((0,k.sprintf)((0,k.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,k.sprintf)((0,k.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function qm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:r,getBlockRootClientId:l,getBlocksByClientId:i,canMoveBlocks:a,canRemoveBlocks:c}=(0,g.useSelect)(E_),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,g.useSelect)(s.store),p=i(t),m=l(t[0]),f=p.every((e=>!!e&&(0,s.hasBlockSupport)(e.name,"multiple",!0)&&r(e.name,m))),h=r(u(),m),v=a(t,m),b=c(t,m),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:S,setBlockMovingClientId:w,setNavigationMode:B,selectBlock:I,clearSelectedBlock:x,multiSelect:T}=(0,g.useDispatch)(E_),M=Lm(),N=Km();return n({canDuplicate:f,canInsertDefaultBlock:h,canMove:v,canRemove:b,rootClientId:m,blocks:p,onDuplicate(){return y(t,o)},onRemove(){return _(t,o)},onInsertBefore(){const e=Array.isArray(t)?t[0]:e;C(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;E(e)},onMoveTo(){B(!0),I(t[0]),w(t[0])},onGroup(){if(!p.length)return;const e=d(),n=(0,s.switchToBlockType)(p,e);n&&k(t,n)},onUngroup(){if(!p.length)return;const e=p[0].innerBlocks;e.length&&k(t,e)},onCopy(){const e=p.map((e=>{let{clientId:t}=e;return t}));1===p.length&&S(e[0]),M("copy",e)},async onPasteStyles(){await N(p),x(),T(p[0].clientId,p[p.length-1].clientId)}})}const Ym=()=>{};var Zm=(0,m.compose)([(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:r,getSettings:l}=e(E_),i=o(n),a=l().codeEditingEnabled;return{mode:r(n),blockType:i?(0,s.getBlockType)(i.name):null,isCodeEditingEnabled:a}})),(0,g.withDispatch)(((e,t)=>{let{onToggle:n=Ym,clientId:o}=t;return{onToggleMode(){e(E_).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:r=!1,isCodeEditingEnabled:l=!0}=e;if(!t||!(0,s.hasBlockSupport)(t,"html",!0)||!l)return null;const i="visual"===n?(0,k.__)("Edit as HTML"):(0,k.__)("Edit visually");return(0,u.createElement)(h.MenuItem,{onClick:o},!r&&i)}));var Qm=(0,m.compose)((0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(E_).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,g.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(E_).replaceBlocks(n.clientId,(0,s.rawHandler)({HTML:(0,s.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,k.__)("Convert to Blocks");return(0,u.createElement)(h.MenuItem,{onClick:n},!o&&r)}));const{Fill:Xm,Slot:Jm}=(0,h.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Xm.Slot=Jm;var eg=Xm;function tg(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}=(0,g.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:r,getSelectedBlockClientIds:l}=e(E_),{getGroupingBlockName:i}=e(s.store),a=l(),c=i(),u=r(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:r}}function ng(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}=e;const{replaceBlocks:a}=(0,g.useDispatch)(E_);return n||o?(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=(0,s.switchToBlockType)(r,l);e&&a(t,e)})(),i()}},(0,k._x)("Group","verb")),o&&(0,u.createElement)(h.MenuItem,{onClick:()=>{(()=>{const e=r[0].innerBlocks;e.length&&a(t,e)})(),i()}},(0,k._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function og(e){return(0,g.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(E_),c=s(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}var rg=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"}));var lg=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var ig=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));const sg=["core/block","core/navigation"];function ag(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function cg(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,u.useState)({move:!1,remove:!1}),{canEdit:l,canMove:i,canRemove:a}=og(t),{allowsEditLocking:c,templateLock:d,hasTemplateLock:p}=(0,g.useSelect)((e=>{var n,o;const{getBlockName:r,getBlockAttributes:l}=e(E_),i=r(t),a=(0,s.getBlockType)(i);return{allowsEditLocking:sg.includes(i),templateLock:null===(n=l(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[f,v]=(0,u.useState)(!!d),{updateBlockAttributes:b}=(0,g.useDispatch)(E_),_=Ii(t),y=(0,m.useInstanceId)(cg,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{r({move:!i,remove:!a,...c?{edit:!l}:{}})}),[l,i,a,c]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,u.createElement)(h.Modal,{title:(0,k.sprintf)((0,k.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,u.createElement)("p",null,(0,k.__)("Choose specific attributes to restrict or lock all available options.")),(0,u.createElement)("form",{onSubmit:e=>{e.preventDefault(),b([t],{lock:o,templateLock:f?ag(o):void 0}),n()}},(0,u.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,u.createElement)("span",{id:y},(0,k.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>r({move:e,remove:e,...c?{edit:e}:{}})}),(0,u.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},c&&(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Restrict editing"),checked:!!o.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?ig:rg})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Disable movement"),checked:o.move,onChange:e=>r((t=>({...t,move:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?ig:rg})),(0,u.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,u.createElement)(h.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Prevent removal"),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,u.createElement)(h.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?ig:rg}))),p&&(0,u.createElement)(h.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,k.__)("Apply to all blocks inside"),checked:f,disabled:o.move&&!o.remove,onChange:()=>v(!f)})),(0,u.createElement)(h.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"tertiary",onClick:n},(0,k.__)("Cancel"))),(0,u.createElement)(h.FlexItem,null,(0,u.createElement)(h.Button,{variant:"primary",type:"submit"},(0,k.__)("Apply"))))))}function ug(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=og(t),[r,l]=(0,u.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,k.__)("Unlock"):(0,k.__)("Lock");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{icon:o?rg:lg,onClick:l},i),r&&(0,u.createElement)(cg,{clientId:t,onClose:l}))}const{Fill:dg,Slot:pg}=(0,h.createSlotFill)("BlockSettingsMenuControls");function mg(e){let{...t}=e;return(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(dg,t))}mg.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:o}=e;const{selectedBlocks:r,selectedClientIds:l,canRemove:i}=(0,g.useSelect)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(E_),l=null!==n?n:o();return{selectedBlocks:t(l),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:s}=og(l[0]),a=1===l.length&&s,d=tg(),{isGroupable:p,isUngroupable:m}=d,f=(p||m)&&i;return(0,u.createElement)(pg,{fillProps:{...t,__unstableDisplayLocation:o,selectedBlocks:r,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!f&&!a?null:(0,u.createElement)(h.MenuGroup,null,a&&(0,u.createElement)(ug,{clientId:l[0]}),e,f&&(0,u.createElement)(ng,c({},d,{onClose:null==t?void 0:t.onClose})))))};var gg=mg;const fg=()=>{},hg={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function vg(e){let{blocks:t,onCopy:n,label:o}=e;const r=(0,m.useCopyToClipboard)((()=>(0,s.serialize)(t)),n),l=t.length>1?(0,k.__)("Copy blocks"):(0,k.__)("Copy block"),i=o||l;return(0,u.createElement)(h.MenuItem,{ref:r},i)}var bg=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}=e;const i=Array.isArray(t)?t:[t],a=i.length,d=i[0],{firstParentClientId:p,isDistractionFree:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:_,nextBlockClientId:y,selectedBlockClientIds:E}=(0,g.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getNextBlockClientId:l,getSelectedBlockClientIds:i,getSettings:a,getBlockAttributes:c}=e(E_),{getActiveBlockVariation:u}=e(s.store),p=o(d),m=p&&n(p);return{firstParentClientId:p,isDistractionFree:a().isDistractionFree,onlyBlock:1===t(p),parentBlockType:p&&(u(m,c(p))||(0,s.getBlockType)(m)),previousBlockClientId:r(d),nextBlockClientId:l(d),selectedBlockClientIds:i()}}),[d]),C=(0,g.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Pp.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:S,toggleBlockHighlight:w}=(0,g.useDispatch)(E_),B=(0,u.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:fg,[n]),I=xi({clientId:d,maximumLength:25}),x=(0,u.useCallback)(n?()=>{const e=_||y;e&&E.includes(d)&&!E.includes(e)&&n(e)}:fg,[n,_,y,E]),T=(0,k.sprintf)((0,k.__)("Remove %s"),I),M=1===a?T:(0,k.__)("Remove blocks"),N=(0,u.useRef)(),{gestures:P}=nm({ref:N,onChange(e){e&&f||w(p,e)}}),L=null==E?void 0:E.includes(p);return(0,u.createElement)(qm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:i,canMove:s,canRemove:g,onDuplicate:f,onInsertAfter:_,onInsertBefore:y,onRemove:E,onCopy:w,onPasteStyles:I,onMoveTo:T,blocks:R}=e;return(0,u.createElement)(h.DropdownMenu,c({icon:Mm,label:(0,k.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:hg,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(eg.Slot,{fillProps:{onClose:l}}),!L&&!!p&&(0,u.createElement)(h.MenuItem,c({},P,{ref:N,icon:(0,u.createElement)(Ai,{icon:b.icon}),onClick:()=>S(p)}),(0,k.sprintf)((0,k.__)("Select parent block (%s)"),b.title)),1===a&&(0,u.createElement)(Qm,{clientId:d}),(0,u.createElement)(vg,{blocks:R,onCopy:w}),n&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,f,B),shortcut:C.duplicate},(0,k.__)("Duplicate")),i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,y),shortcut:C.insertBefore},(0,k.__)("Insert before")),(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,_),shortcut:C.insertAfter},(0,k.__)("Insert after"))),s&&!v&&(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,T)},(0,k.__)("Move to")),1===a&&(0,u.createElement)(Zm,{clientId:d,onToggle:l})),(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(vg,{blocks:R,onCopy:w,label:(0,k.__)("Copy styles")}),(0,u.createElement)(h.MenuItem,{onClick:I},(0,k.__)("Paste styles"))),(0,u.createElement)(gg.Slot,{fillProps:{onClose:l},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),g&&(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:(0,m.pipe)(l,E,x),shortcut:C.remove},M)))}))}))};var _g=function(e){let{clientIds:t,...n}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(bg,c({clientIds:t,toggleProps:e},n)))))};function kg(e){let{clientId:t}=e;const n=Ii(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=og(t),[s,a]=(0,u.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,u.createElement)(h.ToolbarButton,{icon:ig,label:(0,k.sprintf)((0,k.__)("Unlock %s"),n.title),onClick:a})),s&&(0,u.createElement)(cg,{clientId:t,onClose:a})):null}var yg=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"}));var Eg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"}));var Cg=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const Sg={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var wg=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=tg(),{replaceBlocks:r}=(0,g.useDispatch)(E_),{canRemove:l,variations:i}=(0,g.useSelect)((e=>{const{canRemoveBlocks:o}=e(E_),{getBlockVariations:r}=e(s.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),a=o=>{const l=(0,s.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=Sg[o],r(t,l))};if(!o||!l)return null;const c=!!i.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!i.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{icon:yg,label:(0,k._x)("Group","verb"),onClick:a}),c&&(0,u.createElement)(h.ToolbarButton,{icon:Eg,label:(0,k._x)("Row","single horizontal line"),onClick:()=>a("row")}),d&&(0,u.createElement)(h.ToolbarButton,{icon:Cg,label:(0,k._x)("Stack","verb"),onClick:()=>a("stack")}))};function Bg(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,g.useSelect)((e=>!!n&&"html"===e(E_).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,g.useDispatch)(E_);return o?(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{onClick:()=>{r(n)}},(0,k.__)("Edit visually"))):null}var Ig=(0,u.createContext)("");var xg=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:r,hasFixedToolbar:l,isDistractionFree:i,isValid:a,isVisual:d,isContentLocked:f}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getSettings:i,__unstableGetContentLockingParent:a}=e(E_),c=o(),u=c[0],d=l(u),p=i();return{blockClientIds:c,blockClientId:u,blockType:u&&(0,s.getBlockType)(t(u)),hasFixedToolbar:p.hasFixedToolbar,isDistractionFree:p.isDistractionFree,rootClientId:d,isValid:c.every((e=>r(e))),isVisual:c.every((e=>"visual"===n(e))),isContentLocked:!!a(u)}}),[]),{toggleBlockHighlight:v}=(0,g.useDispatch)(E_),b=(0,u.useRef)(),{showMovers:_,gestures:k}=nm({ref:b,onChange(e){e&&i||v(o,e)}}),y=(0,m.useViewportMatch)("medium","<")||l;if(r&&!(0,s.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const E=y||_;if(0===n.length)return null;const C=a&&d,S=n.length>1,w=(0,s.isReusableBlock)(r)||(0,s.isTemplatePart)(r),B=p()("block-editor-block-toolbar",{"is-showing-movers":E,"is-synced":w});return(0,u.createElement)("div",{className:B},!S&&!y&&!f&&(0,u.createElement)(om,null),(0,u.createElement)("div",c({ref:b},k),(C||S)&&!f&&(0,u.createElement)(h.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,u.createElement)(Bm,{clientIds:n}),!S&&(0,u.createElement)(kg,{clientId:n[0]}),(0,u.createElement)(Wp,{clientIds:n,hideDragHandle:t}))),C&&S&&(0,u.createElement)(wg,null),C&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(x_.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(x_.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(x_.Slot,{className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(x_.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(x_.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,u.createElement)(Ig.Provider,{value:null==r?void 0:r.name},(0,u.createElement)(Tm.Slot,null))),(0,u.createElement)(Bg,{clientIds:n}),!f&&(0,u.createElement)(_g,{clientIds:n}))};var Tg=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:r,hasParents:l,showParentSelector:i}=(0,g.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,__unstableGetContentLockingParent:r}=e(E_),{getBlockType:l}=e(s.store),i=o(),a=i[0],c=n(a),u=l(t(c[c.length-1]));return{blockType:a&&l(t(a)),hasParents:c.length,showParentSelector:u&&(0,s.hasBlockSupport)(u,"__experimentalParentSelector",!0)&&i.length<=1&&!r(a)}}),[]);if(r&&!(0,s.hasBlockSupport)(r,"__experimentalToolbar",!0))return null;const a=p()("block-editor-block-contextual-toolbar",{"has-parent":l&&i,"is-fixed":n});return(0,u.createElement)(Zp,c({focusOnMount:t,className:a,"aria-label":(0,k.__)("Block tools")},o),(0,u.createElement)(xg,{hideDragHandle:n}))};const Mg="position",Ng="block-editor-hooks__position-selection__select-control__option",Pg={key:"default",value:"",name:(0,k.__)("Default"),className:Ng},Lg={key:"sticky",value:"sticky",name:(0,k.__)("Sticky"),className:Ng,__experimentalHint:(0,k.__)("The block will stick to the top of the window instead of scrolling.")},Rg={key:"fixed",value:"fixed",name:(0,k.__)("Fixed"),className:Ng,__experimentalHint:(0,k.__)("The block will not move when the page is scrolled.")},Ag=["top","right","bottom","left"],Og=["sticky","fixed"];function Dg(e){return!!(0,s.getBlockSupport)(e,Mg)}function zg(e){var t,n;const o=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===o||"fixed"===o}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=qr("position.fixed"),n=qr("position.sticky"),o=!t&&!n;return!Dg(e)||o}function Vg(e){var t;const{attributes:{style:n={}},clientId:o,name:r,setAttributes:l}=e,i=function(e){const t=(0,s.getBlockSupport)(e,Mg);return!!(!0===t||null!=t&&t.fixed)}(r),a=function(e){const t=(0,s.getBlockSupport)(e,Mg);return!!(!0===t||null!=t&&t.sticky)}(r),c=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:d}=(0,g.useSelect)((e=>{const{getBlockParents:t}=e(E_);return{hasParents:t(o).length}}),[o]),p=(0,u.useMemo)((()=>{const e=[Pg];return(a&&!d||c===Lg.value)&&e.push(Lg),(i||c===Rg.value)&&e.push(Rg),e}),[i,a,d,c]),m=c&&p.find((e=>e.value===c))||Pg;return u.Platform.select({web:p.length>1?(0,u.createElement)(wl,{group:"position"},(0,u.createElement)(h.BaseControl,{className:"block-editor-hooks__position-selection"},(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,k.__)("Position"),hideLabelFromVision:!0,describedBy:(0,k.sprintf)((0,k.__)("Currently selected position: %s"),m.name),options:p,value:m,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};l({style:fl(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const Hg=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,s.hasBlockSupport)(n,Mg)&&!Fg(t)&&(0,u.createElement)(Vg,c({key:"position"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),Gg=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l;const{name:i,attributes:a}=t,d=(0,s.hasBlockSupport)(i,Mg)&&!Fg(t),g=(0,m.useInstanceId)(e),f=(0,u.useContext)(Sf.__unstableElementContext);let h;d&&(h=function(e){let{selector:t,style:n}=e,o="";const{type:r}=(null==n?void 0:n.position)||{};return Og.includes(r)?(o+=`${t} {`,o+=`position: ${r};`,Ag.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(o+=`${e}: ${n.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(o+="z-index: 10"),o+="}",o):o}({selector:`.wp-container-${g}.wp-container-${g}`,style:null==a?void 0:a.style})||"");const v=p()(null==t?void 0:t.className,{[`wp-container-${g}`]:d&&!!h,[`is-position-${null==a||null===(n=a.style)||void 0===n||null===(o=n.position)||void 0===o?void 0:o.type}`]:d&&!!h&&!(null==a||null===(r=a.style)||void 0===r||null===(l=r.position)||void 0===l||!l.type)});return(0,u.createElement)(u.Fragment,null,d&&f&&!!h&&(0,u.createPortal)((0,u.createElement)("style",null,h),f),(0,u.createElement)(e,c({},t,{className:v})))}));(0,a.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",Gg),(0,a.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",Hg);const Ug={placement:"top-start"},$g={...Ug,flip:!1,shift:!0},jg={...Ug,flip:!0,shift:!1};function Wg(e,t,n,o,r){if(!e||!t)return $g;const l=(null==n?void 0:n.scrollTop)||0,i=t.getBoundingClientRect(),s=l+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=s+o,u=i.top>c,d=i.height>a-o;return r||!u&&!d?jg:$g}function Kg(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isBlockInterfaceHidden:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=__(e(E_));return{editorMode:t(),hasMultiSelection:o(),isMultiSelecting:n(),isTyping:r(),isBlockInterfaceHidden:l(),hasFixedToolbar:i().hasFixedToolbar,isDistractionFree:i().isDistractionFree,lastClientId:o()?s():null}}function qg(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,showContents:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:s}=e;const{editorMode:a,hasMultiSelection:d,isMultiSelecting:f,isTyping:h,isBlockInterfaceHidden:v,hasFixedToolbar:b,isDistractionFree:_,lastClientId:k}=(0,g.useSelect)(Kg,[]),y=(0,g.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(E_);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),E=(0,m.useViewportMatch)("medium"),C=(0,u.useRef)(!1),{stopTyping:S}=(0,g.useDispatch)(E_),w=!h&&"edit"===a&&o,B=!d&&("navigation"===a||"zoom-out"===a),I="edit"===a&&!b&&E&&!f&&!w&&!h&&!v,x=!("edit"!==a||I||b||_||o);(0,Pp.useShortcut)("core/block-editor/focus-toolbar",(()=>{C.current=!0,S(!0)}),{isDisabled:!x}),(0,u.useEffect)((()=>{C.current=!1}));const T=(0,u.useRef)(),M=function(e){let{contentElement:t,clientId:n}=e;const o=Mr(n),[r,l]=(0,u.useState)(0),{blockIndex:i,isSticky:s}=(0,g.useSelect)((e=>{const{getBlockIndex:t,getBlockAttributes:o}=e(E_);return{blockIndex:t(n),isSticky:zg(o(n))}}),[n]),a=(0,u.useMemo)((()=>{if(t)return(0,Di.getScrollContainer)(t)}),[t]),[c,d]=(0,u.useState)((()=>Wg(t,o,a,r,s))),p=(0,m.useRefEffect)((e=>{l(e.offsetHeight)}),[]),f=(0,u.useCallback)((()=>d(Wg(t,o,a,r,s))),[t,o,a,r]);return(0,u.useLayoutEffect)(f,[i,f]),(0,u.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",f);const s=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(f),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",f),i&&i.disconnect()}}),[f,t,o]),{...c,ref:p}}({contentElement:null==s?void 0:s.current,clientId:t});return w?(0,u.createElement)(Ml,c({clientId:l||t,__unstableCoverTarget:!0,bottomClientId:k,className:p()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:s,resize:!1,shift:!1},M),(0,u.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,u.createElement)(eb,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):B||I?(0,u.createElement)(Ml,c({clientId:l||t,bottomClientId:k,className:p()("block-editor-block-list__block-popover",{"is-insertion-point-visible":y}),__unstablePopoverSlot:i,__unstableContentRef:s,resize:!1},M),I&&r&&(0,u.createElement)(Tg,{focusOnMount:C.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),B&&(0,u.createElement)(Kp,{clientId:t,rootClientId:n})):null}function Yg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,getSettings:i,isNavigationMode:a,__experimentalGetBlockListSettingsForBlocks:c}=e(E_),u=t()||n();if(!u)return;const{name:d,attributes:p={}}=r(u)||{},m=l(u),g=c(m),f=m.find((e=>{var t;return null===(t=g[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=i();return{clientId:u,rootClientId:o(u),name:d,isDistractionFree:h.isDistractionFree,isNavigationMode:a(),isEmptyDefaultBlock:d&&(0,s.isUnmodifiedDefaultBlock)({name:d,attributes:p}),capturingClientId:f}}function Zg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,g.useSelect)(Yg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:s,capturingClientId:a,isDistractionFree:c,isNavigationMode:d}=o;return i?(0,u.createElement)(qg,{clientId:r,rootClientId:l,isEmptyDefaultBlock:s,showContents:!c||d,capturingClientId:a,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Qg(e){let{children:t}=e;const n=(0,u.useContext)(Bp),o=(0,u.useContext)(h.Disabled.Context);return n||o?t:(W()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,u.createElement)(xp,{__unstablePopoverSlot:"block-toolbar"},(0,u.createElement)(Zg,{__unstablePopoverSlot:"block-toolbar"}),t))}function Xg(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,g.useSelect)(E_),{clearSelectedBlock:o}=(0,g.useDispatch)(E_),{clearBlockSelection:r}=e();return(0,m.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function Jg(e){return(0,u.createElement)("div",c({ref:Xg()},e))}var ef=(0,m.createHigherOrderComponent)((e=>t=>{const{clientId:n}=$r();return(0,u.createElement)(e,c({},t,{clientId:n}))}),"withClientId");var tf=ef((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,u.createElement)(_p,{className:p()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var nf=(0,m.compose)([ef,(0,g.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(E_),r=o(n);return{lastBlockClientId:r[r.length-1]}}))])((e=>{let{clientId:t}=e;return(0,u.createElement)(hp,{rootClientId:t})}));const of=new WeakMap;function rf(e,t,n,o,r,l,i){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){i();const e=p.map((e=>(0,s.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;r(u,c,i&&l<t?t-s:t)}}}function lf(e,t,n,o,r,l){return t=>{if(!n)return;const i=(0,s.findTransform)((0,s.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}function sf(e,t,n){return e=>{const t=(0,s.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function af(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:o="insert"}=n,r=(0,g.useSelect)((e=>e(E_).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:s,getBlockOrder:a,getBlocksByClientId:c}=(0,g.useSelect)(E_),{insertBlocks:d,moveBlocksToPosition:p,updateBlockAttributes:m,clearSelectedBlock:f,replaceBlocks:h,removeBlocks:v}=(0,g.useDispatch)(E_),b=(0,g.useRegistry)(),_=(0,u.useCallback)((function(n){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===o){const o=a(e)[t];h(o,n,void 0,l)}else d(n,t,e,r,l)}),[o,a,d,h,t,e]),k=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=c(n),r=a(e)[t];b.batch((()=>{v(n,!1),h(r,o,void 0,0)}))}else p(n,r,e,l)}),[o,a,c,d,p,v,t,e]),y=rf(e,t,i,s,k,_,f),E=lf(e,0,r,m,l,_),C=sf(0,0,_);return e=>{const t=(0,Di.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?E(t):y(e)}}function cf(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function uf(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=cf(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function df(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function pf(e,t){var n,o;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l="horizontal"===r?["left","right"]:["top","bottom"],i=(0,k.isRTL)();let s=0,a="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:o,blockIndex:r}=e;const u=o();let[d,p]=uf(t,u,l);n&&df(t,u)&&(d=0),d<c&&(a="bottom"===p||!i&&"right"===p||i&&"left"===p?"after":"before",c=d,s=r)}));const u=s+("after"===a?1:-1),d=!(null===(n=e[s])||void 0===n||!n.isUnmodifiedDefaultBlock),p=!(null===(o=e[u])||void 0===o||!o.isUnmodifiedDefaultBlock);if(!d&&!p){return["after"===a?s+1:s,"insert"]}return[d?s:u,"replace"]}function mf(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,u.useState)({index:null,operation:"insert"}),o=(0,g.useSelect)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:o,__unstableHasActiveBlockOverlayActive:r}=t(E_),l=n(e);return["all","contentOnly"].some((e=>e===l))||r(e)||o(e)}),[e]),{getBlockListSettings:r,getBlocks:l,getBlockIndex:i}=(0,g.useSelect)(E_),{showInsertionPoint:a,hideInsertionPoint:c}=(0,g.useDispatch)(E_),d=af(e,t.index,{operation:t.operation}),p=(0,m.useThrottle)((0,u.useCallback)(((t,o)=>{var c;const u=l(e);if(0===u.length)return void n({index:0,operation:"insert"});const d=u.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,s.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>o.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:i(t)}})),[p,m]=pf(d,{x:t.clientX,y:t.clientY},null===(c=r(e))||void 0===c?void 0:c.orientation);n({index:p,operation:m}),a(e,p,{operation:m})}),[e]),200);return(0,m.__experimentalUseDropZone)({isDisabled:o,onDrop:d,onDragOver(e){p(e,e.currentTarget.ownerDocument)},onDragLeave(){p.cancel(),c()},onDragEnd(){p.cancel(),c()}})}const gf={};function ff(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:r,template:l,templateLock:i,wrapperRef:a,templateInsertUpdatesSelection:c,__experimentalCaptureToolbars:d,__experimentalAppenderTagName:p,renderAppender:m,orientation:f,placeholder:h,layout:v}=e;!function(e,t,n,o,r,l,i,s){const{updateBlockListSettings:a}=(0,g.useDispatch)(E_),c=(0,g.useRegistry)(),{blockListSettings:d,parentLock:p}=(0,g.useSelect)((t=>{const n=t(E_).getBlockRootClientId(e);return{blockListSettings:t(E_).getBlockListSettings(e),parentLock:t(E_).getTemplateLock(n)}}),[e]),m=(0,u.useMemo)((()=>t),t);(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:m,templateLock:void 0===r||"contentOnly"===p?p:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=rp(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Il()(d,t)||(of.get(c)||of.set(c,[]),of.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=of.get(c))&&void 0!==e&&e.length&&c.batch((()=>{of.get(c).forEach((e=>{a(...e)})),of.set(c,[])}))})))}),[e,d,m,n,o,r,p,l,i,a,s,c])}(t,n,o,r,i,d,f,v),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,g.useSelect)(E_),{replaceInnerBlocks:a,__unstableMarkNextChangeAsNotPersistent:c}=(0,g.useDispatch)(E_),{innerBlocks:d}=(0,g.useSelect)((t=>({innerBlocks:t(E_).getBlocks(e)})),[e]),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,g=!_()(t,p.current);if(!m||!g)return;p.current=t;const f=(0,s.synchronizeBlocksWithTemplate)(d,t);_()(f,d)||(c(),a(e,f,0===d.length&&o&&0!==f.length&&i(e),l()))})),()=>{u=!0}}),[d,t,n,e])}(t,l,i,c);const b=function(e){return(0,g.useSelect)((t=>{const n=t(E_).getBlock(e);if(!n)return;const o=t(s.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((e=>{let[t,o]=e;return[t,n.attributes[o]]}))):void 0}),[e])}(t),k=(0,g.useSelect)((e=>{var n;return null===(n=e(E_).getBlock(t))||void 0===n?void 0:n.name}),[t]),y=(0,s.getBlockSupport)(k,"__experimentalLayout")||gf,{allowSizingOnChildren:E=!1}=y,C=qr("layout")||gf,S=v||y,w=(0,u.useMemo)((()=>({...C,...S,...E&&{allowSizingOnChildren:!0}})),[C,S,E]);return(0,u.createElement)(Fi,{value:b},(0,u.createElement)(Bf,{rootClientId:t,renderAppender:m,__experimentalAppenderTagName:p,__experimentalLayout:w,wrapperRef:a,placeholder:h}))}function hf(e){return Si(e),(0,u.createElement)(ff,e)}const vf=(0,u.forwardRef)(((e,t)=>{const n=bf({ref:t},e);return(0,u.createElement)("div",{className:"block-editor-inner-blocks"},(0,u.createElement)("div",n))}));function bf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=$r(),a=(0,m.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:d,hasOverlay:f}=(0,g.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(E_),i=t(r),c="navigation"===l()||a;return{__experimentalCaptureToolbars:e(s.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,a]),h=mf({rootClientId:r}),v=(0,m.useMergeRefs)([e.ref,o?null:h]),b={__experimentalCaptureToolbars:d,layout:l,...t},_=b.value&&b.onChange?hf:ff;return{...e,ref:v,className:p()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":f}),children:r?(0,u.createElement)(_,c({},b,{clientId:r})):(0,u.createElement)(Bf,t)}}bf.save=s.__unstableGetInnerBlocksProps,vf.DefaultBlockAppender=nf,vf.ButtonBlockAppender=tf,vf.Content=()=>bf.save().children;var _f=vf;const kf=(0,u.createContext)(),yf=(0,u.createContext)(),Ef=new WeakMap;function Cf(e){let{className:t,...n}=e;const[o,r]=(0,u.useState)(),l=(0,m.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:s,editorMode:a}=(0,g.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(E_),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),c=(0,g.useRegistry)(),{setBlockVisibility:d}=(0,g.useDispatch)(E_),f=(0,m.useDebounce)((0,u.useCallback)((()=>{const e={};Ef.get(c).forEach((t=>{let[n,o]=t;e[n]=o})),d(e)}),[c]),300,{trailing:!0}),h=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{Ef.get(c)||Ef.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");Ef.get(c).push([e,t.isIntersecting])}f()}))}),[]),v=bf({ref:(0,m.useMergeRefs)([Xg(),Tp(),r]),className:p()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":s&&l,"is-navigate-mode":"navigation"===a})},n);return(0,u.createElement)(kf.Provider,{value:o},(0,u.createElement)(yf.Provider,{value:h},(0,u.createElement)("div",v)))}function Sf(e){return function(){const{patterns:e,isPreviewMode:t}=(0,g.useSelect)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(E_).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,u.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,o=-1;const r=()=>{o++,o>=e.length||((0,g.select)(E_).__experimentalGetParsedPattern(e[o].name),n=Mp(r))};return n=Mp(r),()=>Np(n)}),[e,t])}(),(0,u.createElement)(Qg,null,(0,u.createElement)(Ur,{value:Hr},(0,u.createElement)(Cf,e)))}function wf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=lp}=e;const{order:i,selectedBlocks:s,visibleBlocks:a}=(0,g.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(E_);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,u.createElement)(sp,{value:l},i.map((e=>(0,u.createElement)(g.AsyncModeProvider,{key:e,value:!a.has(e)&&!s.includes(e)},(0,u.createElement)(gp,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,u.createElement)(yp,{tagName:r,rootClientId:n,renderAppender:o}))}function Bf(e){return(0,u.createElement)(g.AsyncModeProvider,{value:!1},(0,u.createElement)(wf,e))}function If(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(E_);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function xf(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,g.useSelect)(If,[]);return(0,m.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function Tf(e,t,n,o){let r,l=Di.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(ed)===t.closest(ed)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!Di.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}}))}function Mf(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,g.useSelect)(E_),{selectBlock:l}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((i=>{let s;function a(){s=null}function c(a){if(a.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:g}=a,f=c===md.UP,h=c===md.DOWN,v=c===md.LEFT,b=c===md.RIGHT,_=f||v,k=v||b,y=f||h,E=k||y,C=d||p||m||g,S=y?Di.isVerticalEdge:Di.isHorizontalEdge,{ownerDocument:w}=i,{defaultView:B}=w;if(!E)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(_?l(e()):l(t(),-1))}if(!function(e,t,n){if((t===md.UP||t===md.DOWN)&&!n)return!0;const{tagName:o}=e;if("INPUT"===o)return["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type"));return"TEXTAREA"!==o}(u,c,C))return;y?s||(s=(0,Di.computeCaretRect)(B)):s=null;const I=(0,Di.isRTL)(u)?!_:_,{keepCaretInsideBlock:x}=n();if(d)(function(e,t){const n=Tf(e,t,i);return n&&rd(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,Di.isVerticalEdge)(u,_)||m&&!(0,Di.isHorizontalEdge)(u,I)||x){if(k&&B.getSelection().isCollapsed&&(0,Di.isHorizontalEdge)(u,I)&&!x){const e=Tf(u,I,i);(0,Di.placeCaretAtHorizontalEdge)(e,_),a.preventDefault()}}else{const e=Tf(u,_,i,!0);e&&((0,Di.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:s),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}function Nf(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,g.useSelect)(E_),{multiSelect:o,selectBlock:r}=(0,g.useDispatch)(E_),l=(0,Pp.__unstableUseShortcutEventMatch)();return(0,m.useRefEffect)((i=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Di.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Pf(e,t){e.contentEditable=t,t&&e.focus()}function Lf(){const{startMultiSelect:e,stopMultiSelect:t}=(0,g.useDispatch)(E_),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,g.useSelect)(E_);return(0,m.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Pf(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Pf(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Rf(e,t){e.contentEditable=t,t&&e.focus()}function Af(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,g.useDispatch)(E_),{getBlockParents:o,getBlockSelectionStart:r}=(0,g.useSelect)(E_);return(0,m.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Rf(n,!1);let c=rd(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=rd(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=r(),t=rd(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void Rf(n,!1);if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Of(){const{selectBlock:e}=(0,g.useDispatch)(E_),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,g.useSelect)(E_);return(0,m.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=rd(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Df(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,g.useSelect)(E_),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===md.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,s.createBlock)((0,s.getDefaultBlockName)())):l()):d.keyCode===md.BACKSPACE||d.keyCode===md.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?a(d.keyCode===md.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===md.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function zf(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),o=(0,u.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,g.useSelect)(E_),{setNavigationMode:s}=(0,g.useDispatch)(E_),a=(0,g.useSelect)((e=>e(E_).isNavigationMode()),[])?void 0:"0",c=(0,u.useRef)();function d(t){if(c.current)c.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{s(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Di.focus.tabbable[n](t.target).focus()}}const p=(0,u.createElement)("div",{ref:t,tabIndex:a,onFocus:d}),f=(0,u.createElement)("div",{ref:n,tabIndex:a,onFocus:d}),h=(0,m.useRefEffect)((a=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===md.ESCAPE)return e.preventDefault(),void s(!0);if(e.keyCode!==md.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===a&&s(!0));if(((0,Di.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Di.isFormElement)(Di.focus.tabbable[i](e.target)))return;const u=o?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=a;e.relatedTarget||t.activeElement!==t.body||0!==i()||a.focus()}function p(o){var r;if(o.keyCode!==md.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Di.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=a,{defaultView:g}=m;return g.addEventListener("keydown",p),a.addEventListener("keydown",u),a.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),a.removeEventListener("keydown",u),a.removeEventListener("focusout",d)}}),[]);return[p,(0,m.useMergeRefs)([e,h]),f]}(),o=(0,g.useSelect)((e=>e(E_).hasMultiSelection()),[]);return[e,(0,m.useMergeRefs)([t,Df(),Lf(),Af(),Of(),xf(),Nf(),Mf(),(0,m.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,k.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}Sf.__unstableElementContext=kf;var Ff=(0,u.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,i]=zf();return(0,u.createElement)(u.Fragment,null,r,(0,u.createElement)("div",c({},o,{ref:(0,m.useMergeRefs)([l,t]),className:p()(o.className,"block-editor-writing-flow")}),n),i)}));function Vf(e){return(0,u.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function Hf(e){let{contentRef:t,children:n,head:o,tabIndex:r=0,scale:l=1,frameSize:i=0,readonly:s,forwardedRef:a,...d}=e;const f=(0,g.useSelect)((e=>e(E_).getSettings().__unstableResolvedAssets),[]),[,v]=(0,u.useReducer)((()=>({}))),[b,_]=(0,u.useState)(),[y,E]=(0,u.useState)([]),C=Vf(null==f?void 0:f.styles),S=C.map((e=>e.id)),w=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(o)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}return e}),[])),[]).filter((e=>!S.includes(e.id))),B=Vf(null==f?void 0:f.scripts),I=Xg(),[x,T,M]=zf(),[N,{height:P}]=(0,m.useResizeObserver)(),L=(0,m.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{readyState:l,documentElement:i}=o;return t=o,("interactive"===l||"complete"===l)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(o),_(o),I(i),E(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir,i.removeChild(o.head),i.removeChild(o.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",o),()=>{var r,l;e.removeEventListener("load",o),null===(r=t)||void 0===r||r.removeEventListener("dragover",n),null===(l=t)||void 0===l||l.removeEventListener("drop",n)}}),[]),R=(0,m.useRefEffect)((e=>{B.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{v()}))}),[]),A=(0,m.useDisabled)({isDisabled:!s}),O=(0,m.useMergeRefs)([t,I,T,A]),D=(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...w].map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const s=t.toLowerCase();return"style"===s?(0,u.createElement)(s,{id:o,key:o},i):(0,u.createElement)(s,{href:n,id:o,rel:r,media:l,key:o})}))),z=(0,u.useMemo)((()=>"<!doctype html>"+(0,u.renderToString)(D)),[]);return(0,u.createElement)(u.Fragment,null,r>=0&&x,(0,u.createElement)("iframe",c({},d,{ref:(0,m.useMergeRefs)([a,L]),tabIndex:r,srcDoc:z,title:(0,k.__)("Editor canvas")}),b&&(0,u.createPortal)((0,u.createElement)(u.Fragment,null,(0,u.createElement)("head",{ref:R},D,o,(0,u.createElement)("style",null,`html { transition: background 5s; ${i?"background: #2f2f2f; transition: background 0s;":""} }`)),(0,u.createElement)("body",{ref:O,className:p()("block-editor-iframe__body","editor-styles-wrapper",...y),style:{marginBottom:`-${P*(1-l)-i}px`,marginTop:i,transform:`scale( ${l} )`}},N,(0,u.createElement)(h.__experimentalStyleProvider,{document:b},n))),b.documentElement)),r>=0&&M)}var Gf=(0,u.forwardRef)((function(e,t){return(0,g.useSelect)((e=>e(E_).getSettings().__internalIsInitialized),[])?(0,u.createElement)(Hf,c({},e,{forwardedRef:t})):null}));function Uf(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var $f=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},jf=function(e){return.2126*$f(e.r)+.7152*$f(e.g)+.0722*$f(e.b)};function Wf(e){e.prototype.luminance=function(){return e=jf(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=jf(l))>(a=jf(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Kf=n(3124),qf=n.n(Kf);const Yf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Zf(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function h(){const e=p(/^([^{]+)/);if(e)return Qf(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Qf(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Yf,""),value:n?Qf(n[0]).replace(Yf,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const k=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=g();for(;r=_();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Qf(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Qf(t[1]),media:Qf(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Qf(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Qf(t[1]),o=Qf(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=h()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Xf(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Qf(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Xf(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Xf(e,o)})):n&&"object"==typeof n&&Xf(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Jf=n(8575),eh=n.n(Jf),th=nh;function nh(e){this.options=e||{}}nh.prototype.emit=function(e){return e},nh.prototype.visit=function(e){return this[e.type](e)},nh.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var oh=rh;function rh(e){th.call(this,e)}eh()(rh,th),rh.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},rh.prototype.comment=function(e){return this.emit("",e.position)},rh.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},rh.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},rh.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},rh.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},rh.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},rh.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},rh.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},rh.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},rh.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},rh.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},rh.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},rh.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},rh.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},rh.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var lh=ih;function ih(e){e=e||{},th.call(this,e),this.indentation=e.indent}eh()(ih,th),ih.prototype.compile=function(e){return this.stylesheet(e)},ih.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ih.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ih.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ih.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ih.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ih.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ih.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ih.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ih.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},ih.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},ih.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ih.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},ih.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ih.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ih.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},ih.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ih.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var sh=function(e,t){try{const r=Zf(e),l=qf().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new oh(o):new lh(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ah(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function ch(e,t){return new URL(e,t).toString()}var uh=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};ah(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ch(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t};const dh=/^(body|html|:root).*$/;var ph=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>{const o=n=>t.includes(n.trim())?n:n.match(dh)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var mh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(ph(t)),o&&r.push(uh(o)),r.length?sh(n,(0,m.compose)(r)):n}))};const gh=".editor-styles-wrapper";function fh(e){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(gh);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=br(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function hh(e){let{styles:t}=e;const n=(0,u.useMemo)((()=>mh(t,gh)),[t]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("style",{ref:fh(t)}),n.map(((e,t)=>(0,u.createElement)("style",{key:t},e))))}let vh;kr([Uf,Wf]);const bh=2e3;function _h(e){let{viewportWidth:t,containerWidth:n,minHeight:o,additionalStyles:r=[]}=e;t||(t=n);const[l,{height:i}]=(0,m.useResizeObserver)(),{styles:s,duotone:a}=(0,g.useSelect)((e=>{var t,n;const o=e(E_).getSettings();return{styles:o.styles,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,u.useMemo)((()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:s),[s,r]),d=(0,u.useMemo)((()=>{var e,t;return[...null!==(e=null==a?void 0:a.default)&&void 0!==e?e:[],...null!==(t=null==a?void 0:a.theme)&&void 0!==t?t:[]]}),[a]);vh=vh||(0,m.pure)(Sf);const p=n/t;return(0,u.createElement)(h.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${p})`,height:i*p,maxHeight:i>bh?bh*p:void 0,minHeight:o}},(0,u.createElement)(Gf,{head:(0,u.createElement)(hh,{styles:c}),contentRef:(0,m.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:bh,minHeight:0!==p&&p<1&&o?o/p:o}},l,d.map((e=>(0,u.createElement)(wr,{preset:e,key:e.slug}))),(0,u.createElement)(vh,{renderAppender:!1})))}function kh(e){const[t,{width:n}]=(0,m.useResizeObserver)();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,u.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,u.createElement)(_h,c({},e,{containerWidth:n}))))}var yh=(0,u.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:o,additionalStyles:r=[],__experimentalMinHeight:l,__experimentalPadding:i}=e;l&&(o=l,W()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],W()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,g.useSelect)((e=>e(E_).getSettings()),[]),a=(0,u.useMemo)((()=>({...s,__unstableIsPreviewMode:!0})),[s]),c=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,u.createElement)(wi,{value:c,settings:a},(0,u.createElement)(kh,{viewportWidth:n,minHeight:o,additionalStyles:r})):null}));function Eh(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,g.useSelect)((e=>e(E_).getSettings()),[]),l=(0,u.useMemo)((()=>({...r,__unstableIsPreviewMode:!0})),[r]),i=(0,m.useDisabled)(),s=(0,m.useMergeRefs)([n.ref,i]),a=(0,u.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),c=(0,u.createElement)(wi,{value:a,settings:l},(0,u.createElement)(Bf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:s,className:p()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?c:null}}var Ch=function(e){var t;let{item:n}=e;const{name:o,title:r,icon:l,description:i,initialAttributes:a,example:c}=n,d=(0,s.isReusableBlock)(n);return(0,u.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,u.createElement)("div",{className:"block-editor-inserter__preview"},d||c?(0,u.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,u.createElement)(yh,{blocks:c?(0,s.getBlockFromExample)(o,{attributes:{...c.attributes,...a},innerBlocks:c.innerBlocks}):(0,s.createBlock)(o,a),viewportWidth:null!==(t=null==c?void 0:c.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,u.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,k.__)("No Preview Available."))),!d&&(0,u.createElement)(Oi,{title:r,icon:l,description:i}))};var Sh=(0,u.createContext)();var wh=(0,u.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const i=(0,u.useContext)(Sh);return(0,u.createElement)(h.__unstableCompositeItem,c({ref:t,state:i,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,u.createElement)(o,t,r):"function"==typeof r?r(t):(0,u.createElement)(h.Button,t,r)}))}));var Bh=e=>{let{isEnabled:t,blocks:n,icon:o,children:r,isPattern:l}=e;const i={type:"inserter",blocks:n};return(0,u.createElement)(h.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,__experimentalDragComponent:(0,u.createElement)(Ap,{count:n.length,icon:o,isPattern:l})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};var Ih=(0,u.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:r,onHover:l,isDraggable:i,...a}=e;const d=(0,u.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},g=(0,u.useMemo)((()=>[(0,s.createBlock)(o.name,o.initialAttributes,(0,s.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]),f=(0,s.isReusableBlock)(o)||(0,s.isTemplatePart)(o);return(0,u.createElement)(Bh,{isEnabled:i&&!o.disabled,blocks:g,icon:o.icon},(e=>{let{draggable:i,onDragStart:s,onDragEnd:g}=e;return(0,u.createElement)("div",{className:p()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:i,onDragStart:e=>{d.current=!0,s&&(l(null),s(e))},onDragEnd:e=>{d.current=!1,g&&g(e)}},(0,u.createElement)(wh,c({isFirst:n,className:p()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),r(o,(0,md.isAppleOS)()?e.metaKey:e.ctrlKey),l(null)},onKeyDown:e=>{const{keyCode:t}=e;t===md.ENTER&&(e.preventDefault(),r(o,(0,md.isAppleOS)()?e.metaKey:e.ctrlKey),l(null))},onMouseEnter:()=>{d.current||l(o)},onMouseLeave:()=>l(null)},a),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,u.createElement)(Ai,{icon:o.icon,showColors:!0})),(0,u.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:3},o.title))))}))}));var xh=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,pn.speak)((0,k.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,u.createElement)("div",c({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var Th=(0,u.forwardRef)((function(e,t){const n=(0,u.useContext)(Sh);return(0,u.createElement)(h.__unstableCompositeGroup,c({state:n,role:"presentation",ref:t},e))}));var Mh=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}=e;return(0,u.createElement)(xh,{className:"block-editor-block-types-list","aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}(t,3).map(((e,t)=>(0,u.createElement)(Th,{key:t},e.map(((e,r)=>(0,u.createElement)(Ih,{key:e.id,item:e,className:(0,s.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r})))))),r)};var Nh=function(e){let{title:t,icon:n,children:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,u.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,u.createElement)(h.Icon,{icon:n})),(0,u.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Ph=(e,t)=>{const{categories:n,collections:o,items:r}=(0,g.useSelect)((t=>{const{getInserterItems:n}=t(E_),{getCategories:o,getCollections:r}=t(s.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,u.useCallback)(((e,n)=>{let{name:o,initialAttributes:r,innerBlocks:l}=e;const i=(0,s.createBlock)(o,r,(0,s.createBlocksFromInnerBlocksTemplate)(l));t(i,void 0,n)}),[t])]};var Lh=function(e){let{children:t}=e;const n=(0,h.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,u.createElement)(Sh.Provider,{value:n},t)};const Rh=[];var Ah=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,s,a]=Ph(t,n),c=(0,u.useMemo)((()=>Y(l,"frecency","desc").slice(0,6)),[l]),d=(0,u.useMemo)((()=>l.filter((e=>!e.category))),[l]),p=(0,u.useMemo)((()=>(0,m.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,f.groupBy)(e,"category")))(l)),[l]),g=(0,u.useMemo)((()=>{const e={...s};return Object.keys(s).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,s]);(0,u.useEffect)((()=>()=>o(null)),[]);const h=(0,m.useAsyncList)(i),v=i.length===h.length,b=(0,u.useMemo)((()=>Object.entries(s)),[s]),_=(0,m.useAsyncList)(v?b:Rh);return(0,u.createElement)(Lh,null,(0,u.createElement)("div",null,r&&!!c.length&&(0,u.createElement)(Nh,{title:(0,k._x)("Most used","blocks")},(0,u.createElement)(Mh,{items:c,onSelect:a,onHover:o,label:(0,k._x)("Most used","blocks")})),h.map((e=>{const t=p[e.slug];return t&&t.length?(0,u.createElement)(Nh,{key:e.slug,title:e.title,icon:e.icon},(0,u.createElement)(Mh,{items:t,onSelect:a,onHover:o,label:e.title})):null})),v&&d.length>0&&(0,u.createElement)(Nh,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,k.__)("Uncategorized")},(0,u.createElement)(Mh,{items:d,onSelect:a,onHover:o,label:(0,k.__)("Uncategorized")})),_.map((e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,u.createElement)(Nh,{key:t,title:n.title,icon:n.icon},(0,u.createElement)(Mh,{items:r,onSelect:a,onHover:o,label:n.title})):null}))))};var Oh=(e,t)=>{const{patternCategories:n,patterns:o}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(E_);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:r}=(0,g.useDispatch)(Nm.store),l=(0,u.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>(0,s.cloneBlock)(e))),t.name),r((0,k.sprintf)((0,k.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,l]};const Dh=e=>{let{showTooltip:t,title:n,children:o}=e;return t?(0,u.createElement)(h.Tooltip,{text:n},o):(0,u.createElement)(u.Fragment,null,o)};function zh(e){let{isDraggable:t,pattern:n,onClick:o,onHover:r,composite:l,showTooltip:i}=e;const[s,a]=(0,u.useState)(!1),{blocks:d,viewportWidth:p}=n,g=`block-editor-block-patterns-list__item-description-${(0,m.useInstanceId)(zh)}`;return(0,u.createElement)(Bh,{isEnabled:t,blocks:d,isPattern:!!n},(e=>{let{draggable:t,onDragStart:m,onDragEnd:f}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{a(!0),m&&(null==r||r(null),m(e))},onDragEnd:e=>{a(!1),f&&f(e)}},(0,u.createElement)(Dh,{showTooltip:i,title:n.title},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},l,{className:"block-editor-block-patterns-list__item",onClick:()=>{o(n,d),null==r||r(null)},onMouseEnter:()=>{s||null==r||r(n)},onMouseLeave:()=>null==r?void 0:r(null),"aria-label":n.title,"aria-describedby":n.description?g:void 0}),(0,u.createElement)(yh,{blocks:d,viewportWidth:p}),!i&&(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,u.createElement)(h.VisuallyHidden,{id:g},n.description))))}))}function Fh(){return(0,u.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Vh=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onHover:r,onClickPattern:l,orientation:i,label:s=(0,k.__)("Block Patterns"),showTitlesAsTooltip:a}=e;const d=(0,h.__unstableUseCompositeState)({orientation:i});return(0,u.createElement)(h.__unstableComposite,c({},d,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((e=>o.includes(e)?(0,u.createElement)(zh,{key:e.name,pattern:e,onClick:l,onHover:r,isDraggable:t,composite:d,showTooltip:a}):(0,u.createElement)(Fh,{key:e.name}))))};function Hh(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,u.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,u.createElement)(h.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Gh(e){let{filterValue:t,setFilterValue:n}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,k.__)("Search for patterns"),placeholder:(0,k.__)("Search")}))}var Uh=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,u.createElement)(Gh,{filterValue:r,setFilterValue:l}),!r&&(0,u.createElement)(Hh,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var $h=function(){return(0,u.createElement)("div",{className:"block-editor-inserter__no-results"},(0,u.createElement)(Jd,{className:"block-editor-inserter__no-results-icon",icon:Ri}),(0,u.createElement)("p",null,(0,k.__)("No results found.")))};var jh=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:r,onSelect:l,shouldFocusBlock:i=!0,selectBlockOnInsert:a=!0}=e;const{getSelectedBlock:c}=(0,g.useSelect)(E_),{destinationRootClientId:d,destinationIndex:p}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(E_),c=l();let u,d=t;return void 0!==n?u=n:o?u=s(o):!r&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,r]),{replaceBlocks:m,insertBlocks:f,showInsertionPoint:h,hideInsertionPoint:v}=(0,g.useDispatch)(E_),b=(0,u.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!r&&o&&(0,s.isUnmodifiedDefaultBlock)(o)?m(o.clientId,e,null,i||n?0:null,t):f(e,p,d,a,i||n?0:null,t);const u=Array.isArray(e)?e.length:1,g=(0,k.sprintf)((0,k._n)("%d block added.","%d blocks added.",u),u);(0,pn.speak)(g),l&&l(e)}),[r,c,m,f,d,p,l,i]),_=(0,u.useCallback)((e=>{e?h(d,p):v()}),[h,v,d,p]);return[d,b,_]},Wh=n(4793),Kh=n.n(Wh);function qh(e){return e.toLowerCase()}var Yh=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zh=/[^A-Z0-9]+/gi;function Qh(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Yh:n,r=t.stripRegexp,l=void 0===r?Zh:r,i=t.transform,s=void 0===i?qh:i,a=t.delimiter,c=void 0===a?" ":a,u=Xh(Xh(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function Xh(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Jh=e=>e.name||"",ev=e=>e.title,tv=e=>e.description||"",nv=e=>e.keywords||[],ov=e=>e.category,rv=()=>null;function lv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Qh(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function iv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Kh()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const sv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return lv(iv(e))},av=(e,t)=>e.filter((e=>!sv(t).some((t=>t.includes(e))))),cv=(e,t,n,o)=>{if(0===sv(o).length)return e;return uv(e,o,{getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===e.category})))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},uv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=sv(t);if(0===o.length)return e;const r=e.map((e=>[e,dv(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function dv(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Jh,getTitle:r=ev,getDescription:l=tv,getKeywords:i=nv,getCategory:s=ov,getCollection:a=rv}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=s(e),g=a(e),f=iv(t),h=iv(u);let v=0;if(f===h)v+=30;else if(h.startsWith(f))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=lv(f);0===av(t,e).length&&(v+=10)}if(0!==v&&c.startsWith("core/")){v+=c!==e.id?1:2}return v}function pv(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,u.createElement)(h.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,k.sprintf)((0,k._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var mv=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,m.useDebounce)(pn.speak,500),[l,i]=jh({shouldFocusBlock:!0}),[s,,a]=Oh(i,l),c=(0,u.useMemo)((()=>o.map((e=>e.name))),[o]),d=(0,u.useMemo)((()=>t?uv(s,t):s.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,s]);(0,u.useEffect)((()=>{if(!t)return;const e=d.length,n=(0,k.sprintf)((0,k._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const p=(0,m.useAsyncList)(d,{step:2}),g=!(null==d||!d.length);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,u.createElement)(pv,{filterValue:t,filteredBlockPatternsLength:d.length}),(0,u.createElement)(Lh,null,!g&&(0,u.createElement)($h,null),g&&(0,u.createElement)(Vh,{shownPatterns:p,blockPatterns:d,onClickPattern:a,isDraggable:!1})))};function gv(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,u.useState)(""),[l,i]=(0,u.useState)(null==t?void 0:t.name);return(0,u.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,u.createElement)(Uh,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,u.createElement)(mv,{filterValue:o,selectedCategory:l,patternCategories:n}))}var fv=function(e){let{onModalClose:t,...n}=e;return(0,u.createElement)(h.Modal,{title:(0,k.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,u.createElement)(gv,n))};function hv(e){let{title:t}=e;return(0,u.createElement)(h.__experimentalVStack,{spacing:0},(0,u.createElement)(h.__experimentalView,null,(0,u.createElement)(h.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,u.createElement)(h.__experimentalHStack,{spacing:2},(0,u.createElement)(h.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,k.isRTL)()?Pi:Li,isSmall:!0,"aria-label":(0,k.__)("Navigate to the previous view")}),(0,u.createElement)(h.__experimentalSpacer,null,(0,u.createElement)(h.__experimentalHeading,{level:5},t))))))}function vv(e){let{categories:t,children:n}=e;return(0,u.createElement)(h.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,u.createElement)(h.__experimentalNavigatorScreen,{path:"/"},(0,u.createElement)(h.__experimentalItemGroup,null,t.map((e=>(0,u.createElement)(h.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:h.__experimentalItem,isAction:!0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jd,{icon:(0,k.isRTL)()?Li:Pi}))))))),t.map((e=>(0,u.createElement)(h.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,u.createElement)(hv,{title:(0,k.__)("Back")}),n(e)))))}function bv(e){const[t,n]=Oh(void 0,e),o=(0,u.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),r=(0,u.useMemo)((()=>{const e=n.filter((e=>t.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].some((e=>["featured","text"].includes(e)))?"featured"===n||"text"===o?-1:1:0}));return t.some((e=>!o(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,k._x)("Uncategorized")}),e}),[t,n]);return r}function _v(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Di.focus.tabbable.find(i.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,u.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,u.createElement)(kv,{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}))}function kv(e){let{rootClientId:t,onInsert:n,onHover:o,category:r,showTitlesAsTooltip:l}=e;const[i,,s]=Oh(n,t),a=bv(t),c=(0,u.useMemo)((()=>i.filter((e=>{var t,n,o;if("uncategorized"!==r.name)return null===(o=e.categories)||void 0===o?void 0:o.includes(r.name);return 0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>a.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[i,r]),d=(0,m.useAsyncList)(c);return(0,u.useEffect)((()=>()=>o(null)),[]),c.length?(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,u.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},r.label),(0,u.createElement)("p",null,r.description),(0,u.createElement)(Vh,{shownPatterns:d,blockPatterns:c,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.label,isDraggable:!0,showTitlesAsTooltip:l})):null}var yv=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:o,rootClientId:r}=e;const[l,i]=(0,u.useState)(!1),s=bv(r),a=n||s[0],c=(0,m.useViewportMatch)("medium","<");return(0,u.createElement)(u.Fragment,null,!c&&(0,u.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,u.createElement)("nav",{"aria-label":(0,k.__)("Block pattern categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},s.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.label),(0,u.createElement)(Jd,{icon:Pi}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,k.__)("Explore all patterns")))))),c&&(0,u.createElement)(vv,{categories:s},(e=>(0,u.createElement)(kv,{onInsert:o,rootClientId:r,category:e,showTitlesAsTooltip:!1}))),l&&(0,u.createElement)(fv,{initialCategory:a,patternCategories:s,onModalClose:()=>i(!1)}))},Ev=window.wp.url;function Cv(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Ph(o,n),i=(0,u.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,u.createElement)($h,null):(0,u.createElement)(Nh,{title:(0,k.__)("Reusable blocks")},(0,u.createElement)(Mh,{items:i,onSelect:l,onHover:t,label:(0,k.__)("Reusable blocks")}))}var Sv=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Cv,{onHover:o,onInsert:n,rootClientId:t}),(0,u.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,u.createElement)(h.Button,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,Ev.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,k.__)("Manage Reusable blocks"))))};function wv(e){const[t,n]=(0,u.useState)([]),{canInsertImage:o,canInsertVideo:r,canInsertAudio:l}=(0,g.useSelect)((t=>{const{canInsertBlockType:n}=t(E_);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),i=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,g.useSelect)((e=>{const t=e(E_).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),o=(0,u.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&(!!e.isExternalResource||Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`))))))}),[e,t,n]);return o}();return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!i)return;const t=new Map(await Promise.all(i.map((async e=>{if(e.isExternalResource)return[e.name,!0];const t=await e.fetch({per_page:1});return[e.name,!!t.length]})))),s={image:o,video:r,audio:l};i.forEach((n=>{s[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,r,l,i]),t}var Bv=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const Iv={image:"img",video:"video",audio:"audio"};function xv(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=Iv[t],i=(0,u.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=o)}});return[(0,s.createBlock)(`core/${t}`,n),i]}const Tv={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Mv(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const o=t.getReportUrl(n);return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,k.__)("Options"),popoverProps:Tv,icon:Mm},(()=>(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:Bv},(0,k.sprintf)((0,k.__)("Report %s"),t.mediaType)))))}function Nv(e){var t;let{media:n,onClick:o,composite:r,category:l}=e;const[i,s]=(0,u.useState)(!1),[a,d]=(0,u.useMemo)((()=>xv(n,l.mediaType)),[n,l.mediaType]),m=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let g;if(m.length>25){const e="...";g=m.slice(0,25-e.length)+e}const f=(0,u.useCallback)((()=>s(!0)),[]),v=(0,u.useCallback)((()=>s(!1)),[]);return(0,u.createElement)(Bh,{isEnabled:!0,blocks:[a]},(e=>{let{draggable:t,onDragStart:s,onDragEnd:b}=e;return(0,u.createElement)("div",{className:p()("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:s,onDragEnd:b},(0,u.createElement)(h.Tooltip,{text:g||m},(0,u.createElement)("div",{onMouseEnter:f,onMouseLeave:v},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},r,{className:"block-editor-inserter__media-list__item",onClick:()=>o(a),"aria-label":m}),(0,u.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},d)),(0,u.createElement)(Mv,{category:l,media:n}))))}))}var Pv=function(e){let{mediaList:t,category:n,onClick:o,label:r=(0,k.__)("Media List")}=e;const l=(0,h.__unstableUseCompositeState)(),i=(0,u.useCallback)((e=>{o((0,s.cloneBlock)(e))}),[o]);return(0,u.createElement)(h.__unstableComposite,c({},l,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r}),t.map(((e,t)=>(0,u.createElement)(Nv,{key:e.id||e.sourceId||t,media:e,category:n,onClick:i,composite:l}))))};function Lv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,u.useState)(e),[o,r]=(0,u.useState)(e),l=(0,m.useDebounce)(r,250);return(0,u.useEffect)((()=>{o!==t&&l(t)}),[o,t]),[t,n,o]}function Rv(e){let{rootClientId:t,onInsert:n,category:o}=e;const r=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Di.focus.tabbable.find(r.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,u.createElement)("div",{ref:r,className:"block-editor-inserter__media-dialog"},(0,u.createElement)(Av,{rootClientId:t,onInsert:n,category:o}))}function Av(e){let{rootClientId:t,onInsert:n,category:o}=e;const[r,l,i]=Lv(),{mediaList:s,isLoading:a}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{var n;const r=JSON.stringify({category:e.name,...t});i.current=r,l(!0),o([]);const s=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));r===i.current&&(o(s),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(o,{per_page:i?20:10,search:i}),c="block-editor-inserter__media-panel",d=o.labels.search_items||(0,k.__)("Search");return(0,u.createElement)("div",{className:c},(0,u.createElement)(h.SearchControl,{className:`${c}-search`,onChange:l,value:r,label:d,placeholder:d}),a&&(0,u.createElement)("div",{className:`${c}-spinner`},(0,u.createElement)(h.Spinner,null)),!a&&!(null!=s&&s.length)&&(0,u.createElement)($h,null),!a&&!(null==s||!s.length)&&(0,u.createElement)(Pv,{rootClientId:t,onClick:n,mediaList:s,category:o}))}var Ov=function(e){let{fallback:t=null,children:n}=e;const o=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return!!t().mediaUpload}),[]);return o?n:t};var Dv=(0,h.withFilters)("editor.MediaUpload")((()=>null));const zv=["image","video","audio"];var Fv=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:o,onInsert:r}=e;const l=wv(t),i=(0,m.useViewportMatch)("medium","<"),s="block-editor-inserter__media-tabs",a=(0,u.useCallback)((e=>{if(null==e||!e.url)return;const[t]=xv(e,e.type);r(t)}),[r]),c=(0,u.useMemo)((()=>l.map((e=>({...e,label:e.labels.name})))),[l]);return(0,u.createElement)(u.Fragment,null,!i&&(0,u.createElement)("div",{className:`${s}-container`},(0,u.createElement)("nav",{"aria-label":(0,k.__)("Media categories")},(0,u.createElement)(h.__experimentalItemGroup,{role:"list",className:s},l.map((e=>(0,u.createElement)(h.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>o(e),className:p()(`${s}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,u.createElement)(h.__experimentalHStack,null,(0,u.createElement)(h.FlexBlock,null,e.labels.name),(0,u.createElement)(Jd,{icon:Pi}))))),(0,u.createElement)("div",{role:"listitem"},(0,u.createElement)(Ov,null,(0,u.createElement)(Dv,{multiple:!1,onSelect:a,allowedTypes:zv,render:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,k.__)("Open Media Library"))}})))))),i&&(0,u.createElement)(vv,{categories:c},(e=>(0,u.createElement)(Av,{onInsert:r,rootClientId:t,category:e}))))};const{Fill:Vv,Slot:Hv}=(0,h.createSlotFill)("__unstableInserterMenuExtension");Vv.Slot=Hv;var Gv=Vv;const Uv=[];var $v=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:s,maxBlockPatterns:a,maxBlockTypes:c,showBlockDirectory:d=!1,isDraggable:p=!0,shouldFocusBlock:g=!0,prioritizePatterns:f,selectBlockOnInsert:v}=e;const b=(0,m.useDebounce)(pn.speak,500),[_,y]=jh({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:g,selectBlockOnInsert:v}),[E,C,S,w]=Ph(_,y),[B,,I]=Oh(y,_),x=(0,u.useMemo)((()=>{if(0===a)return[];const e=uv(B,t);return void 0!==a?e.slice(0,a):e}),[t,B,a]);let T=c;f&&x.length>2&&(T=0);const M=(0,u.useMemo)((()=>{if(0===T)return[];const e=cv(Y(E,"frecency","desc"),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,c]);(0,u.useEffect)((()=>{if(!t)return;const e=M.length+x.length,n=(0,k.sprintf)((0,k._n)("%d result found.","%d results found.",e),e);b(n)}),[t,b]);const N=(0,m.useAsyncList)(M,{step:9}),P=(0,m.useAsyncList)(N.length===M.length?x:Uv),L=M.length>0||x.length>0,R=!!M.length&&(0,u.createElement)(Nh,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,k.__)("Blocks"))},(0,u.createElement)(Mh,{items:N,onSelect:w,onHover:o,label:(0,k.__)("Blocks"),isDraggable:p})),A=!!x.length&&(0,u.createElement)(Nh,{title:(0,u.createElement)(h.VisuallyHidden,null,(0,k.__)("Block Patterns"))},(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,u.createElement)(Vh,{shownPatterns:P,blockPatterns:x,onClickPattern:I,onHover:o,isDraggable:p})));return(0,u.createElement)(Lh,null,!d&&!L&&(0,u.createElement)($h,null),f?A:R,!!M.length&&!!x.length&&(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),f?R:A,d&&(0,u.createElement)(Gv.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:L,rootClientId:_}},(e=>e.length?e:L?null:(0,u.createElement)($h,null))))};const jv={name:"blocks",title:(0,k.__)("Blocks")},Wv={name:"patterns",title:(0,k.__)("Patterns")},Kv={name:"reusable",title:(0,k.__)("Reusable"),icon:U},qv={name:"media",title:(0,k.__)("Media")};var Yv=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,showMedia:r=!1,onSelect:l,prioritizePatterns:i}=e;const s=(0,u.useMemo)((()=>{const e=[];return i&&n&&e.push(Wv),e.push(jv),!i&&n&&e.push(Wv),r&&e.push(qv),o&&e.push(Kv),e}),[i,jv,n,Wv,o,r,Kv]);return(0,u.createElement)(h.TabPanel,{className:"block-editor-inserter__tabs",tabs:s,onSelect:l},t)};var Zv=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:s,showMostUsedBlocks:a,__experimentalFilterValue:c="",shouldFocusBlock:d=!0,prioritizePatterns:m}=e;const[f,v,b]=Lv(c),[_,y]=(0,u.useState)(null),[E,C]=(0,u.useState)(null),[S,w]=(0,u.useState)(null),[B,I]=(0,u.useState)(null),[x,T,M]=jh({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:N,inserterItems:P}=(0,g.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(E_);return{showPatterns:!!t(x).length,inserterItems:n(x)}}),[x]),L=(0,u.useMemo)((()=>P.some((e=>{let{category:t}=e;return"reusable"===t}))),[P]),R=!!wv(x).length,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),i()}),[T,i]),O=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),i()}),[T,i]),D=(0,u.useCallback)((e=>{M(!!e),y(e)}),[M,y]),z=(0,u.useCallback)((e=>{M(!!e)}),[M]),F=(0,u.useCallback)((e=>{C(e)}),[C]),V=(0,u.useMemo)((()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:"block-editor-inserter__block-list"},(0,u.createElement)(Ah,{rootClientId:x,onInsert:A,onHover:D,showMostUsedBlocks:a})),s&&(0,u.createElement)("div",{className:"block-editor-inserter__tips"},(0,u.createElement)(h.VisuallyHidden,{as:"h2"},(0,k.__)("A tip for using the block editor")),(0,u.createElement)(Ni,null)))),[x,A,D,b,a,s]),H=(0,u.useMemo)((()=>(0,u.createElement)(yv,{rootClientId:x,onInsert:O,onSelectCategory:F,selectedCategory:E})),[x,O,F,E]),G=(0,u.useMemo)((()=>(0,u.createElement)(Sv,{rootClientId:x,onInsert:A,onHover:D})),[x,A,D]),U=(0,u.useMemo)((()=>(0,u.createElement)(Fv,{rootClientId:x,selectedCategory:S,onSelectCategory:w,onInsert:A})),[x,A,S,w]),$=(0,u.useCallback)((e=>"blocks"===e.name?V:"patterns"===e.name?H:"reusable"===e.name?G:"media"===e.name?U:void 0),[V,H,G,U]),j=(0,u.useRef)();(0,u.useImperativeHandle)(t,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&E,K=!b&&(N||L||R),q="media"===B&&!b&&S;return(0,u.createElement)("div",{className:"block-editor-inserter__menu"},(0,u.createElement)("div",{className:p()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{_&&y(null),v(e)},value:f,label:(0,k.__)("Search for blocks and patterns"),placeholder:(0,k.__)("Search"),ref:j}),!!b&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,u.createElement)($v,{filterValue:b,onSelect:i,onHover:D,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d})),K&&(0,u.createElement)(Yv,{showPatterns:N,showReusableBlocks:L,showMedia:R,prioritizePatterns:m,onSelect:I},$),!b&&!K&&(0,u.createElement)("div",{className:"block-editor-inserter__no-tab-container"},V)),q&&(0,u.createElement)(Rv,{rootClientId:x,onInsert:A,category:S}),s&&_&&(0,u.createElement)(Ch,{item:_}),W&&(0,u.createElement)(_v,{rootClientId:x,onInsert:O,onHover:z,category:E,showTitlesAsTooltip:!0}))}));function Qv(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l,selectBlockOnInsert:i}=e;const[s,a]=(0,u.useState)(""),[c,d]=jh({onSelect:t,rootClientId:n,clientId:o,isAppender:r,selectBlockOnInsert:i}),[m]=Ph(c,d),[f]=Oh(d,c),{setInserterIsOpened:v,insertionIndex:b}=(0,g.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(E_),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),_=f.length&&(!!s||l),y=_&&f.length>6||m.length>6;(0,u.useEffect)((()=>{v&&v(!1)}),[v]);let E=0;return _&&(E=l?4:2),(0,u.createElement)("div",{className:p()("block-editor-inserter__quick-inserter",{"has-search":y,"has-expand":v})},y&&(0,u.createElement)(h.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:s,onChange:e=>{a(e)},label:(0,k.__)("Search for blocks and patterns"),placeholder:(0,k.__)("Search")}),(0,u.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,u.createElement)($v,{filterValue:s,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:E,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l,selectBlockOnInsert:i})),v&&(0,u.createElement)(h.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:s})},"aria-label":(0,k.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,k.__)("Browse all")))}const Xv=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:i,toggleProps:s={},prioritizePatterns:a}=e;t=i?(0,k.sprintf)((0,k._x)("Add %s","directly add the only allowed block"),l):a?(0,k.__)("Add pattern"):(0,k._x)("Add block","Generic label for block inserter button");const{onClick:d,...p}=s;return(0,u.createElement)(h.Button,c({icon:Ti,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!i&&"true","aria-expanded":!i&&r,disabled:o},p))};class Jv extends u.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=Xv,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:s,onSelectOrClose:a,selectBlockOnInsert:c}=this.props;return i?(0,u.createElement)(Qv,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;a&&"function"==typeof a&&a(n),t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:s,selectBlockOnInsert:c}):(0,u.createElement)(Zv,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,prioritizePatterns:s})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,u.createElement)(h.Dropdown,{className:"block-editor-inserter",contentClassName:p()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,k.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var eb=(0,m.compose)([(0,g.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:r,shouldDirectInsert:l=!0}=t;const{getBlockRootClientId:i,hasInserterItems:a,getAllowedBlocks:c,__experimentalGetDirectInsertBlock:u,getSettings:d}=e(E_),{getBlockVariations:p}=e(s.store);r=r||i(o)||void 0;const m=c(r),g=l&&u(r),f=d(),h=1===(null==m?void 0:m.length)&&0===(null===(n=p(m[0].name,"inserter"))||void 0===n?void 0:n.length);let v=!1;return h&&(v=m[0]),{hasItems:a(r),hasSingleBlockType:h,blockTitle:v?v.title:"",allowedBlockType:v,directInsertBlock:g,rootClientId:r,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!r}})),(0,g.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(E_);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=o(E_);if(!e||!r&&!n)return{};const i={};let s={};if(r){const e=t(r),n=t(l(r));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);m=(0,s.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,s.createBlock)(a.name);var g;(p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:s}=o(E_);if(r)return e(r);const a=t();return!l&&a&&s(a)===n?e(a)+1:i(n).length}(),n,d),u)&&u({clientId:null===(g=m)||void 0===g?void 0:g.clientId});const f=(0,k.sprintf)((0,k.__)("%s block added"),a.title);(0,pn.speak)(f)}}})),(0,m.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Jv);const tb=(0,u.forwardRef)(((e,t)=>{let{nestingLevel:n,blockCount:o,...r}=e;const[l,i]=(0,u.useState)(null),s=(0,m.useInstanceId)(tb),{hideInserter:a,clientId:d}=(0,g.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:n,getSelectedBlockClientId:o}=e(E_),r=o();return{clientId:o(),hideInserter:!!t(r)||"zoom-out"===n()}}),[]),p=xi({clientId:d,context:"list-view"}),f=xi({clientId:null==l?void 0:l.clientId,context:"list-view"});if((0,u.useEffect)((()=>{null!=f&&f.length&&(0,pn.speak)((0,k.sprintf)((0,k.__)("%s block inserted"),f),"assertive")}),[f]),a)return null;const h=`off-canvas-editor-appender__${s}`,v=(0,k.sprintf)((0,k.__)("Append to %1$s block at position %2$d, Level %3$d"),p,o+1,n);return(0,u.createElement)("div",{className:"offcanvas-editor-appender"},(0,u.createElement)(eb,c({ref:t,rootClientId:d,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0},r,{toggleProps:{"aria-describedby":h},onSelectOrClose:e=>{null!=e&&e.clientId&&i(e)}})),(0,u.createElement)("div",{className:"offcanvas-editor-appender__description",id:h},v))})),nb=Zu(h.__experimentalTreeGridRow);function ob(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:i,path:s,...a}=e;const d=Ju({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s});return(0,u.createElement)(nb,c({ref:d,className:p()("block-editor-list-view-leaf","offcanvas-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r},a),l)}var rb=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));var lb=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));var ib=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));function sb(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jd,{icon:(0,k.isRTL)()?lb:ib}))}var ab=(0,u.forwardRef)((function(e,t){let{className:n,block:o,onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:s,onDragStart:a,onDragEnd:c,draggable:d}=e;const{clientId:m}=o,g=Ii(m),f=xi({clientId:m,context:"list-view"}),{isLocked:v}=og(m),b=g?(0,k.sprintf)((0,k.__)("Edit %s block"),g.title):(0,k.__)("Edit");return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==md.ENTER&&e.keyCode!==md.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==a||a(e)},onDragEnd:c,draggable:d,href:`#block-${m}`,"aria-hidden":!0,title:b},(0,u.createElement)(sb,{onClick:l}),(0,u.createElement)(Ai,{icon:null==g?void 0:g.icon,showColors:!0,context:"list-view"}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},f)),(null==g?void 0:g.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},g.anchor)),v&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jd,{icon:rb})))))})),cb=window.wp.escapeHtml;const ub=()=>{};var db=e=>{let{value:t,onChange:n=ub,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,u.createElement)(h.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,u.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,k.__)("Currently selected link settings")),l)},pb=n(5425),mb=n.n(pb);function gb(e){return"function"==typeof e}class fb extends u.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,u.createRef)(),this.inputRef=(0,u.createRef)(),this.updateSuggestions=(0,m.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,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,mb()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.state.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),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.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);var l,i;if(t=t.trim(),!r&&(t.length<2||!o&&(0,Ev.isURL)(t)))return null===(l=this.suggestionsRequest)||void 0===l||null===(i=l.cancel)||void 0===i||i.call(l),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const s=n(t,{isInitialSuggestions:r});s.then((e=>{this.suggestionsRequest===s&&(this.setState({suggestions:e,isUpdatingSuggestions:!1,suggestionsValue:t,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,k.sprintf)((0,k._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,k.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===s&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=s}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case md.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case md.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case md.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case md.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case md.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case md.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,k.__)("Link selected.")));break;case md.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,u.createElement)(u.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,k.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s=""}=this.props,{loading:a,showSuggestions:d,selectedSuggestion:m,suggestionsListboxId:g,suggestionOptionIdPrefix:f}=this.state,v=`url-input-control-${r}`,b={id:v,label:t,className:p()("block-editor-url-input",n,{"is-full-width":o})},_={id:v,value:s,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,k.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-controls":g,"aria-activedescendant":null!==m?`${f}-${m}`:void 0,ref:this.inputRef};return i?i(b,_,a):(e||W()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,u.createElement)(h.BaseControl,c({__nextHasNoMarginBottom:e},b),(0,u.createElement)("input",_),a&&(0,u.createElement)(h.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:s,loading:a}=this.state;if(!n||0===o.length)return null;const d={id:i,ref:this.autocompleteRef,role:"listbox"},m=(e,t)=>({role:"option",tabIndex:"-1",id:`${s}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l});return gb(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:d,buildSuggestionItemProps:m,isLoading:a,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=r&&r.length),currentInputValue:r}):(0,u.createElement)(h.Popover,{placement:"bottom",focusOnMount:!1},(0,u.createElement)("div",c({},d,{className:p()("block-editor-url-input__suggestions",`${e}__suggestions`)}),o.map(((e,t)=>(0,u.createElement)(h.Button,c({},m(0,t),{key:e.id,className:p()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)}),e.title)))))}}var hb=(0,m.compose)(m.withSafeTimeout,h.withSpokenMessages,m.withInstanceId,(0,g.withSelect)(((e,t)=>{if(gb(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(E_);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(fb);var vb=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:i}=e;return n?(t=i?"function"==typeof i?i(n):i:(0,u.createInterpolateElement)((0,k.sprintf)((0,k.__)("Create: <mark>%s</mark>"),n),{mark:(0,u.createElement)("mark",null)}),(0,u.createElement)(h.Button,c({},r,{className:p()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,u.createElement)(Jd,{className:"block-editor-link-control__search-item-icon",icon:Ti}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var bb=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var _b=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var kb=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var yb=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var Eb=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var Cb=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Sb={post:bb,page:_b,post_tag:kb,category:yb,attachment:Eb};function wb(e){let{isURL:t,suggestion:n}=e,o=null;return t?o=Cb:n.type in Sb&&(o=Sb[n.type]),o?(0,u.createElement)(Jd,{className:"block-editor-link-control__search-item-icon",icon:o}):null}var Bb=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:i="",shouldShowType:s=!1}=e;return(0,u.createElement)(h.Button,c({},t,{onClick:r,className:p()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),(0,u.createElement)(wb,{suggestion:n,isURL:l}),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,u.createElement)(h.TextHighlight,{text:n.title,highlight:i})),(0,u.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,Ev.filterURLForDisplay)((0,Ev.safeDecodeURI)(n.url))||""),l&&(0,k.__)("Press ENTER to add this link"))),s&&n.type&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){if(e.isFrontPage)return"front page";return"post_tag"===e.type?"tag":e.type}(n)))};const Ib="__CREATE__",xb="mailto",Tb="internal",Mb=["URL",xb,"tel",Tb],Nb=[{id:"opensInNewTab",title:(0,k.__)("Open in new tab")}];function Pb(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:i,suggestions:s,selectedSuggestion:a,isLoading:d,isInitialSuggestions:m,createSuggestionButtonText:g,suggestionsQuery:f}=e;const v=p()("block-editor-link-control__search-results",{"is-loading":d}),b=1===s.length&&Mb.includes(s[0].type),_=n&&!b&&!m,y=!(null!=f&&f.type),E=`block-editor-link-control-search-results-label-${t}`,C=m?(0,k.__)("Recently updated"):(0,k.sprintf)((0,k.__)('Search results for "%s"'),o),S=(0,u.createElement)(m?u.Fragment:h.VisuallyHidden,{},(0,u.createElement)("span",{className:"block-editor-link-control__search-results-label",id:E},C));return(0,u.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,u.createElement)("div",c({},l,{className:v,"aria-labelledby":E}),s.map(((e,t)=>_&&Ib===e.type?(0,u.createElement)(vb,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:i(e,t),isSelected:t===a}):Ib===e.type?null:(0,u.createElement)(Bb,{key:`${e.id}-${e.type}`,itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===a,isURL:Mb.includes(e.type),searchTerm:o,shouldShowType:y,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Lb(e){const t=null==e?void 0:e.startsWith("#");return(0,Ev.isURL)(e)||e&&e.includes("www.")||t}const Rb=()=>Promise.resolve([]),Ab=e=>{let t="URL";const n=(0,Ev.getProtocol)(e)||"";return n.includes("mailto")&&(t=xb),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=Tb),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Ev.prependHTTP)(e):e,type:t}])};function Ob(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Ab:Rb;return(0,u.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Lb(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Lb(e)||!r?c:c.concat({title:e,url:e,type:Ib})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}const Db=()=>Promise.resolve([]),zb=()=>{},Fb=(0,u.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:a=zb,onChange:c=zb,onSelect:d=zb,showSuggestions:g=!0,renderSuggestions:f=(e=>(0,u.createElement)(Pb,e)),fetchSuggestions:h=null,allowDirectEntry:v=!0,showInitialSuggestions:b=!1,suggestionsQuery:_={},withURLSuggestion:y=!0,createSuggestionButtonText:E,useLabel:C=!1}=e;const S=Ob(_,v,s,y),w=g?h||S:Db,B=(0,m.useInstanceId)(Fb),[I,x]=(0,u.useState)(),T=async e=>{let t=e;if(Ib!==e.type){if(v||t&&Object.keys(t).length>=1){const{id:e,url:n,...o}=null!=r?r:{};d({...o,...t},t)}}else try{var n;t=await a(e.title),null!==(n=t)&&void 0!==n&&n.url&&d(t)}catch(e){}},M=p()(l,{"has-no-label":!C});return(0,u.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,u.createElement)(hb,{__nextHasNoMarginBottom:!0,label:C?"URL":void 0,className:M,value:n,onChange:(e,t)=>{c(e),x(t)},placeholder:null!=i?i:(0,k.__)("Search or type url"),__experimentalRenderSuggestions:g?e=>f({...e,instanceId:B,withCreateSuggestion:s,createSuggestionButtonText:E,suggestionsQuery:_,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(e,t)=>{var o;const r=e||I;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?T(r||{url:n}):t.preventDefault()},ref:t}),o)}));var Vb=Fb;var Hb=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));var Gb=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:Ub,Fill:$b}=(0,h.createSlotFill)("BlockEditorLinkControlViewer");function jb(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}var Wb=function(e){const[t,n]=(0,u.useReducer)(jb,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function Kb(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const s=r?null==n?void 0:n.url:null,{richData:a,isFetching:c}=Wb(s),d=a&&Object.keys(a).length,m=n&&(0,Ev.filterURLForDisplay)((0,Ev.safeDecodeURI)(n.url),16)||"",g=(null==a?void 0:a.title)||(null==n?void 0:n.title)||m,f=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let v;return v=null!=a&&a.icon?(0,u.createElement)("img",{src:null==a?void 0:a.icon,alt:""}):f?(0,u.createElement)(Jd,{icon:Hb,size:32}):(0,u.createElement)(Jd,{icon:Cb}),(0,u.createElement)("div",{"aria-label":(0,k.__)("Currently selected"),className:p()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!c,"is-preview":!0,"is-error":f})},(0,u.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,u.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,u.createElement)("span",{className:p()("block-editor-link-control__search-item-icon",{"is-image":null==a?void 0:a.icon})},v),(0,u.createElement)("span",{className:"block-editor-link-control__search-item-details"},f?(0,u.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,k.__)("Link is empty")):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Di.__unstableStripHTML)(g)),(null==n?void 0:n.url)&&(0,u.createElement)("span",{className:"block-editor-link-control__search-item-info"},m)))),(0,u.createElement)(h.Button,{icon:Gb,label:(0,k.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,u.createElement)(h.Button,{icon:nl,label:(0,k.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,u.createElement)(Ub,{fillProps:n})),!!(d&&(null!=a&&a.image||null!=a&&a.description)||c)&&(0,u.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==a?void 0:a.image)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=a&&a.image),className:p()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=a&&a.image)})},(null==a?void 0:a.image)&&(0,u.createElement)("img",{src:null==a?void 0:a.image,alt:""})),((null==a?void 0:a.description)||c)&&(0,u.createElement)("div",{"aria-hidden":!(null!=a&&a.description),className:p()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=a&&a.description)})},(null==a?void 0:a.description)&&(0,u.createElement)(h.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))))}const qb=e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};function Yb(e){const[t,n]=(0,u.useState)(e||"");return(0,u.useEffect)((()=>{e&&e!==t&&n(e)}),[e]),[t,n]}const Zb=()=>{};function Qb(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Nb,onChange:s=Zb,onRemove:a,onCancel:c,noDirectEntry:d=!1,showSuggestions:m=!0,showInitialSuggestions:g,forceIsEditingLink:f,createSuggestion:v,withCreateSuggestion:b,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===b&&v&&(b=!0);const I=(0,u.useRef)(!0),x=(0,u.useRef)(),T=(0,u.useRef)(),M=(0,u.useRef)(!1),[N,P]=Yb((null==l?void 0:l.url)||""),[L,R]=Yb((null==l?void 0:l.title)||""),[A,O]=(0,u.useState)(void 0!==f?f:!l||!l.url),{createPage:D,isCreatingPage:z,errorMessage:F}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[r,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=qb(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,k.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(v);(0,u.useEffect)((()=>{void 0!==f&&f!==A&&O(f)}),[f]),(0,u.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(Di.focus.focusable.find(x.current)[e]||x.current).focus(),M.current=!1}),[A,z]);const V=(null==l||null===(t=l.url)||void 0===t||null===(n=t.trim())||void 0===n?void 0:n.length)>0,H=()=>{var e;M.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),O(!1)},G=()=>{U===(null==l?void 0:l.url)&&L===(null==l?void 0:l.title)||s({...l,url:U,title:L}),H()},U=_||N,$=!(null!=U&&null!==(o=U.trim())&&void 0!==o&&o.length),j=a&&l&&!A&&!z,W=!(null==i||!i.length),K=V&&w,q=(A||!l)&&!z;return(0,u.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},z&&(0,u.createElement)("div",{className:"block-editor-link-control__loading"},(0,u.createElement)(h.Spinner,null)," ",(0,k.__)("Creating"),"…"),q&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:p()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":K})},K&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:L,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==md.ENTER||$||(e.preventDefault(),G())}}),(0,u.createElement)(Vb,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:U,withCreateSuggestion:b,onCreateSuggestion:D,onChange:P,onSelect:e=>{s({...e,title:L||(null==e?void 0:e.title)}),H()},showInitialSuggestions:g,allowDirectEntry:!d,showSuggestions:m,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:K})),F&&(0,u.createElement)(h.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},F)),l&&!A&&!z&&(0,u.createElement)(Kb,{key:null==l?void 0:l.url,value:l,onEditClick:()=>O(!0),hasRichPreviews:S,hasUnlinkControl:j,onRemove:a}),(0,u.createElement)("div",{className:"block-editor-link-control__drawer"},W&&(0,u.createElement)("div",{className:"block-editor-link-control__tools"},(0,u.createElement)(db,{value:l,settings:i,onChange:s})),q&&(0,u.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:G,className:"xblock-editor-link-control__search-submit",disabled:$},(0,k.__)("Apply")),(0,u.createElement)(h.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),P(null==l?void 0:l.url),R(null==l?void 0:l.title),V?H():null==a||a(),null==c||c()}},(0,k.__)("Cancel")))),B&&B())}Qb.ViewerFill=$b;var Xb=Qb;function Jb(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function e_(e){let{clientId:t}=e;const{getBlock:n,blockTransforms:o}=(0,g.useSelect)((e=>{const{getBlock:n,getBlockRootClientId:o,getBlockTransformItems:r}=e(E_);return{getBlock:n,blockTransforms:r(n(t),o(t))}}),[t]),{replaceBlock:r}=(0,g.useDispatch)(E_),l=["core/page-list","core/site-logo","core/social-links","core/search"],i=o.filter((e=>l.includes(e.name)));return null!=i&&i.length&&t?(0,u.createElement)("div",{className:"link-control-transform"},(0,u.createElement)("h3",{className:"link-control-transform__subheading"},(0,k.__)("Transform")),(0,u.createElement)("div",{className:"link-control-transform__items"},i.map((e=>(0,u.createElement)(h.Button,{key:`transform-${e.name}`,onClick:()=>r(t,(0,s.switchToBlockType)(n(t),e.name)),className:"link-control-transform__item"},(0,u.createElement)(Ai,{icon:e.icon}),e.title))))):null}function t_(e){const{label:t,url:n,opensInNewTab:o,type:r,kind:l}=e.link,i={url:n,opensInNewTab:o,title:t&&(0,Di.__unstableStripHTML)(t)};return(0,u.createElement)(h.Popover,{placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0},(0,u.createElement)(Xb,{hasTextControl:!0,hasRichPreviews:!0,className:e.className,value:i,showInitialSuggestions:!0,withCreateSuggestion:e.hasCreateSuggestion,noDirectEntry:!!r,noURLSuggestion:!!r,suggestionsQuery:Jb(r,l),onChange:e.onChange,onRemove:e.onRemove,renderControlBottom:n?null:()=>(0,u.createElement)(e_,{clientId:e.clientId})}))}const n_=["core/navigation-link","core/navigation-submenu"],o_=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:s,level:a,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,[v,b]=(0,u.useState)(),{blockMovingClientId:_,selectedBlockInBlockEditor:k,lastInsertedBlockClientId:y}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n,getLastInsertedBlocksClientIds:o}=__(e(E_)),r=o();return{blockMovingClientId:t(),selectedBlockInBlockEditor:n(),lastInsertedBlockClientId:r&&r[0]}}),[h]),{insertedBlockAttributes:E,insertedBlockName:C,setInsertedBlockAttributes:S}=(e=>{const{insertedBlockAttributes:t,insertedBlockName:n}=(0,g.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(E_);return{insertedBlockAttributes:o(e),insertedBlockName:n(e)}}),[e]),{updateBlockAttributes:o}=(0,g.useDispatch)(E_),r=t=>{e&&o(e,t)};return e?{insertedBlockAttributes:t,insertedBlockName:n,setInsertedBlockAttributes:r}:{insertedBlockAttributes:void 0,insertedBlockName:void 0,setInsertedBlockAttributes:r}})(y),w=null==E?void 0:E.id;(0,u.useEffect)((()=>{h===y&&null!=n_&&n_.includes(C)&&!w&&b(!0)}),[y,h,C,w]);const B=_&&k===h,I=p()("block-editor-list-view-block-contents",{"is-dropping-before":B}),x=m.includes(h)?m:[h];return(0,u.createElement)(u.Fragment,null,v&&(0,u.createElement)(t_,{clientId:y,link:E,onClose:()=>b(!1),hasCreateSuggestion:!1,onChange:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:l=""}=n,{title:i="",url:s="",opensInNewTab:a,id:c,kind:u=r,type:d=l}=e,p=i.replace(/http(s?):\/\//gi,""),m=s.replace(/http(s?):\/\//gi,""),g=i&&i!==o&&p!==m?(0,cb.escapeHTML)(i):o||(0,cb.escapeHTML)(m),f="post_tag"===d?"tag":d.replace("-","_"),h=["post","page","tag","category"].indexOf(f)>-1,v=!u&&!h||"custom"===u?"custom":u;t({...s&&{url:encodeURI((0,Ev.safeDecodeURI)(s))},...g&&{label:g},...void 0!==a&&{opensInNewTab:a},...c&&Number.isInteger(c)&&{id:c},...v&&{kind:v},...f&&"URL"!==f&&{type:f}})}(e,S,E),b(!1)}}),(0,u.createElement)(Op,{clientIds:x},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(ab,c({ref:t,className:I,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:s,level:a,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))})))}));var r_=o_;const l_=(0,u.createContext)({}),i_=()=>(0,u.useContext)(l_);var s_=(0,u.memo)((function e(t){let{block:{clientId:n},isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,u.useRef)(null),[S,w]=(0,u.useState)(!1),{isLocked:B,isContentLocked:I}=og(n),x=(0,g.useSelect)((e=>!r&&(!!I&&e(E_).hasSelectedInnerBlock(n,!0))),[I,n,r]),T=x||r&&y[0]===n,M=x||r&&y[y.length-1]===n,{toggleBlockHighlight:N}=(0,g.useDispatch)(E_),P=Ii(n),L=(0,g.useSelect)((e=>e(E_).getBlock(n)),[n]);(0,u.useEffect)((()=>{!z&&r&&C.current.focus()}),[]);const R=(0,u.useCallback)((()=>{w(!0),N(n,!0)}),[n,w,N]),A=(0,u.useCallback)((()=>{w(!1),N(n,!1)}),[n,w,N]),O=(0,u.useCallback)((e=>{i(e,n),e.preventDefault()}),[n,i]),D=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),{isTreeGridMounted:z,expand:F,collapse:V,LeafMoreMenu:H}=i_(),G=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(n):!1===_&&F(n)}),[n,F,V,_]),U=(0,m.useInstanceId)(e);if(!L)return null;const $=!!L&&(0,s.hasBlockSupport)(L.name,"__experimentalToolbar",!0),j=`list-view-block-select-button__${U}`,W=((e,t,n)=>(0,k.sprintf)((0,k.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,f,c);let K=(0,k.__)("Link");P&&(K=B?(0,k.sprintf)((0,k.__)("%s link (locked)"),P.title):(0,k.sprintf)((0,k.__)("%s link"),P.title));const q=P?(0,k.sprintf)((0,k.__)("Options for %s block"),P.title):(0,k.__)("Options"),Y=v&&f>0,Z=p()("block-editor-list-view-block__mover-cell",{"is-visible":S||r}),Q=p()("block-editor-list-view-block__menu-cell",{"is-visible":S||T});let X;Y?X=1:$||(X=2);const J=p()({"is-selected":r||x,"is-first-selected":T,"is-last-selected":M,"is-branch-selected":l,"is-dragging":o,"has-single-cell":!$}),ee=y.includes(n)?y:[n],te=H||bg;return(0,u.createElement)(ob,{className:J,onMouseEnter:R,onMouseLeave:A,onFocus:R,onBlur:A,level:c,position:a,rowCount:d,path:b,id:`list-view-block-${n}`,"data-block":n,isExpanded:I?void 0:_,"aria-selected":!!r||x},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:X,ref:C,"aria-label":K,"aria-selected":!!r||x,"aria-expanded":I?void 0:_,"aria-describedby":j},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(r_,{block:L,onClick:O,onToggleExpanded:G,isSelected:r,position:a,siblingBlockCount:f,level:c,ref:t,tabIndex:n,onFocus:o,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:j},W))})),Y&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Z,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)($p,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(jp,{orientation:"vertical",clientIds:[n],ref:t,tabIndex:o,onFocus:r})})))),$&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:Q,"aria-selected":!!r||x},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(te,{clientIds:ee,block:L,clientId:n,icon:Mm,label:q,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:o,onFocus:r},disableOpenOnArrowDown:!0,__experimentalSelectBlock:D}))}))))}));function a_(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(c_(t,n,o),0):1}const c_=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+a_(r,e,t,n):o+1},u_=()=>{};var d_=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=u_,showBlockMovers:r,selectedClientIds:l,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:d=0,fixedListWindow:p,isExpanded:m,parentId:f,shouldShowInnerBlocks:v=!0}=t,b=(0,g.useSelect)((e=>!(!f||"contentOnly"!==e(E_).getTemplateLock(f))),[f]),{expandedState:_,draggedClientIds:k}=i_();if(b)return null;const y=1===i,E=n.filter(Boolean),C=E.length,S=y?C+1:C;let w=d;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:d,innerBlocks:f}=t;n>0&&(w+=a_(E[n-1],_,k,m));const{itemInView:h}=p,b=h(w),y=n+1,B=s.length>0?`${s}_${y}`:`${y}`,I=!(null==f||!f.length),x=I&&v?null!==(c=_[d])&&void 0!==c?c:m:void 0,T=!(null==k||!k.includes(d)),M=T||b,N=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(d,l),P=a||N&&I;return(0,u.createElement)(g.AsyncModeProvider,{key:d,value:!N},M&&(0,u.createElement)(s_,{block:t,selectBlock:o,isSelected:N,isBranchSelected:P,isDragged:T,level:i,position:y,rowCount:S,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:w,selectedClientIds:l}),!M&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:d,blocks:f,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:w+1,fixedListWindow:p,isBranchSelected:P,selectedClientIds:l,isExpanded:m}))})),y&&(0,u.createElement)(h.__experimentalTreeGridRow,{level:i,setSize:S,positionInSet:S,isExpanded:!0},(0,u.createElement)(h.__experimentalTreeGridCell,null,(e=>(0,u.createElement)(tb,c({nestingLevel:i,blockCount:C},e))))))}));function p_(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,s]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),a=s||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=a.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,a]),d=(0,u.useMemo)((()=>{if(!a)return{};const e=c();return{width:a.offsetWidth-e}}),[c,a]),p=(0,u.useMemo)((()=>{if(a&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:a.ownerDocument,getBoundingClientRect(){const e=a.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const s=o-n,u=i-r;return new window.DOMRect(n,r,s,u)}}}),[a,l,c]);return a?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function m_(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(E_),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:a,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(E_),{getBlockType:p}=(0,g.useSelect)(s.store),m=(0,u.useCallback)((async(i,s,u)=>{if(null==i||!i.shiftKey)return void n(s);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===md.UP||i.keyCode===md.DOWN||i.keyCode===md.HOME||i.keyCode===md.END);if(!m&&!d()&&!c())return void n(s,null);const g=a(),f=[...r(s),s];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=s;m&&(d()||c()||(h=s),u&&(v=u));const b=r(h),_=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,_);await t(y,E,null);const C=a();if((i.keyCode===md.HOME||i.keyCode===md.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,k.sprintf)((0,k.__)("%s deselected."),e))}else S.length>1&&(w=(0,k.sprintf)((0,k.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,a,c,d,t,n]);return{updateBlockSelection:m}}const g_=["top","bottom"];function f_(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(E_),[l,i]=(0,u.useState)(),{rootClientId:s,blockIndex:a}=l||{},c=af(s,a),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==d||!d.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]=uf(t,s,g_),u=df(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(d,i),canInsertDraggedBlocksAsChild:!a||r(d,l)}})),s);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const h_=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var v_=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1,LeafMoreMenu:i,description:s=(0,k.__)("Block navigation structure"),onSelect:a}=e;const{getBlock:c}=(0,g.useSelect)(E_),{clientIdsTree:d,draggedClientIds:p,selectedClientIds:f}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(E_);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:v,shouldShowInnerBlocks:b}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(E_),r=(null==p?void 0:p.length)>0?n(p).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[p]),{updateBlockSelection:_}=m_(),[y,E]=(0,u.useReducer)(h_,{}),{ref:C,target:S}=f_(),w=(0,u.useRef)(),B=(0,m.useMergeRefs)([w,C,t]),I=(0,u.useRef)(!1),{setSelectedTreeId:x}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(E_);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:f[0],setExpandedState:E}),T=(0,u.useCallback)(((e,t)=>{_(e,t),x(t),a&&a(c(t))}),[x,_,a,c]);(0,u.useEffect)((()=>{I.current=!0}),[]);const[M]=(0,m.__experimentalUseFixedWindowList)(w,36,v,{useWindowing:!0,windowOverscan:40}),N=(0,u.useCallback)((e=>{e&&E({type:"expand",clientIds:[e]})}),[E]),P=(0,u.useCallback)((e=>{e&&E({type:"collapse",clientIds:[e]})}),[E]),L=(0,u.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,u.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),A=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&_(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[_]),O=(0,u.useMemo)((()=>({isTreeGridMounted:I.current,draggedClientIds:p,expandedState:y,expand:N,collapse:P,LeafMoreMenu:i})),[I.current,p,y,N,P,i]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(p_,{listViewRef:w,blockDropTarget:S}),(0,u.createElement)("div",{className:"offcanvas-editor-list-view-tree-wrapper"},(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,k.__)("Block navigation structure"),ref:B,onCollapseRow:R,onExpandRow:L,onFocusRow:A,"aria-description":s},(0,u.createElement)(l_.Provider,{value:O},(0,u.createElement)(d_,{blocks:d,selectBlock:T,showBlockMovers:r,fixedListWindow:M,selectedClientIds:f,isExpanded:l,shouldShowInnerBlocks:b}),(0,u.createElement)(h.__experimentalTreeGridRow,{level:1,setSize:1,positionInSet:1,isExpanded:!0},!d.length&&(0,u.createElement)(h.__experimentalTreeGridCell,{withoutGridItem:!0},(0,u.createElement)("div",{className:"offcanvas-editor-list-view-is-empty"},(0,k.__)("Your menu is currently empty. Add your first menu item to get started."))))))))}));const{lock:b_,unlock:__}=(0,wo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),k_={};b_(k_,{...i,ExperimentalBlockEditorProvider:wi,OffCanvasEditor:v_});const y_={reducer:D,selectors:e,actions:l},E_=(0,g.createReduxStore)(So,{...y_,persist:["preferences"]}),C_=(0,g.registerStore)(So,{...y_,persist:["preferences"]});function S_(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:r=!1}=e;const l=function(e,t){const n=ll(),{clientId:o}=$r(),r=(0,g.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(E_),{hasBlockSupport:l}=e(s.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);var l;return n?null===(l=v[e])||void 0===l?void 0:l.Fill:r?v.parent.Fill:null}(t,r);return l?(0,u.createElement)(h.__experimentalStyleProvider,{document:document},(0,u.createElement)(l,null,(e=>{const r=(0,f.isEmpty)(e)?null:e;return(0,u.createElement)(h.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,u.createElement)(h.ToolbarGroup,{controls:n}),o)}))):null}function w_(e){let{group:t="default",...n}=e;const o=(0,u.useContext)(h.__experimentalToolbarContext),r=v[t].Slot,l=(0,h.__experimentalUseSlotFills)(r.__unstableName);return Boolean(l&&l.length)?"default"===t?(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o})):(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(r,c({},n,{bubblesVirtually:!0,fillProps:o}))):null}__(C_).registerPrivateActions(t),__(C_).registerPrivateSelectors(r);const B_=S_;B_.Slot=w_;const I_=e=>(0,u.createElement)(S_,c({group:"inline"},e));I_.Slot=e=>(0,u.createElement)(w_,c({group:"inline"},e));var x_=B_;const T_=[],M_=["none","left","center","right","wide","full"],N_=["wide","full"];function P_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M_;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=ap(),r=rp(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?T_:t}if("default"!==r.name&&"constrained"!==r.name)return T_;const{alignments:i=M_}=o,s=e.filter((e=>(o.alignments||t||!N_.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?T_:s}var L_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var R_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var A_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var O_=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const D_={none:{icon:L_,title:(0,k._x)("None","Alignment option")},left:{icon:R_,title:(0,k.__)("Align left")},center:{icon:ep,title:(0,k.__)("Align center")},right:{icon:A_,title:(0,k.__)("Align right")},wide:{icon:tp,title:(0,k.__)("Wide width")},full:{icon:O_,title:(0,k.__)("Full width")}},z_={variant:"toolbar"};var F_=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const i=P_(o);if(!!!i.length)return null;function s(e){n([t,"none"].includes(e)?void 0:e)}const a=D_[t],d=D_.none,m=r?h.ToolbarGroup:h.ToolbarDropdownMenu,g={icon:a?a.icon:d.icon,label:(0,k.__)("Align")},f=r?{isCollapsed:l,controls:i.map((e=>{let{name:n}=e;return{...D_[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>s(n)}}))}:{toggleProps:{describedBy:(0,k.__)("Change alignment")},popoverProps:z_,children:e=>{let{onClose:n}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=D_[o],a=o===t||!t&&"none"===o;return(0,u.createElement)(h.MenuItem,{key:o,icon:l,iconPosition:"left",className:p()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,u.createElement)(m,c({},g,f))};const V_=e=>(0,u.createElement)(F_,c({},e,{isToolbar:!1})),H_=e=>(0,u.createElement)(F_,c({},e,{isToolbar:!0})),G_=["left","center","right","wide","full"],U_=["wide","full"];function $_(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?G_.filter((t=>e.includes(t))):!0===e?[...G_]:[],!o||!0===e&&!n?t.filter((e=>!U_.includes(e))):t}const j_=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,u.createElement)(e,t),{name:o}=t,r=P_($_((0,s.getBlockSupport)(o,"align"),(0,s.hasBlockSupport)(o,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),l=(0,g.useSelect)((e=>e(E_).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);if(!r.length||l)return n;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(x_,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(V_,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const r=(0,s.getBlockType)(t.name);(null==r||null===(n=r.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),W_=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=P_($_((0,s.getBlockSupport)(n,"align"),(0,s.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,u.createElement)(e,t);let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,u.createElement)(e,c({},t,{wrapperProps:i}))}));(0,a.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||(0,s.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...G_,""]}}),e})),(0,a.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",W_),(0,a.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",j_),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return $_((0,s.getBlockSupport)(t,"align"),(0,s.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=p()(`align${o}`,e.className)),e})),(0,a.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const K_=/[\s#]/g,q_={type:"string",source:"attribute",attribute:"id",selector:"*"};const Y_=(0,m.createHigherOrderComponent)((e=>t=>{if((0,s.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===u.Platform.OS,o=(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,k.__)("HTML anchor"),help:(0,u.createElement)(u.Fragment,null,(0,k.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, youll be able to link directly to this section of your page."),n&&(0,u.createElement)(h.ExternalLink,{href:(0,k.__)("https://wordpress.org/support/article/page-jumps/")},(0,k.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,k.__)("Add an anchor"),onChange:e=>{e=e.replace(K_,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&(0,u.createElement)(wl,{group:"advanced"},o),!n&&"core/heading"===t.name&&(0,u.createElement)(wl,null,(0,u.createElement)(h.PanelBody,{title:(0,k.__)("Heading settings")},o)))}return(0,u.createElement)(e,t)}),"withInspectorControl");(0,a.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||(0,s.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:q_}),e})),(0,a.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Y_),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,s.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Z_={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,a.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,s.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Z_}),e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,s.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Q_=(0,m.createHigherOrderComponent)((e=>t=>(0,s.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),(0,u.createElement)(wl,{group:"advanced"},(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,k.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,k.__)("Separate multiple classes with spaces.")}))):(0,u.createElement)(e,t)),"withInspectorControl");function X_(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function J_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||X_(Object.values(n).filter(Boolean))||"px"}function ek(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,h.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=X_(o),i=0===r||r?`${r}${l}`:void 0;return i}function tk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ek(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function nk(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function ok(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,i=ek(r);void 0===i&&(i=J_(n));const s=nk(r)&&tk(r),a=s?(0,k.__)("Mixed"):null;return(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":(0,k.__)("Border radius"),disableUnits:s,isOnly:!0,value:i,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"}))}(0,a.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,s.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,a.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Q_),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,s.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=p()(e.className,n.className)),e})),(0,a.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,s.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var r;const o=null===(r=t[n])||void 0===r?void 0:r.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,s.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,s.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,s.getBlockDefaultClassName)(t.name)),e}));const rk={topLeft:(0,k.__)("Top left"),topRight:(0,k.__)("Top right"),bottomLeft:(0,k.__)("Bottom left"),bottomRight:(0,k.__)("Bottom right")};function lk(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const i=e=>n=>{if(!t)return;const o=!isNaN(parseFloat(n))?n:void 0;t({...s,[e]:o})},s="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,u.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(rk).map((e=>{let[t,r]=e;const[a,d]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(s[t]),p=s[t]?d:n[t]||n.flat;return(0,u.createElement)(h.Tooltip,{text:r,position:"top",key:t},(0,u.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,u.createElement)(h.__experimentalUnitControl,c({},l,{"aria-label":r,value:[a,p].join(""),onChange:i(t),onUnitChange:(m=t,e=>{const t={...n};t[m]=e,o(t)}),size:"__unstable-large"}))));var m})))}function ik(e){let{isLinked:t,...n}=e;const o=t?(0,k.__)("Unlink radii"):(0,k.__)("Link radii");return(0,u.createElement)(h.Tooltip,{text:o},(0,u.createElement)("span",null,(0,u.createElement)(h.Button,c({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?tl:nl,iconSize:24,"aria-label":o}))))}const sk={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},ak={px:100,em:20,rem:20};function ck(e){let{onChange:t,values:n}=e;const[o,r]=(0,u.useState)(!nk(n)||!tk(n)),[l,i]=(0,u.useState)({flat:"string"==typeof n?(0,h.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,h.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),s=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["px","em","rem"]}),a=J_(l),c=s&&s.find((e=>e.value===a)),d=(null==c?void 0:c.step)||1,[p]=(0,h.__experimentalParseQuantityAndUnitFromRawValue)(ek(n));return(0,u.createElement)("fieldset",{className:"components-border-radius-control"},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,k.__)("Radius")),(0,u.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,u.createElement)(u.Fragment,null,(0,u.createElement)(ok,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:s}),(0,u.createElement)(h.RangeControl,{label:(0,k.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=p?p:"",min:0,max:ak[a],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${a}`:void 0)},step:d,__nextHasNoMarginBottom:!0})):(0,u.createElement)(lk,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||sk,units:s}),(0,u.createElement)(ik,{onClick:()=>r(!o),isLinked:o})))}function uk(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(ck,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=fl({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}kr([Uf,Wf]);const dk=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},pk=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function mk(e,t){if(e&&t)return`has-${(0,f.kebabCase)(t)}-${e}`}function gk(){const e={disableCustomColors:!qr("color.custom"),disableCustomGradients:!qr("color.customGradient")},t=qr("color.palette.custom"),n=qr("color.palette.theme"),o=qr("color.palette.default"),r=qr("color.defaultPalette");e.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,k._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,k._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,k._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=qr("color.gradients.custom"),i=qr("color.gradients.theme"),s=qr("color.gradients.default"),a=qr("color.defaultGradients");return e.gradients=(0,u.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,k._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),a&&s&&s.length&&e.push({name:(0,k._x)("Default","Indicates this palette comes from WordPress."),gradients:s}),l&&l.length&&e.push({name:(0,k._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,s]),e}const fk="__experimentalBorder",hk=["top","right","bottom","left"],vk=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},bk=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},_k=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=bk(t,"slug",n);if(e)return e}if(!o)return{color:void 0};const r=bk(t,"color",o);return r||{color:o}};function kk(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function yk(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:r}=t,{colors:l}=gk(),i=Ek(e.name),a=qr("border.color")&&Ek(e.name,"color"),c=qr("border.radius")&&Ek(e.name,"radius"),d=qr("border.style")&&Ek(e.name,"style"),p=qr("border.width")&&Ek(e.name,"width");if([!a,!c,!d,!p].every(Boolean)||!i)return null;const m=(0,s.getBlockSupport)(e.name,[fk,"__experimentalDefaultControls"]),g=(null==m?void 0:m.color)||(null==m?void 0:m.width),f=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=_k({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return hk.forEach((e=>{var n;const o=kk(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=_k({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,l);return(0,u.createElement)(wl,{group:"border"},(p||a)&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,h.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,k.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:fl({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:g,resetAllFilter:vk,panelId:n},(0,u.createElement)(h.__experimentalBorderBoxControl,{colors:l,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,i={...e};if((0,h.__experimentalHasSplitBorders)(e))i={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},hk.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=_k({colors:l,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(i[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=_k({colors:l,customColor:t});o.slug&&(n=o.slug,i.color=void 0)}const s=fl({...r,border:{radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius,...i}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:f,__experimentalIsRenderedInSidebar:!0})),c&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,k.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ck(o,"radius")})}(e),isShownByDefault:null==m?void 0:m.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,u.createElement)(uk,e)))}function Ek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==u.Platform.OS)return!1;const n=(0,s.getBlockSupport)(e,fk);return!0===n||("any"===t?!!(null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style):!(null==n||!n[t]))}function Ck(e,t){return fl({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Sk(e,t,n){if(!Ek(t,"color")||_l(t,fk,"color"))return e;const o=wk(n),r=p()(e.className,o);return e.className=r||void 0,e}function wk(e){var t;const{borderColor:n,style:o}=e,r=mk("border-color",n);return p()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Bk=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r,l,i,s,a,d,p;const{name:m,attributes:g}=t,{borderColor:f,style:h}=g,{colors:v}=gk();if(!Ek(m,"color")||_l(m,fk,"color"))return(0,u.createElement)(e,t);const{color:b}=_k({colors:v,namedColor:f}),{color:_}=_k({colors:v,namedColor:kk(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=_k({colors:v,namedColor:kk(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=_k({colors:v,namedColor:kk(null==h||null===(i=h.border)||void 0===i||null===(s=i.bottom)||void 0===s?void 0:s.color)}),{color:E}=_k({colors:v,namedColor:kk(null==h||null===(a=h.border)||void 0===a||null===(d=a.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,u.createElement)(e,c({},t,{wrapperProps:S}))}));function Ik(e){if(e)return`has-${e}-gradient-background`}function xk(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}function Tk(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}function Mk(e,t){const n=Tk(e,t);return n&&n.slug}function Nk(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=$r(),o=qr("color.gradients.custom"),r=qr("color.gradients.theme"),l=qr("color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:a}=(0,g.useSelect)((o=>{const{getBlockAttributes:r}=o(E_),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,g.useDispatch)(E_),d=(0,u.useCallback)((o=>{const r=Mk(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),p=Ik(s);let m;return m=s?xk(i,s):a,{gradientClass:p,gradientValue:m,setGradient:d}}(0,a.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Ek(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Sk),(0,a.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Ek(e,"color")||_l(e,fk,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Sk(o,e,n)},e})),(0,a.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Bk);const Pk=["colors","disableCustomColors","gradients","disableCustomGradients"],Lk={name:"color",title:"Solid",value:"color"},Rk={name:"gradient",title:"Gradient",value:"gradient"},Ak=[Lk,Rk];function Ok(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,className:i,label:s,onColorChange:a,onGradientChange:c,colorValue:d,gradientValue:m,clearable:g,showTitle:v=!0,enableAlpha:b}=e;const _=a&&(!(0,f.isEmpty)(t)||!o),k=c&&(!(0,f.isEmpty)(n)||!r);if(!_&&!k)return null;const y={[Lk.value]:(0,u.createElement)(h.ColorPalette,{value:d,onChange:k?e=>{a(e),c()}:a,colors:t,disableCustomColors:o,__experimentalIsRenderedInSidebar:l,clearable:g,enableAlpha:b}),[Rk.value]:(0,u.createElement)(h.GradientPicker,{__nextHasNoMargin:!0,value:m,onChange:_?e=>{c(e),a()}:c,gradients:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:l,clearable:g})},E=e=>(0,u.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,u.createElement)(h.BaseControl,{__nextHasNoMarginBottom:!0,className:p()("block-editor-color-gradient-control",i)},(0,u.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,u.createElement)(h.__experimentalVStack,{spacing:1},v&&(0,u.createElement)("legend",null,(0,u.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,u.createElement)(h.BaseControl.VisualLabel,null,s))),_&&k&&(0,u.createElement)(h.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Ak,initialTabName:m?Rk.value:!!_&&Lk.value},(e=>E(e.value))),!k&&E(Lk.value),!_&&E(Rk.value))))}function Dk(e){const t={};return t.colors=qr("color.palette"),t.gradients=qr("color.gradients"),t.disableCustomColors=!qr("color.custom"),t.disableCustomGradients=!qr("color.customGradient"),(0,u.createElement)(Ok,c({},t,e))}var zk=function(e){return Pk.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(Ok,e):(0,u.createElement)(Dk,e)};const Fk=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,u.createElement)(h.__experimentalToolsPanelItem,c({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Vk=e=>{let{colorValue:t,label:n}=e;return(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(h.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,u.createElement)(h.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},Hk=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:p()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,u.createElement)(h.Button,i,(0,u.createElement)(Vk,{colorValue:r,label:l}))};function Gk(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:i,settings:s,__experimentalIsRenderedInSidebar:a,...d}=e;return a&&(t={placement:"left-start",offset:36,shift:!0}),(0,u.createElement)(u.Fragment,null,s.map(((e,s)=>{var p;const m={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:i,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:a,...e},g={colorValue:null!==(p=e.gradientValue)&&void 0!==p?p:e.colorValue,label:e.label};return e&&(0,u.createElement)(Fk,c({key:s,setting:e},d),(0,u.createElement)(h.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:Hk(g),renderContent:()=>(0,u.createElement)(h.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,u.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,u.createElement)(zk,m)))}))})))}kr([Uf,Wf]);var Uk=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:c=!1}=e;const d=t||n;if(!d)return null;const p=s||o,m=a||r;if(!p&&!m)return null;const g=[{color:p,description:(0,k.__)("text color")},{color:m,description:(0,k.__)("link color")}],f=br(d),v=f.alpha()<1,b=f.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=br(e.color),n=t.isReadable(f,_),o=t.alpha()<1;if(!n){if(v||o)continue;y=b<t.brightness()?(0,k.sprintf)((0,k.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,k.sprintf)((0,k.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,k.__)("This color combination may be hard for people to read.");break}o&&c&&(y=(0,k.__)("Transparent text may be hard for people to read."),E=(0,k.__)("Transparent text may be hard for people to read."))}return y?((0,pn.speak)(E),(0,u.createElement)("div",{className:"block-editor-contrast-checker"},(0,u.createElement)(h.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function $k(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function jk(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,u.useState)(),[s,a]=(0,u.useState)(),[d,p]=(0,u.useState)(),m=Tr(o),g=n.filter((e=>null==e?void 0:e.colorValue));(0,u.useEffect)((()=>{var e;if(!r)return;if(!g.length)return l&&i(),s&&a(),void(d&&a());if(!m.current)return;a($k(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p($k(t).color);let n=m.current,o=$k(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=$k(n).backgroundColor;i(o)}));const f=gk();return(0,u.createElement)(wl,{group:"color"},(0,u.createElement)(Gk,c({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},f)),r&&(0,u.createElement)(Uk,{backgroundColor:l,textColor:s,enableAlphaChecker:t,linkColor:d}))}const Wk="color",Kk=e=>{const t=(0,s.getBlockSupport)(e,Wk);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},qk=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,s.getBlockSupport)(e,Wk);return null!==t&&"object"==typeof t&&!!t.link},Yk=e=>{const t=(0,s.getBlockSupport)(e,Wk);return null!==t&&"object"==typeof t&&!!t.gradients},Zk=e=>{const t=(0,s.getBlockSupport)(e,Wk);return t&&!1!==t.background},Qk=e=>{const t=(0,s.getBlockSupport)(e,Wk);return t&&!1!==t.text},Xk=(e,t)=>fl(vl(t,e,void 0)),Jk=e=>({textColor:void 0,style:Xk(["color","text"],e.style)}),ey=e=>({style:Xk(["elements","link","color","text"],e.style)}),ty=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function ny(e,t,n){var o,r,l,i,s,a;if(!Kk(t)||_l(t,Wk))return e;const c=Yk(t),{backgroundColor:u,textColor:d,gradient:m,style:g}=n,f=e=>!_l(t,Wk,e),h=f("text")?mk("color",d):void 0,v=f("gradients")?Ik(m):void 0,b=f("background")?mk("background-color",u):void 0,_=f("background")||f("gradients"),k=u||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||c&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=p()(e.className,h,v,{[b]:!(c&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":f("text")&&(d||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":_&&k,"has-link-color":f("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const oy=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?dk(e,n[1]).color:t};function ry(e){var t,n,o,r,l,i;const{name:a,attributes:c}=e,d=qr("color.palette.custom"),p=qr("color.palette.theme"),m=qr("color.palette.default"),g=(0,u.useMemo)((()=>[...d||[],...p||[],...m||[]]),[d,p,m]),f=qr("color.gradients.custom"),h=qr("color.gradients.theme"),v=qr("color.gradients.default"),b=(0,u.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),_=qr("color.custom"),y=qr("color.customGradient"),E=qr("color.background"),C=qr("color.link"),S=qr("color.text"),w=_||!p||(null==p?void 0:p.length)>0,B=y||!h||(null==h?void 0:h.length)>0,I=(0,u.useRef)(c);if((0,u.useEffect)((()=>{I.current=c}),[c]),!Kk(a))return null;const x=qk(a)&&C&&w,T=Qk(a)&&S&&w,M=Zk(a)&&E&&w,N=Yk(a)&&B;if(!(x||T||M||N))return null;const{style:P,textColor:L,backgroundColor:R,gradient:A}=c;let O;if(N&&A)O=xk(b,A);else if(N){var D;O=null==P||null===(D=P.color)||void 0===D?void 0:D.gradient}const z=t=>n=>{var o,r;const l=pk(g,n),i=t+"Color",s={...I.current.style,color:{...null===(o=I.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:fl(s),[i]:a};e.setAttributes(c),I.current={...I.current,...c}},F=(0,s.getBlockSupport)(e.name,[Wk,"__experimentalDefaultControls"]),V="web"===u.Platform.OS&&!A&&!(null!=P&&null!==(t=P.color)&&void 0!==t&&t.gradient)&&M&&(x||T)&&!1!==(0,s.getBlockSupport)(e.name,[Wk,"enableContrastChecker"]);return(0,u.createElement)(jk,{enableContrastChecking:V,clientId:e.clientId,enableAlpha:!0,settings:[...T?[{label:(0,k.__)("Text"),onColorChange:z("text"),colorValue:dk(g,L,null==P||null===(n=P.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==F?void 0:F.text,resetAllFilter:Jk}]:[],...M||N?[{label:(0,k.__)("Background"),onColorChange:M?z("background"):void 0,colorValue:dk(g,R,null==P||null===(o=P.color)||void 0===o?void 0:o.background).color,gradientValue:O,onGradientChange:N?t=>{const n=Mk(b,t);let o;if(n){var r,l,i;const e={...null===(r=I.current)||void 0===r?void 0:r.style,color:{...null===(l=I.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:fl(e),gradient:n}}else{var s,a,c;const e={...null===(s=I.current)||void 0===s?void 0:s.style,color:{...null===(a=I.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:fl(e),gradient:void 0}}e.setAttributes(o),I.current={...I.current,...o}}:void 0,isShownByDefault:null==F?void 0:F.background,resetAllFilter:ty}]:[],...x?[{label:(0,k.__)("Link"),onColorChange:t=>{var n;const o=pk(g,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=fl(vl(null===(n=I.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),I.current={...I.current,style:l}},colorValue:oy(g,null==P||null===(r=P.elements)||void 0===r||null===(l=r.link)||void 0===l||null===(i=l.color)||void 0===i?void 0:i.text),isShownByDefault:null==F?void 0:F.link,resetAllFilter:ey}]:[]]})}const ly=(0,m.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:i}=r,s=qr("color.palette.custom"),a=qr("color.palette.theme"),d=qr("color.palette.default"),p=(0,u.useMemo)((()=>[...s||[],...a||[],...d||[]]),[s,a,d]);if(!Kk(o)||_l(o,Wk))return(0,u.createElement)(e,t);const m={};var g,f;i&&!_l(o,Wk,"text")&&(m.color=null===(g=dk(p,i))||void 0===g?void 0:g.color);l&&!_l(o,Wk,"background")&&(m.backgroundColor=null===(f=dk(p,l))||void 0===f?void 0:f.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,u.createElement)(e,c({},t,{wrapperProps:h}))})),iy={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,a.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Kk(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Yk(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",ny),(0,a.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Kk(e)||_l(e,Wk))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ny(o,e,n)},e})),(0,a.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ly),(0,a.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return bl({linkColor:qk(r),textColor:Qk(r),backgroundColor:Zk(r),gradient:Yk(r)},iy,e,t,n,o)}));const sy=[{name:(0,k._x)("Regular","font style"),value:"normal"},{name:(0,k._x)("Italic","font style"),value:"italic"}],ay=[{name:(0,k._x)("Thin","font weight"),value:"100"},{name:(0,k._x)("Extra Light","font weight"),value:"200"},{name:(0,k._x)("Light","font weight"),value:"300"},{name:(0,k._x)("Regular","font weight"),value:"400"},{name:(0,k._x)("Medium","font weight"),value:"500"},{name:(0,k._x)("Semi Bold","font weight"),value:"600"},{name:(0,k._x)("Bold","font weight"),value:"700"},{name:(0,k._x)("Extra Bold","font weight"),value:"800"},{name:(0,k._x)("Black","font weight"),value:"900"}],cy=(e,t)=>e?t?(0,k.__)("Appearance"):(0,k.__)("Font style"):(0,k.__)("Font weight");function uy(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,s=n||o,a=cy(n,o),d={key:"default",name:(0,k.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return sy.forEach((t=>{let{name:n,value:o}=t;ay.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,k.sprintf)((0,k.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return sy.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return ay.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return s&&(0,u.createElement)(h.CustomSelectControl,c({},i,{className:"components-font-appearance-control",label:a,describedBy:m?n?o?(0,k.sprintf)((0,k.__)("Currently selected font appearance: %s"),m.name):(0,k.sprintf)((0,k.__)("Currently selected font style: %s"),m.name):(0,k.sprintf)((0,k.__)("Currently selected font weight: %s"),m.name):(0,k.__)("No selected font appearance"),options:p,value:m,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const dy=1.5,py=.1;var my=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const i=function(e){return void 0!==e&&""!==e}(t),s=i?t:"";o||W()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,u.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,u.createElement)(h.__experimentalNumberControl,c({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return dy;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,k.__)("Line height"),placeholder:dy,step:py,value:s,min:0,spinControls:"custom"})))};const gy="typography.lineHeight";function fy(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(my,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:fl(t)})},size:"__unstable-large"})}function hy(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!qr("typography.lineHeight");return!(0,s.hasBlockSupport)(e,gy)||t}const vy="typography.__experimentalFontStyle",by="typography.__experimentalFontWeight";function _y(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!ky(e),i=!yy(e),s=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,a=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,u.createElement)(uy,{onChange:e=>{r({style:fl({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:s,fontWeight:a},size:"__unstable-large"})}function ky(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,s.hasBlockSupport)(e,vy),n=qr("typography.fontStyle");return!t||!n}function yy(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,s.hasBlockSupport)(e,by),n=qr("typography.fontWeight");return!t||!n}function Ey(e){const t=ky(e),n=yy(e);return t&&n}function Cy(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=qr("typography.fontFamilies");if(o||(o=l),!o||0===o.length)return null;const i=[{value:"",label:(0,k.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,u.createElement)(h.SelectControl,c({label:(0,k.__)("Font"),options:i,value:t,onChange:n,labelPosition:"top"},r))}const Sy="typography.__experimentalFontFamily";function wy(e,t,n){if(!(0,s.hasBlockSupport)(t,Sy))return e;if(_l(t,rE,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(dm())(e.className);o.add(`has-${(0,f.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}function By(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=qr("typography.fontFamilies"),l=null==r||null===(t=r.find((e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,u.createElement)(Cy,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=null==r?void 0:r.find((t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})},size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Iy(e){let{name:t}=e;const n=qr("typography.fontFamilies");return!n||0===n.length||!(0,s.hasBlockSupport)(t,Sy)}(0,a.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,s.hasBlockSupport)(e,Sy)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",wy),(0,a.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,s.hasBlockSupport)(e,Sy))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),wy(o,e,n)},e}));const xy=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}};function Ty(e,t){const n=null==e?void 0:e.find((e=>{let{size:n}=e;return n===t}));return n||{size:t}}function My(e){if(e)return`has-${(0,f.kebabCase)(e)}-font-size`}var Ny=function(e){const t=qr("typography.fontSizes"),n=!qr("typography.customFontSize");return(0,u.createElement)(h.FontSizePicker,c({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Py="typography.fontSize";function Ly(e,t,n){if(!(0,s.hasBlockSupport)(t,Py))return e;if(_l(t,rE,"fontSize"))return e;const o=new(dm())(e.className);o.add(My(n.fontSize));const r=o.value;return e.className=r||void 0,e}function Ry(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=qr("typography.fontSizes"),s=xy(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),a=(null==s?void 0:s.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,u.createElement)(Ny,{onChange:e=>{const t=Ty(i,e).slug;l({style:fl({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:a,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}function Ay(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=qr("typography.fontSizes"),n=!(null==t||!t.length);return!(0,s.hasBlockSupport)(e,Py)||!n}const Oy=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=qr("typography.fontSizes"),{name:l,attributes:{fontSize:i,style:a},wrapperProps:c}=t;if(!(0,s.hasBlockSupport)(l,Py)||_l(l,rE,"fontSize")||!i||null!=a&&null!==(n=a.typography)&&void 0!==n&&n.fontSize)return(0,u.createElement)(e,t);const d=xy(r,i,null==a||null===(o=a.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...c,style:{fontSize:d,...null==c?void 0:c.style}}};return(0,u.createElement)(e,p)}),"withFontSizeInlineStyles"),Dy={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,a.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,s.hasBlockSupport)(e,Py)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Ly),(0,a.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,s.hasBlockSupport)(e,Py))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ly(o,e,n)},e})),(0,a.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Oy),(0,a.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return bl({fontSize:(0,s.hasBlockSupport)(r,Py)},Dy,e,t,n,o)})),(0,a.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,s.hasBlockSupport)(e,Py)||_l(e,rE,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,o,r;const l=t?t(e):{},i=null==l||null===(n=l.style)||void 0===n?void 0:n.fontSize,s=null===(o=(0,g.select)(E_).getSettings().__experimentalFeatures)||void 0===o||null===(r=o.typography)||void 0===r?void 0:r.fluid,a="object"==typeof s?s:{},c=i&&s?Mo({fontSize:i,minimumFontSizeLimit:null==a?void 0:a.minFontSize}):null;return null===c?l:{...l,style:{...null==l?void 0:l.style,fontSize:c}}},e}),11);var zy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M7 11.5h10V13H7z"}));var Fy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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"}));var Vy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Hy=[{name:(0,k.__)("None"),value:"none",icon:zy},{name:(0,k.__)("Underline"),value:"underline",icon:Fy},{name:(0,k.__)("Strikethrough"),value:"line-through",icon:Vy}];function Gy(e){let{value:t,onChange:n,className:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-decoration-control",o)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,k.__)("Decoration")),(0,u.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Hy.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Uy="typography.__experimentalTextDecoration";function $y(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Gy,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:fl({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})},size:"__unstable-large"})}function jy(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,s.hasBlockSupport)(e,Uy),n=qr("typography.textDecoration");return t||!n}var Wy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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"}));var Ky=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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"}));var qy=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 Yy=[{name:(0,k.__)("None"),value:"none",icon:zy},{name:(0,k.__)("Uppercase"),value:"uppercase",icon:Wy},{name:(0,k.__)("Lowercase"),value:"lowercase",icon:Ky},{name:(0,k.__)("Capitalize"),value:"capitalize",icon:qy}];function Zy(e){let{className:t,value:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:p()("block-editor-text-transform-control",t)},(0,u.createElement)(h.BaseControl.VisualLabel,{as:"legend"},(0,k.__)("Letter case")),(0,u.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Yy.map((e=>(0,u.createElement)(h.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{o(e.value===n?void 0:e.value)}})))))}const Qy="typography.__experimentalTextTransform";function Xy(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(Zy,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:fl({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})},size:"__unstable-large"})}function Jy(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,s.hasBlockSupport)(e,Qy),n=qr("typography.textTransform");return t||!n}function eE(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,u.createElement)(h.__experimentalUnitControl,c({},r,{label:(0,k.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const tE="typography.__experimentalLetterSpacing";function nE(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,u.createElement)(eE,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:fl({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%",size:"__unstable-large"})}function oE(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,s.hasBlockSupport)(e,tE),n=qr("typography.letterSpacing");return t||!n}const rE="typography",lE=[gy,Py,vy,by,Sy,Uy,Qy,tE];function iE(e){const{clientId:t}=e,n=Iy(e),o=Ay(e),r=Ey(e),l=hy(e),i=jy(e),a=Jy(e),c=oE(e),d=!ky(e),p=!yy(e),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Ey(e),Ay(e),hy(e),Iy(e),jy(e),Jy(e),oE(e)];return t.filter(Boolean).length===t.length}(e),g=sE(e.name);if(m||!g)return null;const f=(0,s.getBlockSupport)(e.name,[rE,"__experimentalDefaultControls"]),v=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,u.createElement)(wl,{group:"typography"},!n&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,k.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==f?void 0:f.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,u.createElement)(By,e)),!o&&(0,u.createElement)(h.__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,k.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:fl({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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,u.createElement)(Ry,e)),!r&&(0,u.createElement)(h.__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:cy(d,p),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.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,u.createElement)(_y,e)),!l&&(0,u.createElement)(h.__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,k.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==f?void 0:f.lineHeight,resetAllFilter:v("lineHeight"),panelId:t},(0,u.createElement)(fy,e)),!c&&(0,u.createElement)(h.__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,k.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==f?void 0:f.letterSpacing,resetAllFilter:v("letterSpacing"),panelId:t},(0,u.createElement)(nE,e)),!i&&(0,u.createElement)(h.__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,k.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textDecoration,resetAllFilter:v("textDecoration"),panelId:t},(0,u.createElement)($y,e)),!a&&(0,u.createElement)(h.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,k.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:fl({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==f?void 0:f.textTransform,resetAllFilter:v("textTransform"),panelId:t},(0,u.createElement)(Xy,e)))}const sE=e=>lE.some((t=>(0,s.hasBlockSupport)(e,t)));const aE=[...lE,fk,Wk,Yl,Zl],cE=e=>aE.some((t=>(0,s.hasBlockSupport)(e,t)));function uE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return(0,jo.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const dE={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Wk],[`${rE}.__experimentalSkipSerialization`]:[rE],[`${Yl}.__experimentalSkipSerialization`]:[Yl],[`${Zl}.__experimentalSkipSerialization`]:[Zl]},pE={...dE,[`${Zl}`]:["spacing.blockGap"]},mE={gradients:"gradient"};function gE(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;gE(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function fE(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pE;if(!cE(t))return e;let{style:r}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const l=(0,s.getBlockSupport)(t,n);!0===l&&(r=gE(r,o)),Array.isArray(l)&&l.forEach((e=>{const t=mE[e]||e;r=gE(r,[[...o,t]])}))})),e.style={...uE(r),...e.style},e}const hE=(0,m.createHigherOrderComponent)((e=>t=>{const n=ll();return(0,u.createElement)(u.Fragment,null,n&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(ry,t),(0,u.createElement)(iE,t),(0,u.createElement)(yk,t),(0,u.createElement)(ei,t)),(0,u.createElement)(e,t))}),"withToolbarControls"),vE=(0,m.createHigherOrderComponent)((e=>t=>{var n,o;const r=`wp-elements-${(0,m.useInstanceId)(e)}`,l=_l(t.name,Wk,"link"),i=(0,u.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:l||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=(0,jo.compileCSS)(n,{selector:`.editor-styles-wrapper .${r} ${s.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),a=(0,u.useContext)(Sf.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,i&&a&&(0,u.createPortal)((0,u.createElement)("style",{dangerouslySetInnerHTML:{__html:i}}),a),(0,u.createElement)(e,c({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?p()(t.className,r):t.className})))}));(0,a.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return cE(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",fE),(0,a.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!cE(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),fE(o,e,n,dE)},e})),(0,a.addFilter)("editor.BlockEdit","core/style/with-block-controls",hE),(0,a.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",vE);(0,a.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,s.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var bE=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var _E=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:s}=e;return t="unset"===i?(0,u.createElement)(h.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,u.createElement)(h.DuotoneSwatch,{values:i}):(0,u.createElement)(Jd,{icon:bE}),(0,u.createElement)(h.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,k.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,u.createElement)(h.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==md.DOWN||(e.preventDefault(),o())},label:(0,k.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,u.createElement)(h.MenuGroup,{label:(0,k.__)("Duotone")},(0,u.createElement)("div",{className:"block-editor-duotone-control__description"},(0,k.__)("Create a two-tone color effect without losing your original image.")),(0,u.createElement)(h.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:s}))})};const kE=[];function yE(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,u.createElement)(Cr,{selector:t}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Sr,{id:n,colors:o}),(0,u.createElement)(Er,{id:n,selector:t}))}function EE(e){let{presetSetting:t,defaultSetting:n}=e;const o=!qr(n),r=qr(`${t}.custom`)||kE,l=qr(`${t}.theme`)||kE,i=qr(`${t}.default`)||kE;return(0,u.useMemo)((()=>[...r,...l,...o?kE:i]),[o,r,l,i])}function CE(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=EE({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=EE({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),a=!qr("color.custom"),c=!qr("color.customDuotone")||0===(null==s?void 0:s.length)&&a;return 0===(null==i?void 0:i.length)&&c?null:(0,u.createElement)(x_,{group:"block",__experimentalShareWithChildBlocks:!0},(0,u.createElement)(_E,{duotonePalette:i,colorPalette:s,disableCustomDuotone:c,disableCustomColors:a,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}kr([Uf]);const SE=(0,m.createHigherOrderComponent)((e=>t=>{const n=(0,s.hasBlockSupport)(t.name,"color.__experimentalDuotone"),o=(0,g.useSelect)((e=>e(E_).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(e,t),n&&!o&&(0,u.createElement)(CE,t))}),"withDuotoneControls");const wE=(0,m.createHigherOrderComponent)((e=>t=>{var n,o,r;const l=(0,s.getBlockSupport)(t.name,"color.__experimentalDuotone"),i=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.duotone;if(!l||!i)return(0,u.createElement)(e,t);const a=`wp-duotone-${(0,m.useInstanceId)(e)}`,d=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 .${a}`,l),g=p()(null==t?void 0:t.className,a),f=(0,u.useContext)(Sf.__unstableElementContext);return(0,u.createElement)(u.Fragment,null,f&&(0,u.createPortal)((0,u.createElement)(yE,{selector:d,id:a,colors:i}),f),(0,u.createElement)(e,c({},t,{className:g})))}),"withDuotoneStyles");(0,a.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,s.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,a.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",SE),(0,a.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",wE);const BE="__experimentalLayout";function IE(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,g.useSelect)((e=>{var t;const{getSettings:n}=e(E_);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=qr("layout")||{},{attributes:l={},name:i}=n,{layout:a}=l,{default:c}=(0,s.getBlockSupport)(i,BE)||{},u=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||c||{},d=[];var p,m;null!=r&&null!==(e=r.definitions)&&void 0!==e&&null!==(t=e[(null==u?void 0:u.type)||"default"])&&void 0!==t&&t.className&&d.push(null==r||null===(p=r.definitions)||void 0===p||null===(m=p[(null==u?void 0:u.type)||"default"])||void 0===m?void 0:m.className);return(null!=u&&u.inherit||null!=u&&u.contentSize||"constrained"===(null==u?void 0:u.type))&&o&&d.push("has-global-padding"),null!=u&&u.orientation&&d.push(`is-${(0,f.kebabCase)(u.orientation)}`),null!=u&&u.justifyContent&&d.push(`is-content-justification-${(0,f.kebabCase)(u.justifyContent)}`),null!=u&&u.flexWrap&&"nowrap"===u.flexWrap&&d.push("is-nowrap"),d}function xE(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const{attributes:o={},name:r}=t,{layout:l={},style:i={}}=o,s=null!=l&&l.inherit||null!=l&&l.contentSize||null!=l&&l.wideSize?{...l,type:"constrained"}:l||{},a=rp((null==s?void 0:s.type)||"default"),c=qr("layout")||{},u=qr("spacing.blockGap"),d=null!==u,p=null==a||null===(e=a.getLayoutStyle)||void 0===e?void 0:e.call(a,{blockName:r,selector:n,layout:l,layoutDefinitions:null==c?void 0:c.definitions,style:i,hasBlockGapSupport:d});return p}function TE(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:r}=n,l=qr("layout"),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return t().supportsLayout}),[]),a=(0,s.getBlockSupport)(o,BE,{}),{allowSwitching:c,allowEditing:d=!0,allowInheriting:p=!0,default:m}=a;if(!d)return null;const f=!(!p||!l||null!=r&&r.type&&"default"!==(null==r?void 0:r.type)&&"constrained"!==(null==r?void 0:r.type)&&(null==r||!r.inherit)),v=r||m||{},{inherit:b=!1,type:_="default",contentSize:y=null}=v;if(("default"===_||"constrained"===_)&&!i)return null;const E=rp(_),C=rp("constrained"),S=!v.type&&(y||b),w=!!b||!!y,B=e=>t({layout:e});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(wl,null,(0,u.createElement)(h.PanelBody,{title:(0,k.__)("Layout")},f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToggleControl,{className:"block-editor-hooks__toggle-control",label:(0,k.__)("Inner blocks use content width"),checked:"constrained"===(null==E?void 0:E.name)||w,onChange:()=>t({layout:{type:"constrained"===(null==E?void 0:E.name)||w?"default":"constrained"}}),help:"constrained"===(null==E?void 0:E.name)||w?(0,k.__)("Nested blocks use content width with options for full and wide widths."):(0,k.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!b&&c&&(0,u.createElement)(ME,{type:_,onChange:e=>t({layout:{type:e}})}),E&&"default"!==E.name&&(0,u.createElement)(E.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:a}),C&&S&&(0,u.createElement)(C.inspectorControls,{layout:v,onChange:B,layoutBlockSupport:a}))),!b&&E&&(0,u.createElement)(E.toolBarControls,{layout:v,onChange:B,layoutBlockSupport:a}))}function ME(e){let{type:t,onChange:n}=e;return(0,u.createElement)(h.ButtonGroup,null,op.map((e=>{let{name:o,label:r}=e;return(0,u.createElement)(h.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const NE=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,s.hasBlockSupport)(n,BE)&&(0,u.createElement)(TE,c({key:"layout"},t)),(0,u.createElement)(e,c({key:"edit"},t))]}),"withInspectorControls"),PE=(0,m.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,block:r}=t,l=(0,s.hasBlockSupport)(n,BE),i=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return!!t().disableLayoutStyles})),a=l&&!i,d=(0,m.useInstanceId)(e),f=qr("layout")||{},h=(0,u.useContext)(Sf.__unstableElementContext),{layout:v}=o,{default:b}=(0,s.getBlockSupport)(n,BE)||{},_=null!=v&&v.inherit||null!=v&&v.contentSize||null!=v&&v.wideSize?{...v,type:"constrained"}:v||b||{},k=l?IE(r):null,y=`.wp-container-${d}.wp-container-${d}`,E=null!==qr("spacing.blockGap");let C;if(a){var S;const e=rp((null==_?void 0:_.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:_,layoutDefinitions:null==f?void 0:f.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=p()({[`wp-container-${d}`]:a&&!!C},k);return(0,u.createElement)(u.Fragment,null,a&&h&&!!C&&(0,u.createPortal)((0,u.createElement)(cp,{blockName:n,selector:y,css:C,layout:_,style:null==o?void 0:o.style}),h),(0,u.createElement)(e,c({},t,{__unstableLayoutClassNames:w})))})),LE=(0,m.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,s=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return!!t().disableLayoutStyles})),a=i&&!s,d=(0,u.useContext)(Sf.__unstableElementContext),f=(0,m.useInstanceId)(e),h=`.wp-container-content-${f}`;let v="";"fixed"===r&&l?v+=`${h} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(v+=`${h} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const b=p()(null==t?void 0:t.className,{[`wp-container-content-${f}`]:a&&!!v});return(0,u.createElement)(u.Fragment,null,a&&d&&!!v&&(0,u.createPortal)((0,u.createElement)("style",null,v),d),(0,u.createElement)(e,c({},t,{className:b})))}));function RE(e){let{clientId:t,stopEditingAsBlock:n}=e;const o=(0,g.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=e(E_);return n(t)||o(t,!0)}),[t]);return(0,u.useEffect)((()=>{o||n()}),[o]),null}(0,a.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||(0,s.hasBlockSupport)(e,BE)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,a.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",PE),(0,a.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",LE),(0,a.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",NE);const AE=(0,m.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,g.useSelect)(E_),r=(0,u.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:s}=(0,g.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(E_);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:a,updateBlockListSettings:d,__unstableSetTemporarilyEditingAsBlocks:m}=(0,g.useDispatch)(E_),f=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:v,updateBlockAttributes:b}=(0,g.useDispatch)(E_),_=(0,u.useCallback)((()=>{v(),b(t.clientId,{templateLock:"contentOnly"}),d(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),a({focusMode:r.current}),m()}),[t.clientId,r,a,d,n,v,b,m]);return f||s?(0,u.createElement)(u.Fragment,null,s&&!f&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(RE,{clientId:t.clientId,stopEditingAsBlock:_}),(0,u.createElement)(x_,{group:"other"},(0,u.createElement)(h.ToolbarButton,{onClick:()=>{_()}},(0,k.__)("Done")))),!s&&f&&t.isSelected&&(0,u.createElement)(gg,null,(e=>{let{onClose:l}=e;return(0,u.createElement)(h.MenuItem,{onClick:()=>{v(),b(t.clientId,{templateLock:void 0}),d(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,a({focusMode:!0}),m(t.clientId),l()}},(0,k.__)("Modify"))})),(0,u.createElement)(e,c({},t,{className:p()(t.className,s&&"is-content-locked-editing-as-blocks")}))):(0,u.createElement)(e,t)}),"withToolbarControls");(0,a.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",AE);const OE="metadata";function DE(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=(0,s.getBlockSupport)(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function zE(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:wk(e)||void 0,style:uE({border:n})}}function FE(e){const{colors:t}=gk(),n=zE(e),{borderColor:o}=e;if(o){const e=_k({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function VE(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:c,style:u}=e,d=mk("background-color",s),m=mk("color",a),g=Ik(c),f=g||(null==u||null===(t=u.color)||void 0===t?void 0:t.gradient);return{className:p()(m,g,{[d]:!f&&!!d,"has-text-color":a||(null==u||null===(n=u.color)||void 0===n?void 0:n.text),"has-background":s||(null==u||null===(o=u.color)||void 0===o?void 0:o.background)||c||(null==u||null===(r=u.color)||void 0===r?void 0:r.gradient),"has-link-color":null==u||null===(l=u.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:uE({color:(null==u?void 0:u.color)||{}})}}(0,a.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||DE(e,"name")&&(e.attributes={...e.attributes,[OE]:{type:"object"}}),e})),(0,a.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return DE(t)&&(e.metadata=n.metadata),e})),(0,a.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||DE(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:o}=e;if("list-view"===n&&null!=o&&o.name)return o.name}),e}));const HE={};function GE(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=qr("color.palette.custom"),l=qr("color.palette.theme"),i=qr("color.palette.default"),s=qr("color.gradients")||HE,a=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),c=(0,u.useMemo)((()=>[...(null==s?void 0:s.custom)||[],...(null==s?void 0:s.theme)||[],...(null==s?void 0:s.default)||[]]),[s]),d=VE(e);if(t){const e=dk(a,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=xk(c,o)),n){const e=dk(a,n);d.style.color=e.color}return d}function UE(e){const{style:t}=e;return{style:uE({spacing:(null==t?void 0:t.spacing)||{}})}}function $E(e,t){var n;let o=(null==e||null===(n=e.style)||void 0===n?void 0:n.typography)||{};if(t&&(!0===t||0!==Object.keys(t).length)){var r,l,i,s;const n=Mo({fontSize:null==e||null===(r=e.style)||void 0===r||null===(l=r.typography)||void 0===l?void 0:l.fontSize,minimumFontSizeLimit:null==t?void 0:t.minFontSize})||(null==e||null===(i=e.style)||void 0===i||null===(s=i.typography)||void 0===s?void 0:s.fontSize);o={...o,fontSize:n}}const a=uE({typography:o}),c=null!=e&&e.fontFamily?`has-${(0,f.kebabCase)(e.fontFamily)}-font-family`:"";return{className:p()(c,My(null==e?void 0:e.fontSize)),style:a}}function jE(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}const WE=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")},KE=e=>(0,m.createHigherOrderComponent)((t=>n=>(0,u.createElement)(t,c({},n,{colors:e}))),"withCustomColorPalette"),qE=()=>(0,m.createHigherOrderComponent)((e=>t=>{const n=qr("color.palette.custom"),o=qr("color.palette.theme"),r=qr("color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,u.createElement)(e,c({},t,{colors:l}))}),"withEditorColorPalette");function YE(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:(0,f.kebabCase)(t)}:t})),{});return(0,m.compose)([t,e=>class extends u.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=br(t),o=e=>{let{color:t}=e;return n.contrast(t)},r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=WE(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=pk(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 Object.entries(n).reduce(((e,n)=>{let[l,i]=n;const s=dk(r,o[l],o[`custom${WE(l)}`]),a=t[l];return(null==a?void 0:a.color)===s.color&&a?e[l]=a:e[l]={...s,class:mk(i,s.slug)},e}),{})}render(){return(0,u.createElement)(e,c({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function ZE(e){return function(){const t=KE(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,m.createHigherOrderComponent)(YE(o,t),"withCustomColors")}}function QE(){const e=qE();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,m.createHigherOrderComponent)(YE(n,e),"withColors")}const XE=[],JE=e=>{let[t,...n]=e;return t.toUpperCase()+n.join("")};var eC=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=t.reduce(((e,t)=>(e[t]=`custom${JE(t)}`,e)),{});return(0,m.createHigherOrderComponent)((0,m.compose)([(0,m.createHigherOrderComponent)((e=>t=>{const n=qr("typography.fontSizes")||XE;return(0,u.createElement)(e,c({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(o).reduce(((e,t)=>{let[n,o]=t;return e[`set${JE(n)}`]=this.createSetFontSize(n,o),e}),{})}createSetFontSize(e,t){return n=>{var o;const r=null===(o=this.props.fontSizes)||void 0===o?void 0:o.find((e=>{let{size:t}=e;return t===Number(n)}));this.props.setAttributes({[e]:r&&r.slug?r.slug:void 0,[t]:r&&r.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!Object.values(o).some(l))return null;const i=Object.entries(o).filter((e=>{let[t,n]=e;return l(n,t)})).reduce(((e,t)=>{let[o,l]=t;const i=n[o],s=xy(r,i,n[l]);return e[o]={...s,class:My(i)},e}),{});return{...t,...i}}render(){return(0,u.createElement)(e,c({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var tC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var nC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var oC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const rC=[{icon:tC,title:(0,k.__)("Align text left"),align:"left"},{icon:nC,title:(0,k.__)("Align text center"),align:"center"},{icon:oC,title:(0,k.__)("Align text right"),align:"right"}],lC={position:"bottom right",variant:"toolbar"};var iC=function(e){let{value:t,onChange:n,alignmentControls:o=rC,label:r=(0,k.__)("Align text"),describedBy:l=(0,k.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}=e;function a(e){return()=>n(t===e?void 0:e)}const d=o.find((e=>e.align===t)),p=s?h.ToolbarGroup:h.ToolbarDropdownMenu,m=s?{isCollapsed:i}:{toggleProps:{describedBy:l},popoverProps:lC};return(0,u.createElement)(p,c({icon:d?d.icon:(0,k.isRTL)()?oC:tC,label:r,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:i?"menuitemradio":void 0,onClick:a(n)}}))},m))};const sC=e=>(0,u.createElement)(iC,c({},e,{isToolbar:!1})),aC=e=>(0,u.createElement)(iC,c({},e,{isToolbar:!0})),cC=()=>{};var uC={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(E_),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Ph(t,cC),i=(0,u.useMemo)((()=>(e.trim()?cv(o,r,l,e):Y(o,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),s=(0,u.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Ai,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[s]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,s.createBlock)(t,n,(0,s.createBlocksFromInnerBlocksTemplate)(o))}}},dC=window.wp.apiFetch,pC=n.n(dC);var mC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var gC={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await pC()({path:(0,Ev.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jd,{key:"icon",icon:"page"===e.subtype?_b:mC}),e.title)},getOptionCompletion(e){return(0,u.createElement)("a",{href:e.url},e.title)}};const fC=[];function hC(e){let{completers:t=fC}=e;const{name:n}=$r();return(0,u.useMemo)((()=>{let e=[...t,gC];return(n===(0,s.getDefaultBlockName)()||(0,s.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=[...e,uC]),(0,a.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,a.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var vC=function(e){return(0,u.createElement)(h.Autocomplete,c({},e,{completers:hC(e)}))};var bC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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"}));var _C=function(e){let{isActive:t,label:n=(0,k.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,u.createElement)(h.ToolbarButton,{isActive:t,icon:bC,label:n,onClick:()=>o(!t),disabled:r})};const kC=()=>{};var yC=function(e){const{label:t=(0,k.__)("Change matrix alignment"),onChange:n=kC,value:o="center",isDisabled:r}=e,l=(0,u.createElement)(h.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar",placement:"bottom-start"},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,u.createElement)(h.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==md.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,u.createElement)(h.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var EC=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,g.useDispatch)(E_),{clientId:r,parents:l,hasSelection:i}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(E_),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),s=t||(0,k.__)("Document");return(0,u.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,k.__)("Block breadcrumb")},(0,u.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},s),!i&&s,!!r&&(0,u.createElement)(Jd,{icon:ib,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,u.createElement)("li",{key:e},(0,u.createElement)(h.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,u.createElement)(Rp,{clientId:e,maximumLength:35})),(0,u.createElement)(Jd,{icon:ib,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,u.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,u.createElement)(Rp,{clientId:r,maximumLength:35})))};const CC=()=>(0,u.createElement)(h.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,u.createElement)(h.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"})),SC=e=>{let{style:t,className:n}=e;return(0,u.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,u.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,u.createElement)(CC,null)))},wC=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(h.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,k.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==md.DOWN||(e.preventDefault(),o())},icon:(0,u.createElement)(n,null,(0,u.createElement)(t,null,(0,u.createElement)(SC,null)))}))}};var BC=e=>{let{children:t,...n}=e;return W()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,u.createElement)(h.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:wC(n),renderContent:()=>t})};var IC=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const xC=Zu(h.__experimentalTreeGridRow);function TC(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:i,path:s,...a}=e;const d=Ju({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:s});return(0,u.createElement)(xC,c({ref:d,className:p()("block-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r},a),l)}function MC(e){let{onClick:t}=e;return(0,u.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,u.createElement)(Jd,{icon:(0,k.isRTL)()?lb:ib}))}var NC=(0,u.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:s,onDragStart:a,onDragEnd:c,draggable:d}=e;const m=Ii(o),g=xi({clientId:o,context:"list-view"}),{isLocked:f}=og(o);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{className:p()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==md.ENTER&&e.keyCode!==md.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==a||a(e)},onDragEnd:c,draggable:d,href:`#block-${o}`,"aria-hidden":!0},(0,u.createElement)(MC,{onClick:l}),(0,u.createElement)(Ai,{icon:null==m?void 0:m.icon,showColors:!0}),(0,u.createElement)(h.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,u.createElement)(h.__experimentalTruncate,{ellipsizeMode:"auto"},g)),(null==m?void 0:m.anchor)&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,u.createElement)(h.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},m.anchor)),f&&(0,u.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,u.createElement)(Jd,{icon:rb})))))}));const PC=(0,u.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:i,siblingBlockCount:s,level:a,isExpanded:d,selectedClientIds:m,...f}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,g.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(E_);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),_=v&&b===h,k=p()("block-editor-list-view-block-contents",{"is-dropping-before":_}),y=m.includes(h)?m:[h];return(0,u.createElement)(Op,{clientIds:y},(e=>{let{draggable:p,onDragStart:m,onDragEnd:g}=e;return(0,u.createElement)(NC,c({ref:t,className:k,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:i,siblingBlockCount:s,level:a,draggable:p,onDragStart:m,onDragEnd:g,isExpanded:d},f))}))}));var LC=PC;const RC=(0,u.createContext)({}),AC=()=>(0,u.useContext)(RC);var OC=(0,u.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:c,rowCount:d,siblingBlockCount:f,showBlockMovers:v,path:b,isExpanded:_,selectedClientIds:y,preventAnnouncement:E,isSyncedBranch:C}=t;const S=(0,u.useRef)(null),[w,B]=(0,u.useState)(!1),{clientId:I}=n,{isLocked:x,isContentLocked:T,canEdit:M}=og(I),N=(0,g.useSelect)((e=>!r&&(!!T&&e(E_).hasSelectedInnerBlock(I,!0))),[T,I,r]),P=!T&&M,L=N||r&&y[0]===I,R=N||r&&y[y.length-1]===I,{toggleBlockHighlight:A}=(0,g.useDispatch)(E_),O=Ii(I),D=(0,g.useSelect)((e=>e(E_).getBlockName(I)),[I]),z=(0,s.hasBlockSupport)(D,"__experimentalToolbar",!0),F=`list-view-block-select-button__${(0,m.useInstanceId)(e)}`,V=((e,t,n)=>(0,k.sprintf)((0,k.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,f,c);let H=(0,k.__)("Link");O&&(H=x?(0,k.sprintf)((0,k.__)("%s link (locked)"),O.title):(0,k.sprintf)((0,k.__)("%s link"),O.title));const G=O?(0,k.sprintf)((0,k.__)("Options for %s block"),O.title):(0,k.__)("Options"),{isTreeGridMounted:U,expand:$,collapse:j}=AC(),W=v&&f>0,K=p()("block-editor-list-view-block__mover-cell",{"is-visible":w||r}),q=p()("block-editor-list-view-block__menu-cell",{"is-visible":w||L});(0,u.useEffect)((()=>{!U&&r&&S.current.focus()}),[]);const Y=(0,u.useCallback)((()=>{B(!0),A(I,!0)}),[I,B,A]),Z=(0,u.useCallback)((()=>{B(!1),A(I,!1)}),[I,B,A]),Q=(0,u.useCallback)((e=>{i(e,I),e.preventDefault()}),[I,i]),X=(0,u.useCallback)((e=>{i(void 0,e)}),[i]),J=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?j(I):!1===_&&$(I)}),[I,$,j,_]);let ee;W?ee=2:z||(ee=3);const te=p()({"is-selected":r||N,"is-first-selected":L,"is-last-selected":R,"is-branch-selected":l,"is-synced-branch":C,"is-dragging":o,"has-single-cell":!z,"is-synced":null==O?void 0:O.isSynced}),ne=y.includes(I)?y:[I];return(0,u.createElement)(TC,{className:te,onMouseEnter:Y,onMouseLeave:Z,onFocus:Y,onBlur:Z,level:c,position:a,rowCount:d,path:b,id:`list-view-block-${I}`,"data-block":I,isExpanded:P?_:void 0,"aria-selected":!!r||N},(0,u.createElement)(h.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:ee,ref:S,"aria-label":H,"aria-selected":!!r||N,"aria-expanded":P?_:void 0,"aria-describedby":F},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,u.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,u.createElement)(LC,{block:n,onClick:Q,onToggleExpanded:J,isSelected:r,position:a,siblingBlockCount:f,level:c,ref:t,tabIndex:o,onFocus:l,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,u.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:F},V))})),W&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalTreeGridCell,{className:K,withoutGridItem:!0},(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)($p,{orientation:"vertical",clientIds:[I],ref:t,tabIndex:n,onFocus:o})})),(0,u.createElement)(h.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(jp,{orientation:"vertical",clientIds:[I],ref:t,tabIndex:n,onFocus:o})})))),z&&(0,u.createElement)(h.__experimentalTreeGridCell,{className:q,"aria-selected":!!r||N},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,u.createElement)(bg,{clientIds:ne,icon:Mm,label:G,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:X})})))}));function DC(e,t,n,o){var r;if(null==n?void 0:n.includes(e.clientId))return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(zC(t,n,o),0):1}const zC=(e,t,n)=>(o,r)=>{var l;if(null==t?void 0:t.includes(r.clientId))return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+DC(r,e,t,n):o+1},FC=()=>{};var VC=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=FC,showBlockMovers:r,selectedClientIds:l,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p,parentId:m,shouldShowInnerBlocks:f=!0,isSyncedBranch:h=!1}=t,v=Ii(m),b=h||!(null==v||!v.isSynced),_=(0,g.useSelect)((e=>{if(!m)return!0;const t="contentOnly"===e(E_).getTemplateLock(m),n=e(E_).canEditBlock(m);return!t&&n}),[m]),{expandedState:k,draggedClientIds:y}=AC();if(!_)return null;const E=n.filter(Boolean),C=E.length;let S=c;return(0,u.createElement)(u.Fragment,null,E.map(((t,n)=>{var c;const{clientId:m,innerBlocks:h}=t;n>0&&(S+=DC(E[n-1],k,y,p));const{itemInView:v}=d,_=v(S),w=n+1,B=s.length>0?`${s}_${w}`:`${w}`,I=!(null==h||!h.length),x=I&&f?null!==(c=k[m])&&void 0!==c?c:p:void 0,T=!(null==y||!y.includes(m)),M=T||_,N=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),P=a||N&&I;return(0,u.createElement)(g.AsyncModeProvider,{key:m,value:!N},M&&(0,u.createElement)(OC,{block:t,selectBlock:o,isSelected:N,isBranchSelected:P,isDragged:T,level:i,position:w,rowCount:C,siblingBlockCount:C,showBlockMovers:r,path:B,isExpanded:x,listPosition:S,selectedClientIds:l,isSyncedBranch:b}),!M&&(0,u.createElement)("tr",null,(0,u.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&x&&!T&&(0,u.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:B,listPosition:S+1,fixedListWindow:d,isBranchSelected:P,selectedClientIds:l,isExpanded:p,isSyncedBranch:b}))})))}));function HC(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,s]=(0,u.useMemo)((()=>{if(!t.current)return[];return[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]}),[o,r]),a=s||i,c=(0,u.useCallback)((()=>{if(!i)return 0;const e=a.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,a]),d=(0,u.useMemo)((()=>{if(!a)return{};const e=c();return{width:a.offsetWidth-e}}),[c,a]),p=(0,u.useMemo)((()=>{if(a&&("top"===l||"bottom"===l||"inside"===l))return{ownerDocument:a.ownerDocument,getBoundingClientRect(){const e=a.getBoundingClientRect(),t=c(),n=e.left+t,o=e.right;let r=0,i=0;"top"===l?(r=e.top,i=e.top):(r=e.bottom,i=e.bottom);const s=o-n,u=i-r;return new window.DOMRect(n,r,s,u)}}}),[a,l,c]);return a?(0,u.createElement)(h.Popover,{animate:!1,anchor:p,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,u.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function GC(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,g.useDispatch)(E_),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getBlockSelectionEnd:i,getSelectedBlockClientIds:a,hasMultiSelection:c,hasSelectedBlock:d}=(0,g.useSelect)(E_),{getBlockType:p}=(0,g.useSelect)(s.store),m=(0,u.useCallback)((async(i,s,u)=>{if(null==i||!i.shiftKey)return void n(s);i.preventDefault();const m="keydown"===i.type&&(i.keyCode===md.UP||i.keyCode===md.DOWN||i.keyCode===md.HOME||i.keyCode===md.END);if(!m&&!d()&&!c())return void n(s,null);const g=a(),f=[...r(s),s];m&&!g.some((e=>f.includes(e)))&&await e();let h=l(),v=s;m&&(d()||c()||(h=s),u&&(v=u));const b=r(h),_=r(v),{start:y,end:E}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(h,v,b,_);await t(y,E,null);const C=a();if((i.keyCode===md.HOME||i.keyCode===md.END)&&C.length>1)return;const S=g.filter((e=>!C.includes(e)));let w;if(1===S.length){var B;const e=null===(B=p(o(S[0])))||void 0===B?void 0:B.title;e&&(w=(0,k.sprintf)((0,k.__)("%s deselected."),e))}else S.length>1&&(w=(0,k.sprintf)((0,k.__)("%s blocks deselected."),S.length));w&&(0,pn.speak)(w)}),[e,o,p,r,l,i,a,c,d,t,n]);return{updateBlockSelection:m}}const UC=["top","bottom"];function $C(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,g.useSelect)(E_),[l,i]=(0,u.useState)(),{rootClientId:s,blockIndex:a}=l||{},c=af(s,a),d=o(),p=(0,m.useThrottle)((0,u.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==d||!d.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]=uf(t,s,UC),u=df(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&d.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(d,i),canInsertDraggedBlocksAsChild:!a||r(d,l)}})),s);c&&i(c)}),[d]),200);return{ref:(0,m.__experimentalUseDropZone)({onDrop:c,onDragOver(e){p(e,e.currentTarget)},onDragEnd(){p.cancel(),i(null)}}),target:l}}const jC=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var WC=(0,u.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:r=!1,isExpanded:l=!1}=e;const{clientIdsTree:i,draggedClientIds:s,selectedClientIds:a}=function(e){return(0,g.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(E_);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:c,shouldShowInnerBlocks:d}=(0,g.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(E_),r=(null==s?void 0:s.length)>0?n(s).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[s]),{updateBlockSelection:p}=GC(),[f,v]=(0,u.useReducer)(jC,{}),{ref:b,target:_}=$C(),y=(0,u.useRef)(),E=(0,m.useMergeRefs)([y,b,t]),C=(0,u.useRef)(!1),{setSelectedTreeId:S}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,u.useState)(null),{selectedBlockParentClientIds:l}=(0,g.useSelect)((e=>{const{getBlockParents:n}=e(E_);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,u.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:a[0],setExpandedState:v}),w=(0,u.useCallback)(((e,t)=>{p(e,t),S(t)}),[S,p]);(0,u.useEffect)((()=>{C.current=!0}),[]);const[B]=(0,m.__experimentalUseFixedWindowList)(y,36,c,{useWindowing:!0,windowOverscan:40}),I=(0,u.useCallback)((e=>{e&&v({type:"expand",clientIds:[e]})}),[v]),x=(0,u.useCallback)((e=>{e&&v({type:"collapse",clientIds:[e]})}),[v]),T=(0,u.useCallback)((e=>{var t;I(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[I]),M=(0,u.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),N=(0,u.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&p(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[p]),P=(0,u.useMemo)((()=>({isTreeGridMounted:C.current,draggedClientIds:s,expandedState:f,expand:I,collapse:x})),[C.current,s,f,I,x]);return(0,u.createElement)(g.AsyncModeProvider,{value:!0},(0,u.createElement)(HC,{listViewRef:y,blockDropTarget:_}),(0,u.createElement)(h.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,k.__)("Block navigation structure"),ref:E,onCollapseRow:M,onExpandRow:T,onFocusRow:N,applicationAriaLabel:(0,k.__)("Block navigation structure")},(0,u.createElement)(RC.Provider,{value:P},(0,u.createElement)(VC,{blocks:i,selectBlock:w,showBlockMovers:r,fixedListWindow:B,selectedClientIds:a,isExpanded:l,shouldShowInnerBlocks:d}))))}));function KC(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,u.createElement)(h.Button,c({},l,{ref:r,icon:IC,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,k.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var qC=(0,u.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;W()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,g.useSelect)((e=>!!e(E_).getBlockCount()),[])&&!n;return(0,u.createElement)(h.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,u.createElement)(KC,c({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,u.createElement)("div",{className:"block-editor-block-navigation__container"},(0,u.createElement)("p",{className:"block-editor-block-navigation__label"},(0,k.__)("List view")),(0,u.createElement)(WC,null))})}));function YC(e){var t;let{genericPreviewBlock:n,style:o,className:r,activeStyle:l}=e;const i=null===(t=(0,s.getBlockType)(n.name))||void 0===t?void 0:t.example,a=pm(r,l,o),c=(0,u.useMemo)((()=>({...n,title:o.label||o.name,description:o.description,initialAttributes:{...n.attributes,className:a+" block-editor-block-styles__block-preview-container"},example:i})),[n,a]);return(0,u.createElement)(Ch,{item:c,isStylePreview:!0})}const ZC=()=>{};function QC(e){let{clientId:t,onSwitch:n=ZC,onHoverClassName:o=ZC}=e;const{onSelect:r,stylesToRender:l,activeStyle:i,genericPreviewBlock:s,className:a}=gm({clientId:t,onSwitch:n}),[c,d]=(0,u.useState)(null),g=(0,m.useViewportMatch)("medium","<");if(!l||0===l.length)return null;const f=(0,m.debounce)(d,250),v=e=>{var t;c!==e?(f(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):f.cancel()};return(0,u.createElement)("div",{className:"block-editor-block-styles"},(0,u.createElement)("div",{className:"block-editor-block-styles__variants"},l.map((e=>{const t=e.isDefault?(0,k.__)("Default"):e.label||e.name;return(0,u.createElement)(h.Button,{className:p()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>v(e),onFocus:()=>v(e),onMouseLeave:()=>v(null),onBlur:()=>v(null),onClick:()=>(e=>{r(e),o(null),d(null),f.cancel()})(e),"aria-current":i.name===e.name},(0,u.createElement)(h.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!g&&(0,u.createElement)(h.Popover,{placement:"left-start",offset:20},(0,u.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>v(null)},(0,u.createElement)(YC,{activeStyle:i,className:a,genericPreviewBlock:s,style:c}))))}var XC=QC;QC.Slot=()=>(W()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var JC=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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"}));var eS=function(e){let{icon:t=JC,label:n=(0,k.__)("Choose variation"),instructions:o=(0,k.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const s=p()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,u.createElement)(h.Placeholder,{icon:t,label:n,instructions:o,className:s},(0,u.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,k.__)("Block variations")},r.map((e=>(0,u.createElement)("li",{key:e.name},(0,u.createElement)(h.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,u.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),i&&(0,u.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,u.createElement)(h.Button,{variant:"link",onClick:()=>l()},(0,k.__)("Skip"))))};var tS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 nS={carousel:"carousel",grid:"grid"},oS=e=>{let{onBlockPatternSelect:t}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,u.createElement)(h.Button,{variant:"primary",onClick:t},(0,k.__)("Choose")))},rS=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,u.createElement)(h.Button,{icon:Li,label:(0,k.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,u.createElement)(h.Button,{icon:Pi,label:(0,k.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var lS=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s}=e;const a=t===nS.carousel,c=(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,u.createElement)(h.Button,{icon:O_,label:(0,k.__)("Carousel view"),onClick:()=>n(nS.carousel),isPressed:a}),(0,u.createElement)(h.Button,{icon:tS,label:(0,k.__)("Grid view"),onClick:()=>n(nS.grid),isPressed:t===nS.grid}));return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},a&&(0,u.createElement)(rS,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),c,a&&(0,u.createElement)(oS,{onBlockPatternSelect:s}))};var iS=function(e,t,n){return(0,g.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(E_),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])};const sS=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,showTitles:l}=e;const i=(0,h.__unstableUseCompositeState)(),s="block-editor-block-pattern-setup__container";if(t===nS.carousel){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,u.createElement)("div",{className:s},(0,u.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,u.createElement)(cS,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,u.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,u.createElement)(h.__unstableComposite,c({},i,{role:"listbox",className:s,"aria-label":(0,k.__)("Patterns list")}),o.map((e=>(0,u.createElement)(aS,{key:e.name,pattern:e,onSelect:r,composite:i,showTitles:l})))))};function aS(e){let{pattern:t,onSelect:n,composite:o,showTitles:r}=e;const l="block-editor-block-pattern-setup-list",{blocks:i,description:s,viewportWidth:a=700}=t,d=(0,m.useInstanceId)(aS,`${l}__item-description`);return(0,u.createElement)("div",{className:`${l}__list-item`,"aria-label":t.title,"aria-describedby":t.description?d:void 0},(0,u.createElement)(h.__unstableCompositeItem,c({role:"option",as:"div"},o,{className:`${l}__item`,onClick:()=>n(i)}),(0,u.createElement)(yh,{blocks:i,viewportWidth:a}),r&&(0,u.createElement)("div",{className:`${l}__item-title`},t.title),!!s&&(0,u.createElement)(h.VisuallyHidden,{id:d},s)))}function cS(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,m.useInstanceId)(cS,"block-editor-block-pattern-setup-list__item-description");return(0,u.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?s:void 0},(0,u.createElement)(yh,{blocks:r,minHeight:o}),!!i&&(0,u.createElement)(h.VisuallyHidden,{id:s},i))}var uS=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:l=nS.carousel,showTitles:i=!1}=e;const[a,c]=(0,u.useState)(l),[d,p]=(0,u.useState)(0),{replaceBlock:m}=(0,g.useDispatch)(E_),f=iS(t,n,o);if(null==f||!f.length)return null;const h=r||(e=>{const n=e.map((e=>(0,s.cloneBlock)(e)));m(t,n)});return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,u.createElement)(sS,{viewMode:a,activeSlide:d,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,u.createElement)(lS,{viewMode:a,setViewMode:c,activeSlide:d,totalSlides:f.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{h(f[d].blocks)}})))};function dS(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,u.createElement)("fieldset",{className:t},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,k.__)("Transform to variation")),r.map((e=>(0,u.createElement)(h.Button,{key:e.name,icon:(0,u.createElement)(Ai,{icon:e.icon,showColors:!0}),isPressed:o===e.name,label:o===e.name?e.title:(0,k.sprintf)((0,k.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function pS(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,u.createElement)(h.DropdownMenu,{className:t,label:(0,k.__)("Transform to variation"),text:(0,k.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:zp,toggleProps:{iconPosition:"right"}},(()=>(0,u.createElement)("div",{className:`${t}__container`},(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var mS=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,g.useDispatch)(E_),{activeBlockVariation:o,variations:r}=(0,g.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(s.store),{getBlockName:r,getBlockAttributes:l}=e(E_),i=t&&r(t);return{activeBlockVariation:n(i,l(t)),variations:i&&o(i,"transform")}}),[t]),l=null==o?void 0:o.name,i=(0,u.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===r.length)}),[r]);if(null==r||!r.length)return null;const a=i?dS:pS;return(0,u.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...r.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:l,variations:r})},gS=(0,m.createHigherOrderComponent)((e=>t=>{const n=qr("color.palette"),o=!qr("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=!(0,f.isEmpty)(r)||!l;return(0,u.createElement)(e,c({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:i}))}),"withColorContext"),fS=gS(h.ColorPalette);function hS(e){let{onChange:t,value:n,...o}=e;return(0,u.createElement)(zk,c({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var vS=window.wp.date;const bS=new Date(2022,0,25);function _S(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,u.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,u.createElement)(h.VisuallyHidden,{as:"legend"},(0,k.__)("Date format")),(0,u.createElement)(h.ToggleControl,{label:(0,u.createElement)(u.Fragment,null,(0,k.__)("Default format"),(0,u.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,vS.dateI18n)(n,bS))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,u.createElement)(kS,{format:t,onChange:o}))}function kS(e){var t;let{format:n,onChange:o}=e;const r=[...new Set(["Y-m-d",(0,k._x)("n/j/Y","short date format"),(0,k._x)("n/j/Y g:i A","short date format with time"),(0,k._x)("M j, Y","medium date format"),(0,k._x)("M j, Y g:i A","medium date format with time"),(0,k._x)("F j, Y","long date format"),(0,k._x)("M j","short date format without the year")])],l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,vS.dateI18n)(e,bS),format:e}))),i={key:"custom",name:(0,k.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,k.__)("Enter your own date format")},[s,a]=(0,u.useState)((()=>!!n&&!r.includes(n)));return(0,u.createElement)(h.__experimentalVStack,null,(0,u.createElement)(h.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,k.__)("Choose a format"),options:[...l,i],value:s?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?a(!0):(a(!1),o(t.format))}}),s&&(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,k.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,u.createElement)(h.ExternalLink,{href:(0,k.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const yS=["colors","disableCustomColors","gradients","disableCustomGradients"],ES=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:i,settings:s,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:d,enableAlpha:v}=e;const b=(0,m.useInstanceId)(ES),{batch:_}=(0,g.useRegistry)();return(0,f.isEmpty)(n)&&(0,f.isEmpty)(o)&&r&&l&&null!=s&&s.every((e=>(0,f.isEmpty)(e.colors)&&(0,f.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,u.createElement)(h.__experimentalToolsPanel,{className:p()("block-editor-panel-color-gradient-settings",t),label:c?a:void 0,resetAll:()=>{_((()=>{s.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:o,onGradientChange:r}=e;t?o():n&&r()}))}))},panelId:b,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,u.createElement)(Gk,{settings:s,panelId:b,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalIsRenderedInSidebar:d,enableAlpha:v}),!!i&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.__experimentalSpacer,{marginY:4})," ",i))},CS=e=>{const t=gk();return(0,u.createElement)(ES,c({},t,e))};var SS=e=>yS.every((t=>e.hasOwnProperty(t)))?(0,u.createElement)(ES,e):(0,u.createElement)(CS,e);const wS=(0,u.createContext)({}),BS=()=>(0,u.useContext)(wS);function IS(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,onFinishEditing:l,onSaveImage:i,children:s}=e;const c=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,l]=(0,u.useState)(),[i,s]=(0,u.useState)(),[c,d]=(0,u.useState)({x:0,y:0}),[p,m]=(0,u.useState)(100),[g,f]=(0,u.useState)(0),h=n/o,[v,b]=(0,u.useState)(h),_=(0,u.useCallback)((()=>{const e=(g+90)%360;let n=h;if(g%180==90&&(n=1/h),0===e)return l(),f(e),b(h),void d({x:-c.y*n,y:c.x*n});const o=new window.Image;o.src=t,o.onload=function(t){const o=document.createElement("canvas");let r=0,i=0;e%180?(o.width=t.target.height,o.height=t.target.width):(o.width=t.target.width,o.height=t.target.height),90!==e&&180!==e||(r=o.width),270!==e&&180!==e||(i=o.height);const s=o.getContext("2d");s.translate(r,i),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),o.toBlob((t=>{l(URL.createObjectURL(t)),f(e),b(o.width/o.height),d({x:-c.y*n,y:c.x*n})}))};const r=(0,a.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof r&&(o.crossOrigin=r)}),[g,h]);return(0,u.useMemo)((()=>({editedUrl:r,setEditedUrl:l,crop:i,setCrop:s,position:c,setPosition:d,zoom:p,setZoom:m,rotation:g,setRotation:f,rotateClockwise:_,aspect:v,setAspect:b,defaultAspect:h})),[r,i,c,p,g,_,v,h])}({url:n,naturalWidth:o,naturalHeight:r}),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:s,onSaveImage:a,onFinishEditing:c}=e;const{createErrorNotice:d}=(0,g.useDispatch)(Nm.store),[p,m]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{m(!1),c()}),[m,c]),h=(0,u.useCallback)((()=>{m(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,pC()({path:`/wp/v2/media/${s}/edit`,method:"POST",data:e}).then((e=>{a({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,k.sprintf)((0,k.__)("Could not edit image. %s"),(0,Di.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{m(!1),c()}))}),[m,t,n,o,r,l,i,a,d,m,c]);return(0,u.useMemo)((()=>({isInProgress:p,apply:h,cancel:f})),[p,h,f])}({id:t,url:n,onSaveImage:i,onFinishEditing:l,...c}),p=(0,u.useMemo)((()=>({...c,...d})),[c,d]);return(0,u.createElement)(wS.Provider,{value:p},s)}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var xS=function(e,t){return xS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},xS(e,t)};var TS=function(){return TS=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},TS.apply(this,arguments)};Object.create;Object.create;var MS=n(7970),NS=n.n(MS);function PS(e,t,n,o,r,l){void 0===l&&(l=0);var i=US(e,t,l),s=i.width,a=i.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}function LS(e,t,n,o,r){void 0===r&&(r=0);var l=US(t.width,t.height,r),i=l.width,s=l.height;return{x:RS(e.x,i,n.width,o),y:RS(e.y,s,n.height,o)}}function RS(e,t,n,o){var r=t*o/2-n/2;return $S(e,-r,r)}function AS(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function OS(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function DS(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i?zS:FS,a=US(t.width,t.height,l),c=US(t.naturalWidth,t.naturalHeight,l),u={x:s(100,((a.width-n.width/r)/2-e.x/r)/a.width*100),y:s(100,((a.height-n.height/r)/2-e.y/r)/a.height*100),width:s(100,n.width/a.width*100/r),height:s(100,n.height/a.height*100/r)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:TS(TS({},m),{x:Math.round(s(c.width-m.width,u.x*c.width/100)),y:Math.round(s(c.height-m.height,u.y*c.height/100))})}}function zS(e,t){return Math.min(e,Math.max(0,t))}function FS(e,t){return t}function VS(e,t,n,o,r,l){var i=US(t.width,t.height,n),s=$S(o.width/i.width*(100/e.width),r,l);return{crop:{x:s*i.width/2-o.width/2-i.width*s*(e.x/100),y:s*i.height/2-o.height/2-i.height*s*(e.y/100)},zoom:s}}function HS(e,t,n,o,r,l){void 0===n&&(n=0);var i=US(t.naturalWidth,t.naturalHeight,n),s=$S(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*a,y:((i.height-e.height)/2-e.y)*a},zoom:s}}function GS(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function US(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function $S(e,t,n){return Math.min(Math.max(e,t),n)}function jS(){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 WS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Es().createRef(),n.videoRef=Es().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=VS(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=HS(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var a=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=a>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=TS(TS({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:PS(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0])))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=TS({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?LS(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),r=NS()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=$S(e,n.props.minZoom,n.props.maxZoom);if(l){var s=n.getPointOnContainer(t),a=n.getPointOnMedia(s),c={x:a.x*i-s.x,y:a.y*i-s.y},u=n.props.restrictPosition?LS(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?DS(n.props.restrictPosition?LS(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?LS(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 n(){this.constructor=e}xS(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=AS(n,o),this.lastPinchRotation=OS(n,o),this.onDragStart(GS(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=GS(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=AS(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=OS(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,s=i.x,a=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,g=m.containerStyle,f=m.cropAreaStyle,h=m.mediaStyle,v=t.classes,b=v.containerClassName,_=v.cropAreaClassName,k=v.mediaClassName,y=t.objectFit;return Es().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:jS("reactEasyCrop_Container",b)},n?Es().createElement("img",TS({alt:"",className:jS("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{src:n,ref:this.imageRef,style:TS(TS({},h),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Es().createElement("video",TS({autoPlay:!0,loop:!0,muted:!0,className:jS("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:TS(TS({},h),{transform:l||"translate("+s+"px, "+a+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Es().createElement("source",TS({key:e.src},e))}))),this.state.cropSize&&Es().createElement("div",{style:TS(TS({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:jS("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Es().Component),KS=WS;const qS={placement:"bottom-start",variant:"toolbar"};function YS(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,borderProps:s}=e;const{isInProgress:a,editedUrl:c,position:d,zoom:m,aspect:g,setPosition:f,setCrop:v,setZoom:b,rotation:_}=BS();let k=o||r*l/i;return _%180==90&&(k=r*i/l),(0,u.createElement)("div",{className:p()("wp-block-image__crop-area",null==s?void 0:s.className,{"is-applying":a}),style:{...null==s?void 0:s.style,width:n||r,height:k}},(0,u.createElement)(KS,{image:c||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:g,onCropChange:e=>{f(e)},onCropComplete:e=>{v(e)},onZoomChange:e=>{b(100*e)}}),a&&(0,u.createElement)(h.Spinner,null))}var ZS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 QS(){const{isInProgress:e,zoom:t,setZoom:n}=BS();return(0,u.createElement)(h.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:qS,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,u.createElement)(h.ToolbarButton,{icon:ZS,label:(0,k.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,u.createElement)(h.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var XS=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 JS(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,u.createElement)(h.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,u.createElement)(h.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?cm:void 0},t)})))}function ew(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=BS();return(0,u.createElement)(h.DropdownMenu,{icon:XS,label:(0,k.__)("Aspect Ratio"),popoverProps:qS,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(JS,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,k.__)("Original"),aspect:l},{title:(0,k.__)("Square"),aspect:1}]}),(0,u.createElement)(JS,{label:(0,k.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,k.__)("16:10"),aspect:1.6},{title:(0,k.__)("16:9"),aspect:16/9},{title:(0,k.__)("4:3"),aspect:4/3},{title:(0,k.__)("3:2"),aspect:1.5}]}),(0,u.createElement)(JS,{label:(0,k.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,k.__)("10:16"),aspect:.625},{title:(0,k.__)("9:16"),aspect:9/16},{title:(0,k.__)("3:4"),aspect:3/4},{title:(0,k.__)("2:3"),aspect:2/3}]}))}))}var tw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.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 nw(){const{isInProgress:e,rotateClockwise:t}=BS();return(0,u.createElement)(h.ToolbarButton,{icon:tw,label:(0,k.__)("Rotate"),onClick:t,disabled:e})}function ow(){const{isInProgress:e,apply:t,cancel:n}=BS();return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{onClick:t,disabled:e},(0,k.__)("Apply")),(0,u.createElement)(h.ToolbarButton,{onClick:n},(0,k.__)("Cancel")))}function rw(e){let{id:t,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:s,onSaveImage:a,onFinishEditing:c,borderProps:d}=e;return(0,u.createElement)(IS,{id:t,url:n,naturalWidth:s,naturalHeight:i,onSaveImage:a,onFinishEditing:c},(0,u.createElement)(YS,{borderProps:d,url:n,width:o,height:r,clientWidth:l,naturalHeight:i,naturalWidth:s}),(0,u.createElement)(x_,null,(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(QS,null),(0,u.createElement)(h.ToolbarItem,null,(e=>(0,u.createElement)(ew,{toggleProps:e}))),(0,u.createElement)(nw,null)),(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(ow,null))))}const lw=[25,50,75,100],iw=()=>{};function sw(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:o,imageSizeOptions:r=[],isResizable:l=!0,slug:i,width:s,height:a,onChange:c,onChangeImage:d=iw}=e;const{currentHeight:p,currentWidth:m,updateDimension:g,updateDimensions:f}=function(e,t,n,o,r){var l,i;const[s,a]=(0,u.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[c,d]=(0,u.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,u.useEffect)((()=>{void 0===t&&void 0!==o&&a(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,u.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(s)&&a(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&d(e)}),[t,e]),{currentHeight:c,currentWidth:s,updateDimension:(e,t)=>{"width"===e?a(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),a(null!=t?t:o),r({height:e,width:t})}}}(a,s,o,n,c);return(0,u.createElement)(u.Fragment,null,r&&r.length>0&&(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Image size"),value:i,options:r,onChange:d,help:t}),l&&(0,u.createElement)("div",{className:"block-editor-image-size-control"},(0,u.createElement)("p",{className:"block-editor-image-size-control__row"},(0,k.__)("Image dimensions")),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,k.__)("Width"),value:m,min:1,onChange:e=>g("width",e)}),(0,u.createElement)(h.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,k.__)("Height"),value:p,min:1,onChange:e=>g("height",e)})),(0,u.createElement)("div",{className:"block-editor-image-size-control__row"},(0,u.createElement)(h.ButtonGroup,{"aria-label":(0,k.__)("Image size presets")},lw.map((e=>{const t=Math.round(n*(e/100)),r=Math.round(o*(e/100)),l=m===t&&p===r;return(0,u.createElement)(h.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>f(r,t)},e,"%")}))),(0,u.createElement)(h.Button,{isSmall:!0,onClick:()=>f()},(0,k.__)("Reset")))))}var aw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"}));var cw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"}));var uw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));const dw=()=>{};let pw=0;var mw=(0,m.compose)([(0,g.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Nm.store);return{createNotice:t,removeNotice:n}})),(0,h.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:s,onSelectURL:a,onToggleFeaturedImage:c,useFeaturedImage:d,onFilesUpload:p=dw,name:m=(0,k.__)("Replace"),createNotice:f,removeNotice:v,children:b,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const C=(0,g.useSelect)((e=>e(E_).getSettings().mediaUpload),[]),S=(0,u.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++pw,B=e=>{const t=(0,Di.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{f("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},I=(e,t)=>{d&&c&&c(),t(),s(e),(0,pn.speak)((0,k.__)("The media file has been replaced")),v(w)},x=e=>{e.keyCode===md.DOWN&&(e.preventDefault(),e.target.click())},T=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,u.createElement)(h.Dropdown,{popoverProps:{variant:"toolbar"},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,u.createElement)(h.ToolbarButton,{ref:S,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:x},m)},renderContent:e=>{let{onClose:i}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Dv,{gallery:T,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>I(e,i),allowedTypes:r,render:e=>{let{open:t}=e;return(0,u.createElement)(h.MenuItem,{icon:aw,onClick:t},(0,k.__)("Open Media Library"))}}),(0,u.createElement)(Ov,null,(0,u.createElement)(h.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),s(n);p(n),C({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:B})})(e,i)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,u.createElement)(h.MenuItem,{icon:cw,onClick:()=>{t()}},(0,k.__)("Upload"))}}))),c&&(0,u.createElement)(h.MenuItem,{icon:uw,onClick:c,isPressed:d},(0,k.__)("Use featured image")),b),a&&(0,u.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,u.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,k.__)("Current media URL:")),(0,u.createElement)(h.Tooltip,{text:t,position:"bottom"},(0,u.createElement)("div",null,(0,u.createElement)(Xb,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;a(t),S.current.focus()}})))))}})}));var gw=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,u.createElement)(G.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"}));function fw(e){let{url:t,urlLabel:n,className:o}=e;const r=p()(o,"block-editor-url-popover__link-viewer-url");return t?(0,u.createElement)(h.ExternalLink,{className:r,href:t},n||(0,Ev.filterURLForDisplay)((0,Ev.safeDecodeURI)(t))):(0,u.createElement)("span",{className:r})}function hw(e){let t,{additionalControls:n,children:o,renderSettings:r,placement:l,focusOnMount:i="firstElement",position:s,...a}=e;void 0!==s&&W()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==l?t=l:void 0!==s&&(t=(0,h.__experimentalPopoverPositionToPlacement)(s)),t=t||"bottom";const[d,p]=(0,u.useState)(!1),m=!!r&&d;return(0,u.createElement)(h.Popover,c({className:"block-editor-url-popover",focusOnMount:i,placement:t,shift:!0},a),(0,u.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,u.createElement)("div",{className:"block-editor-url-popover__row"},o,!!r&&(0,u.createElement)(h.Button,{className:"block-editor-url-popover__settings-toggle",icon:zp,label:(0,k.__)("Link settings"),onClick:()=>{p(!d)},"aria-expanded":d})),m&&(0,u.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},r())),n&&!m&&(0,u.createElement)("div",{className:"block-editor-url-popover__additional-controls"},n))}hw.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,u.createElement)("form",c({className:p()("block-editor-url-popover__link-editor",n)},l),(0,u.createElement)(hb,{__nextHasNoMarginBottom:!0,value:r,onChange:o,autocompleteRef:t}),(0,u.createElement)(h.Button,{icon:gw,label:(0,k.__)("Apply"),type:"submit"}))},hw.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...i}=e;return(0,u.createElement)("div",c({className:p()("block-editor-url-popover__link-viewer",t)},i),(0,u.createElement)(fw,{url:r,urlLabel:l,className:n}),o&&(0,u.createElement)(h.Button,{icon:Gb,label:(0,k.__)("Edit"),onClick:o}))};var vw=hw;const bw=()=>{},_w=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,u.createElement)(vw,{onClose:r},(0,u.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,u.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,k.__)("URL"),placeholder:(0,k.__)("Paste or type URL"),onChange:n,value:t}),(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:gw,label:(0,k.__)("Apply"),type:"submit"})))};var kw=(0,h.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:s,isAppender:a,accept:c,addToGallery:d,multiple:m=!1,handleUpload:f=!0,disableDropZone:v,disableMediaButtons:b,onError:_,onSelect:y,onCancel:E,onSelectURL:C,onToggleFeaturedImage:S,onDoubleClick:w,onFilesPreUpload:B=bw,onHTMLDrop:I=bw,children:x,mediaLibraryButton:T,placeholder:M,style:N}=e;const P=(0,g.useSelect)((e=>{const{getSettings:t}=e(E_);return t().mediaUpload}),[]),[L,R]=(0,u.useState)(""),[A,O]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var e;R(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const D=e=>{R(e.target.value)},z=()=>{O(!0)},F=()=>{O(!1)},V=e=>{e.preventDefault(),L&&C&&(C(L),F())},H=e=>{if(!f)return y(e);let o;if(B(e),m)if(d){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));y(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=y;else o=e=>{let[t]=e;return y(t)};P({allowedTypes:n,filesList:e,onFileChange:o,onError:_})},G=e=>{H(e.target.files)},U=null!=M?M:e=>{let{instructions:t,title:c}=l;if(P||C||(t=(0,k.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&P&&(t=(0,k.__)("Upload a media file or pick one from your media library."),l?t=(0,k.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,k.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,k.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,k.__)("Media"),l?c=(0,k.__)("Audio"):i?c=(0,k.__)("Image"):s&&(c=(0,k.__)("Video")))}const d=p()("block-editor-media-placeholder",o,{"is-appender":a});return(0,u.createElement)(h.Placeholder,{icon:r,label:c,instructions:t,className:d,notices:s,onDoubleClick:w,preview:i,style:N},e,x)},$=()=>v?null:(0,u.createElement)(h.DropZone,{onFilesDrop:H,onHTMLDrop:I}),j=()=>E&&(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,k.__)("Cancel"),variant:"link",onClick:E},(0,k.__)("Cancel")),W=()=>C&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:A,variant:"tertiary"},(0,k.__)("Insert from URL")),A&&(0,u.createElement)(_w,{src:L,onChange:D,onSubmit:V,onClose:F})),K=()=>S&&(0,u.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,u.createElement)(h.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,k.__)("Use featured image")));return b?(0,u.createElement)(Ov,null,$()):(0,u.createElement)(Ov,{fallback:U(W())},(()=>{const e=null!=T?T:e=>{let{open:t}=e;return(0,u.createElement)(h.Button,{variant:"tertiary",onClick:()=>{t()}},(0,k.__)("Media Library"))},o=(0,u.createElement)(Dv,{addToGallery:d,gallery:m&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:m,onSelect:y,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(P&&a)return(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{onChange:G,accept:c,multiple:m,render:e=>{let{openFileDialog:t}=e;const n=(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.Button,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,k.__)("Upload")),o,W(),K(),j());return U(n)}}));if(P){const e=(0,u.createElement)(u.Fragment,null,$(),(0,u.createElement)(h.FormFileUpload,{variant:"primary",className:p()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:c,multiple:m},(0,k.__)("Upload")),o,W(),K(),j());return U(e)}return U(o)})())}));var yw=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,u.createElement)(SS,c({settings:o,gradients:[],disableCustomGradients:!0},n))};const Ew={position:"bottom right",variant:"toolbar"};var Cw=()=>(0,u.createElement)(u.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,u.createElement)(h.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,u.createElement)(h.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,u.createElement)(h.ToolbarItem,null,(n=>(0,u.createElement)(h.DropdownMenu,{icon:zp,label:(0,k.__)("More"),toggleProps:{...n,className:p()(n.className,{"is-pressed":t}),describedBy:(0,k.__)("Displays more block tools")},controls:Y(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:Ew})))})));function Sw(e){let{value:t,editableContentElement:n,activeFormats:o}=e;const r=o[o.length-1],l=null==r?void 0:r.type,i=(0,g.useSelect)((e=>e($.store).getFormatType(l)),[l]),s=(0,$.useAnchor)({editableContentElement:n,value:t,settings:i});return(0,u.createElement)(ww,{popoverAnchor:s})}function ww(e){let{popoverAnchor:t}=e;return(0,u.createElement)(h.Popover,{placement:"top",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,u.createElement)(Zp,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,k.__)("Format tools")},(0,u.createElement)(h.ToolbarGroup,null,(0,u.createElement)(Cw,null))))}var Bw=e=>{let{inline:t,editableContentElement:n,value:o}=e;const r=(0,g.useSelect)((e=>e(E_).getSettings().hasInlineToolbar),[]);if(t)return(0,u.createElement)(ww,{popoverAnchor:n});if(r){const e=(0,$.getActiveFormats)(o);return(0,$.isCollapsed)(o)&&!e.length?null:(0,u.createElement)(Sw,{editableContentElement:n,value:o,activeFormats:e})}return(0,u.createElement)(x_,{group:"inline"},(0,u.createElement)(Cw,null))};function Iw(){const{didAutomaticChange:e,getSettings:t}=(0,g.useSelect)(E_);return(0,m.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==md.DELETE&&o!==md.BACKSPACE&&o!==md.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}var xw=window.wp.shortcode;function Tw(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Mw(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Nw(e){let{allowedFormats:t,disableFormats:n}=e;return n?Nw.EMPTY_ARRAY:t}Nw.EMPTY_ARRAY=[];function Pw(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:s=0,end:a=0}=t,c={...t,start:s,end:a},u=[],[d,p]=(0,$.split)(c),m=n.length>0;let g=-1;const f=(0,$.isEmpty)(d)&&!(0,$.isEmpty)(p);m&&(0,$.isEmpty)(d)||(u.push(r((0,$.toHTMLString)({value:d,multilineTag:i}),!f)),g+=1),m?(u.push(...n),g+=n.length):l&&u.push(l()),(m||l)&&(0,$.isEmpty)(p)||u.push(r((0,$.toHTMLString)({value:p,multilineTag:i}),f));o(u,m?g:1,m?-1:0)}function Lw(e,t){return t?(0,$.replace)(e,/\n+/g,$.__UNSTABLE_LINE_SEPARATOR):(0,$.replace)(e,new RegExp($.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Rw(e){const t=(0,u.useRef)(e);return t.current=e,(0,m.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:g,pastePlainText:f}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(b),b=function(e){const t="<meta charset='utf-8'>";if(e.startsWith(t))return e.slice(t.length);return e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void r((0,$.insert)(l,v));const _=i.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===l&&(e=n(l,{html:b,plainText:v})),e}),l);if(_!==l)return void r(_);const k=[...(0,Di.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,$.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=Lw(t,!!m),Tw(t,l.activeFormats),void r((0,$.insert)(l,t))}if(f)return void r((0,$.insert)(l,(0,$.create)({text:v})));if(null!=k&&k.length&&window.console.log("Received items:\n\n",k),null!=k&&k.length&&!Pm(k,b)){const e=(0,s.getBlockTransforms)("from"),t=k.reduce(((t,n)=>{const o=(0,s.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(c&&(0,$.isEmpty)(l)?c(t):Pw({value:l,pastedBlocks:t,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,$.isEmpty)(l)&&(E=v,(0,xw.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,$.isEmpty)(l)&&(0,Ev.isURL)(v.trim())&&(y="BLOCKS");const C=(0,s.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:g});if("string"==typeof C){let e=(0,$.create)({html:C});e=Lw(e,!!m),Tw(e,l.activeFormats),r((0,$.insert)(l,e))}else C.length>0&&(c&&(0,$.isEmpty)(l)?c(C,C.length-1,-1):Pw({value:l,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const Aw=["`",'"',"'","“”",""];function Ow(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(E_),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:s,onChange:c}=o.current;if("insertText"!==l)return;if((0,$.isCollapsed)(s))return;const u=(0,a.applyFilters)("blockEditor.wrapSelectionSettings",Aw).find((e=>{let[t,n]=e;return t===i||n===i}));if(!u)return;const[d,p=d]=u,m=s.start,g=s.end+d.length;let f=(0,$.insert)(s,d,m,m);f=(0,$.insert)(f,p,g,g),t(),c(f),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:v}=e,{defaultView:b}=v,_=new b.InputEvent("input",h);window.queueMicrotask((()=>{r.target.dispatchEvent(_)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function Dw(e){let t=e.length;for(;t--;){const n=gn(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(mn,""),e[t].clientId;const o=Dw(e[t].innerBlocks);if(o)return o}}function zw(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,g.useDispatch)(E_),o=(0,u.useRef)(e);return o.current=e,(0,m.useRefEffect)((e=>{function r(){const{value:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const a=i.slice(0,l).trim(),c=(0,s.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,s.findTransform)(c,(e=>{let{prefix:t}=e;return a===t}));if(!u)return;const d=(0,$.toHTMLString)({value:(0,$.insert)(e,mn,0,l)}),p=u.transform(d);r(Dw([p])),t([p]),n()}function l(e){const{inputType:l,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;c&&r&&r();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,$.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",l),e.addEventListener("compositionend",l),()=>{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function Fw(e){const{__unstableMarkAutomaticChange:t}=(0,g.useDispatch)(E_),n=(0,u.useRef)(e);return n.current=e,(0,m.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;if(e.keyCode!==md.ENTER)return;const{removeEditorOnlyFormats:o,value:r,onReplace:l,onSplit:i,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;e.preventDefault();const m={...r};m.formats=o(r);const g=l&&i;if(l){const e=(0,s.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,s.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(l([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,$.insert)(m,"\n")):g&&(0,$.__unstableIsEmptyLine)(m)?Pw({value:m,onReplace:l,onSplit:i,onSplitMiddle:a,multilineTag:c}):u((0,$.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!g&&!r?d||u((0,$.insert)(m,"\n")):!g&&r?p():g&&Pw({value:m,onReplace:l,onSplit:i,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function Vw(e){return e($.store).getFormatTypes()}const Hw=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Gw(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,o]=e;return[`${t}.${n}`,o]})))}function Uw(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function $w(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function jw(e){return(0,m.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Ww(){const{__unstableMarkLastChangeAsPersistent:e}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function Kw(){const{isMultiSelecting:e}=(0,g.useSelect)(E_);return(0,m.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function qw(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const s=(0,$.getActiveFormat)(r,t);let a=void 0!==s;const c=(0,$.getActiveObject)(r),d=void 0!==c&&c.type===t;if("core/link"===t&&!(0,$.isCollapsed)(r)){var p,m;const e=r.formats,t=null===(p=e[r.start])||void 0===p?void 0:p.find((e=>{let{type:t}=e;return"core/link"===t})),n=null===(m=e[r.end-1])||void 0===m?void 0:m.find((e=>{let{type:t}=e;return"core/link"===t}));t&&n&&t===n||(a=!1)}return(0,u.createElement)(i,{key:t,isActive:a,activeAttributes:a&&s.attributes||{},isObjectActive:d,activeObjectAttributes:d&&c.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Yw=(0,u.createContext)(),Zw=(0,u.createContext)();const Qw=(0,u.forwardRef)((function e(t,n){let{children:o,tagName:r="div",value:l="",onChange:i,isSelected:a,multiline:d,inlineToolbar:f,wrapperClassName:v,autocompleters:b,onReplace:_,placeholder:k,allowedFormats:y,withoutInteractiveFormatting:E,onRemove:C,onMerge:S,onSplit:w,__unstableOnSplitAtEnd:B,__unstableOnSplitMiddle:I,identifier:x,preserveWhiteSpace:T,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:P,disableLineBreaks:L,unstableOnFocus:R,__unstableAllowPrefixTransformations:A,...O}=t;d&&W()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const D=(0,m.useInstanceId)(e);x=x||D,O=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,rootTagsToEliminate:s,disableEditingMenu:a,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:g,setRef:f,disableSuggestions:h,disableAutocorrection:v,...b}=e;return b}(O);const z=(0,u.useRef)(),{clientId:F}=$r(),{selectionStart:V,selectionEnd:H,isSelected:G}=(0,g.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(E_),o=t(),r=n();let l;return void 0===a?l=o.clientId===F&&r.clientId===F&&o.attributeKey===x:a&&(l=o.clientId===F),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{getSelectionStart:U,getSelectionEnd:j,getBlockRootClientId:K}=(0,g.useSelect)(E_),{selectionChange:q}=(0,g.useDispatch)(E_),Y=Mw(d),Z=Nw({allowedFormats:y,disableFormats:P}),Q=!Z||Z.length>0;let X=l,J=i;Array.isArray(l)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),X=s.children.toHTML(l),J=e=>i(s.children.fromDOM((0,$.__unstableCreateElement)(document,e).childNodes)));const ee=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&K(F)!==K(j().clientId))return;n.start={clientId:F,attributeKey:x,offset:e}}if("number"==typeof t||o){if(void 0===e&&K(F)!==K(U().clientId))return;n.end={clientId:F,attributeKey:x,offset:t}}q(n)}),[F,x]),{formatTypes:te,prepareHandlers:ne,valueHandlers:oe,changeHandlers:re,dependencies:le}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,g.useSelect)(Vw,[]),i=(0,u.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&Hw.has(n))}))),[l,r,Hw]),s=(0,g.useSelect)((e=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...Gw(r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),r.name)}:o),{})),[i,t,n]),a=(0,g.useDispatch)(),c=[],d=[],p=[],m=[];for(const e in s)m.push(s[e]);return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=e.__experimentalCreatePrepareEditableTree(Uw(s,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(o):c.push(o)}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:n,blockClientId:t}));const r=Uw(s,e.name);p.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:c,valueHandlers:d,changeHandlers:p,dependencies:m}}({clientId:F,identifier:x,withoutInteractiveFormatting:E,allowedFormats:Z});function ie(e){return te.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,$.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:se,onChange:ae,ref:ce}=(0,$.__unstableUseRichText)({value:X,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;J(e),Object.values(re).forEach((e=>{e(n,o)}))},selectionStart:V,selectionEnd:H,onSelectionChange:ee,placeholder:k,__unstableIsSelected:G,__unstableMultilineTag:Y,__unstableDisableFormats:P,preserveWhiteSpace:T,__unstableDependencies:[...le,r],__unstableAfterParse:function(e){return oe.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ie,__unstableAddInvisibleFormats:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ue=function(e){return(0,h.__unstableUseAutocompleteProps)({...e,completers:hC(e)})}({onReplace:_,completers:b,record:se,onChange:ae});!function(e){let{html:t,value:n}=e;const o=(0,u.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,g.useDispatch)(E_);(0,u.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:X,value:se});const de=(0,u.useRef)(new Set),pe=(0,u.useRef)(new Set);function me(){var e;null===(e=z.current)||void 0===e||e.focus()}const ge=r;return(0,u.createElement)(u.Fragment,null,G&&(0,u.createElement)(Yw.Provider,{value:de},(0,u.createElement)(Zw.Provider,{value:pe},(0,u.createElement)(h.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:se,onChange:ae,onFocus:me}),(0,u.createElement)(qw,{value:se,onChange:ae,onFocus:me,formatTypes:te,forwardedRef:z})))),G&&Q&&(0,u.createElement)(Bw,{inline:f,editableContentElement:z.current,value:se}),(0,u.createElement)(ge,c({role:"textbox","aria-multiline":!L,"aria-label":k},O,ue,{ref:(0,m.useMergeRefs)([n,ue.ref,O.ref,ce,Ow({value:se,onChange:ae}),zw({value:se,onChange:ae,__unstableAllowPrefixTransformations:A,formatTypes:te,onReplace:_,selectionChange:q}),Ww(),(0,m.useRefEffect)((e=>{function t(e){(md.isKeyboardEvent.primary(e,"z")||md.isKeyboardEvent.primary(e,"y")||md.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),$w(de),jw(pe),Iw(),Rw({isSelected:G,disableFormats:P,onChange:ae,value:se,formatTypes:te,tagName:r,onReplace:_,onSplit:w,onSplitMiddle:I,__unstableEmbedURLOnPaste:N,multilineTag:Y,preserveWhiteSpace:T,pastePlainText:M}),Fw({removeEditorOnlyFormats:ie,value:se,onReplace:_,onSplit:w,onSplitMiddle:I,multilineTag:Y,onChange:ae,disableLineBreaks:L,onSplitAtEnd:B}),Kw(),z]),contentEditable:!0,suppressContentEditableWarning:!0,className:p()("block-editor-rich-text__editable",O.className,"rich-text"),onFocus:R,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===md.DELETE||t===md.BACKSPACE)){const{start:n,end:o,text:r}=se,l=t===md.BACKSPACE,i=se.activeFormats&&!!se.activeFormats.length;if(!(0,$.isCollapsed)(se)||i||l&&0!==n||!l&&o!==r.length)return;S&&S(!l),C&&(0,$.isEmpty)(se)&&l&&C(!l),e.preventDefault()}}})))}));Qw.Content=e=>{let{value:t,tagName:n,multiline:o,...r}=e;Array.isArray(t)&&(W()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=s.children.toHTML(t));const l=Mw(o);!t&&l&&(t=`<${l}></${l}>`);const i=(0,u.createElement)(u.RawHTML,null,t);if(n){const{format:e,...t}=r;return(0,u.createElement)(n,t,i)}return i},Qw.isEmpty=e=>!e||0===e.length;var Xw=Qw;const Jw=(0,u.forwardRef)(((e,t)=>(0,u.createElement)(Xw,c({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));Jw.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,u.createElement)(n,o,t)};var eB=Jw;var tB=(0,u.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,u.createElement)(eB,c({ref:t},o));const{className:r,onChange:l,...i}=o;return(0,u.createElement)(ts.Z,c({ref:t,className:p()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},i))}));function nB(e){let{property:t,viewport:n,desc:o}=e;const r=(0,m.useInstanceId)(nB),l=o||(0,k.sprintf)((0,k._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,u.createElement)(u.Fragment,null,(0,u.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,u.createElement)(h.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var oB=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:s=!1,defaultLabel:a={id:"all",label:(0,k.__)("All")},viewports:c=[{id:"small",label:(0,k.__)("Small screens")},{id:"medium",label:(0,k.__)("Medium screens")},{id:"large",label:(0,k.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const d=o||(0,k.sprintf)((0,k.__)("Use the same %s on all screensizes."),n),m=(0,k.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,u.createElement)(nB,{property:n,viewport:a}),a);return(0,u.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,u.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,u.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,u.createElement)(h.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!s,onChange:r,help:m}),(0,u.createElement)("div",{className:p()("block-editor-responsive-block-control__group",{"is-responsive":s})},!s&&g,s&&(i?i(c):c.map((e=>(0,u.createElement)(u.Fragment,{key:e.id},l((0,u.createElement)(nB,{property:n,viewport:e}),e))))))))};function rB(e){let{character:t,type:n,onUse:o}=e;const r=(0,u.useContext)(Yw),l=(0,u.useRef)();return l.current=o,(0,u.useEffect)((()=>{function e(e){md.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function lB(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,i="RichText.ToolbarControls";return n&&(i+=`.${n}`),o&&r&&(t=md.displayShortcut[o](r)),(0,u.createElement)(h.Fill,{name:i},(0,u.createElement)(h.ToolbarButton,c({},l,{shortcut:t})))}function iB(e){let{inputType:t,onInput:n}=e;const o=(0,u.useContext)(Zw),r=(0,u.useRef)();return r.current=n,(0,u.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const sB=(0,u.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,u.createElement)(h.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var aB=(0,u.forwardRef)((function(e,t){const n=(0,g.useSelect)((e=>e(E_).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,g.useDispatch)(E_);return(0,u.createElement)(h.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,u.createElement)(h.Button,c({},e,{ref:t,icon:"navigation"===n?sB:Gb,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,k.__)("Tools")}))},popoverProps:{placement:"bottom-start"},renderContent:()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.NavigableMenu,{role:"menu","aria-label":(0,k.__)("Tools")},(0,u.createElement)(h.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,u.createElement)(u.Fragment,null,(0,u.createElement)(Jd,{icon:Gb}),(0,k.__)("Edit"))},{value:"navigation",label:(0,u.createElement)(u.Fragment,null,sB,(0,k.__)("Select"))}]})),(0,u.createElement)("div",{className:"block-editor-tool-selector__help"},(0,k.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function cB(e){let{units:t,...n}=e;const o=(0,h.__experimentalUseCustomUnits)({availableUnits:qr("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,u.createElement)(h.__experimentalUnitControl,c({units:o},n))}var uB=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class dB extends u.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,k.__)("Edit link"):(0,k.__)("Insert link");return(0,u.createElement)("div",{className:"block-editor-url-input__button"},(0,u.createElement)(h.Button,{icon:tl,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,u.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,u.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,u.createElement)(h.Button,{className:"block-editor-url-input__back",icon:uB,label:(0,k.__)("Close"),onClick:this.toggle}),(0,u.createElement)(hb,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,u.createElement)(h.Button,{icon:gw,label:(0,k.__)("Submit"),type:"submit"}))))}}var pB=dB;var mB=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const gB="none",fB="custom",hB="media",vB="attachment",bB=["noreferrer","noopener"],_B=(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,u.createElement)(h.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),kB=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:s,linkClass:a,rel:c}=e;const[d,p]=(0,u.useState)(!1),[m,g]=(0,u.useState)(null),f=(0,u.useCallback)((()=>{p(!0)})),[v,b]=(0,u.useState)(!1),[_,y]=(0,u.useState)(null),E=(0,u.useRef)(null),C=(0,u.useCallback)((()=>{t!==hB&&t!==vB||y(""),b(!0)})),S=(0,u.useCallback)((()=>{b(!1)})),w=(0,u.useCallback)((()=>{y(null),S(),p(!1)})),B=(0,u.useCallback)((()=>e=>{const t=E.current;t&&t.contains(e.target)||(p(!1),y(null),S())})),I=(0,u.useCallback)((()=>e=>{if(_){var t;const e=(null===(t=T().find((e=>e.url===_)))||void 0===t?void 0:t.linkDestination)||fB;n({href:_,linkDestination:e})}S(),y(null),e.preventDefault()})),x=(0,u.useCallback)((()=>{n({linkDestination:gB,href:""})})),T=()=>{const e=[{linkDestination:hB,title:(0,k.__)("Media File"),url:"image"===r?l:void 0,icon:_B}];return"image"===r&&i&&e.push({linkDestination:vB,title:(0,k.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,u.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(h.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,u.createElement)(h.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},M=(0,u.createElement)(h.__experimentalVStack,{spacing:"3"},(0,u.createElement)(h.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");bB.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===bB.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===s}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Link rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,u.createElement)(h.TextControl,{__nextHasNoMarginBottom:!0,label:(0,k.__)("Link CSS Class"),value:a||"",onChange:e=>{n({linkClass:e})}})),N=null!==_?_:o,P=(T().find((e=>e.linkDestination===t))||{}).title;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.ToolbarButton,{icon:tl,className:"components-toolbar__control",label:o?(0,k.__)("Edit link"):(0,k.__)("Insert link"),"aria-expanded":d,onClick:f,ref:g}),d&&(0,u.createElement)(vw,{anchor:m,onFocusOutside:B(),onClose:w,renderSettings:()=>M,additionalControls:!N&&(0,u.createElement)(h.NavigableMenu,null,T().map((e=>(0,u.createElement)(h.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{y(null),(e=>{const t=T();let o;o=e?(t.find((t=>t.url===e))||{linkDestination:fB}).linkDestination:gB,n({linkDestination:o,href:e})})(e.url),S()}},e.title))))},(!o||v)&&(0,u.createElement)(vw.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:y,onSubmit:I(),autocompleteRef:E}),o&&!v&&(0,u.createElement)(u.Fragment,null,(0,u.createElement)(vw.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:C,urlLabel:P}),(0,u.createElement)(h.Button,{icon:mB,label:(0,k.__)("Remove link"),onClick:x}))))};function yB(e){let{children:t,viewLabel:n,className:o,isEnabled:r=!0,deviceType:l,setDeviceType:i}=e;if((0,m.useViewportMatch)("small","<"))return null;const s={className:p()(o,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!r,children:n},c={"aria-label":(0,k.__)("View options")};return(0,u.createElement)(h.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:s,toggleProps:a,menuProps:c,icon:null},(()=>(0,u.createElement)(u.Fragment,null,(0,u.createElement)(h.MenuGroup,null,(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Desktop"),icon:"Desktop"===l&&cm},(0,k.__)("Desktop")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Tablet"),icon:"Tablet"===l&&cm},(0,k.__)("Tablet")),(0,u.createElement)(h.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>i("Mobile"),icon:"Mobile"===l&&cm},(0,k.__)("Mobile"))),t)))}function EB(e){const[t,n]=(0,u.useState)(window.innerWidth);(0,u.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var CB=(0,g.withSelect)((e=>({selectedBlockClientId:e(E_).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Tr(t);return t?(0,u.createElement)(h.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,k.__)("Skip to the selected block")):null})),SB=window.wp.wordcount;var wB=(0,g.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(E_);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,SB.count)((0,s.serialize)(t),"words");return(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,u.createElement)(Ai,{icon:rm,showColors:!0}),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,k.sprintf)((0,k._n)("%d block","%d blocks",t.length),t.length)),(0,u.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,k.sprintf)((0,k._n)("%d word","%d words",n),n))))}));function BB(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:r}=(0,g.useSelect)((e=>{var n,o;const r=e(E_).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==r||null===(n=r.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==r?void 0:r.onChange)&&void 0!==o?o:null,styles:e(s.store).getBlockStyles(t)}}),[t]),l=(0,u.useMemo)((()=>[{label:(0,k.__)("Not set"),value:""},...r.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[r]),i=(0,u.useMemo)((()=>{var e;return null===(e=mm(r))||void 0===e?void 0:e.name}),[r]),a=(0,u.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==i?o&&(0,u.createElement)("div",{className:"default-style-picker__default-switcher"},(0,u.createElement)(h.SelectControl,{__nextHasNoMarginBottom:!0,options:l,value:n||"",label:(0,k.__)("Default Style"),onChange:a})):null}var IB=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));const xB=(0,u.createElement)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,u.createElement)(G.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const TB={name:"settings",title:"Settings",value:"settings",icon:IB,className:"block-editor-block-inspector__tab-item"},MB={name:"styles",title:"Styles",value:"styles",icon:xB,className:"block-editor-block-inspector__tab-item"},NB={name:"list",title:"List View",value:"list-view",icon:IC,className:"block-editor-block-inspector__tab-item"};var PB=()=>{const e=(0,h.__experimentalUseSlotFills)(Sl.slotName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,k.__)("Advanced"),initialOpen:!1},(0,u.createElement)(wl.Slot,{group:"advanced"})):null};var LB=()=>{const e=(0,h.__experimentalUseSlotFills)(ml.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,u.createElement)(h.PanelBody,{className:"block-editor-block-inspector__position",title:(0,k.__)("Position"),initialOpen:!1},(0,u.createElement)(wl.Slot,{group:"position"})):null};var RB=e=>{let{showAdvancedControls:t=!1}=e;return(0,u.createElement)(u.Fragment,null,(0,u.createElement)(wl.Slot,null),(0,u.createElement)(LB,null),t&&(0,u.createElement)("div",null,(0,u.createElement)(PB,null)))};var AB=e=>{let{blockName:t,clientId:n,hasBlockStyles:o}=e;return(0,u.createElement)(u.Fragment,null,o&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,k.__)("Styles")},(0,u.createElement)(XC,{clientId:n}),(0,s.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,u.createElement)(BB,{blockName:t}))),(0,u.createElement)(wl.Slot,{group:"color",label:(0,k.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(wl.Slot,{group:"typography",label:(0,k.__)("Typography")}),(0,u.createElement)(wl.Slot,{group:"dimensions",label:(0,k.__)("Dimensions")}),(0,u.createElement)(wl.Slot,{group:"border",label:(0,k.__)("Border")}),(0,u.createElement)(wl.Slot,{group:"styles"}))};const OB=["core/navigation"];var DB=e=>!OB.includes(e);function zB(e){let{blockName:t,clientId:n,hasBlockStyles:o,tabs:r}=e;const l=DB(t)?void 0:NB.name;return(0,u.createElement)(h.TabPanel,{className:"block-editor-block-inspector__tabs",tabs:r,initialTabName:l,key:n},(e=>e.name===TB.name?(0,u.createElement)(RB,{showAdvancedControls:!!t}):e.name===MB.name?(0,u.createElement)(AB,{blockName:t,clientId:n,hasBlockStyles:o}):e.name===NB.name?(0,u.createElement)(wl.Slot,{group:"list"}):void 0))}const FB=[];function VB(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:s,styles:a,typography:c}=ml,u=DB(e),d=(0,h.__experimentalUseSlotFills)(i.Slot.__unstableName),p=!u&&!!d&&d.length,m=[...(0,h.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,f=(0,h.__experimentalUseSlotFills)(Sl.slotName)||[],v=[...(0,h.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,h.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...p&&m>1?f:[]];p&&t.push(NB),v.length&&t.push(TB),m&&t.push(MB);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,g.useSelect)((e=>e(E_).getSettings().blockInspectorTabs),[]));return b?t:FB}function HB(e,t){const n=(0,u.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),o=(0,u.useCallback)((e=>!!n[e]),[e]);return(0,u.useMemo)((()=>GB([t],o)),[t,o])}function GB(e,t){const n=[];for(const o of e)t(o.name)&&n.push(o),n.push(...GB(o.innerBlocks,t));return n}function UB(e){let{blockTypes:t,block:n,selectedBlock:o}=e;const{selectBlock:r}=(0,g.useDispatch)(E_),l=t.find((e=>{let{name:t}=e;return t===n.name})),i=o&&o.clientId===n.clientId;return(0,u.createElement)(h.Button,{isPressed:i,onClick:()=>r(n.clientId)},(0,u.createElement)(h.__experimentalHStack,{justify:"flex-start"},(0,u.createElement)(Ai,{icon:l.icon}),(0,u.createElement)(h.FlexItem,null,l.title)))}function $B(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:o,selectedBlock:r}=(0,g.useSelect)((e=>({blockTypes:e(s.store).getBlockTypes(),block:e(E_).getBlock(t),selectedBlock:e(E_).getSelectedBlock()})),[t]),l=Ii(t),i=HB(n,o);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(Oi,c({},l,{className:l.isSynced&&"is-synced"})),(0,u.createElement)(mS,{blockClientId:t}),(0,u.createElement)(h.__experimentalVStack,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,u.createElement)("h2",{className:"block-editor-block-card__title"},(0,k.__)("Content")),i.map((e=>(0,u.createElement)(UB,{selectedBlock:r,key:e.clientId,block:e,blockTypes:n})))))}const jB=e=>{let{animate:t,wrapper:n,children:o}=e;return t?n(o):o},WB=e=>{let{blockInspectorAnimationSettings:t,selectedBlockClientId:n,children:o}=e;const r=t&&"leftToRight"===t.enterDirection?-50:50;return(0,u.createElement)(h.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},key:n},o)},KB=e=>{let{clientId:t,blockName:n}=e;const o=VB(n),r=(null==o?void 0:o.length)>1,l=(0,g.useSelect)((e=>{const{getBlockStyles:t}=e(s.store),o=t(n);return o&&o.length>0}),[n]),i=Ii(t);return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(Oi,c({},i,{className:i.isSynced&&"is-synced"})),(0,u.createElement)(mS,{blockClientId:t}),r&&(0,u.createElement)(zB,{hasBlockStyles:l,clientId:t,blockName:n,tabs:o}),!r&&(0,u.createElement)(u.Fragment,null,l&&(0,u.createElement)("div",null,(0,u.createElement)(h.PanelBody,{title:(0,k.__)("Styles")},(0,u.createElement)(XC,{clientId:t}),(0,s.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,u.createElement)(BB,{blockName:n}))),(0,u.createElement)(wl.Slot,null),(0,u.createElement)(wl.Slot,{group:"color",label:(0,k.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(wl.Slot,{group:"typography",label:(0,k.__)("Typography")}),(0,u.createElement)(wl.Slot,{group:"dimensions",label:(0,k.__)("Dimensions")}),(0,u.createElement)(wl.Slot,{group:"border",label:(0,k.__)("Border")}),(0,u.createElement)(wl.Slot,{group:"styles"}),(0,u.createElement)(LB,null),(0,u.createElement)("div",null,(0,u.createElement)(PB,null))),(0,u.createElement)(CB,{key:"back"}))};var qB=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:o,selectedBlockClientId:r,blockType:l,topLevelLockedBlock:i}=(0,g.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e(E_),i=t(),a=i&&o(i),c=a&&(0,s.getBlockType)(a);return{count:n(),selectedBlockClientId:i,selectedBlockName:a,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===l(i)?i:void 0)}}),[]),a=VB(null==l?void 0:l.name),c=(null==a?void 0:a.length)>1,d=(0,g.useSelect)((e=>{if(l){const t=e(E_).getSettings().__experimentalBlockInspectorAnimation;return null==t?void 0:t[l.name]}return null}),[r,l]);if(n>1)return(0,u.createElement)("div",{className:"block-editor-block-inspector"},(0,u.createElement)(wB,null),c?(0,u.createElement)(zB,{tabs:a}):(0,u.createElement)(u.Fragment,null,(0,u.createElement)(wl.Slot,null),(0,u.createElement)(wl.Slot,{group:"color",label:(0,k.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,u.createElement)(wl.Slot,{group:"typography",label:(0,k.__)("Typography")}),(0,u.createElement)(wl.Slot,{group:"dimensions",label:(0,k.__)("Dimensions")}),(0,u.createElement)(wl.Slot,{group:"border",label:(0,k.__)("Border")}),(0,u.createElement)(wl.Slot,{group:"styles"})));const p=o===(0,s.getUnregisteredTypeHandlerName)();return l&&r&&!p?i?(0,u.createElement)($B,{topLevelLockedBlock:i}):(0,u.createElement)(jB,{animate:d,wrapper:e=>(0,u.createElement)(WB,{blockInspectorAnimationSettings:d,selectedBlockClientId:r},e)},(0,u.createElement)(KB,{clientId:r,blockName:l.name})):t?(0,u.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,k.__)("No block selected.")):null};var YB=function(e){let{__unstableContentRef:t}=e;const[n,o]=(0,u.useState)(!1),r=(0,g.useSelect)((e=>e(E_).getBlockOrder()),[]);return(0,u.useEffect)((()=>{const e=setTimeout((()=>{o(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?r.map(((e,n)=>n===r.length-1?null:(0,u.createElement)(Cp,{key:e,previousClientId:e,nextClientId:r[n+1],__unstableContentRef:t},(0,u.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,u.createElement)(eb,{position:"bottom center",clientId:r[n+1],__experimentalIsQuick:!0}))))):null};function ZB(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:o}=e(E_);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:o()}}function QB(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,m.useViewportMatch)("medium"),{hasFixedToolbar:l,isZoomOutMode:i,isTyping:s}=(0,g.useSelect)(ZB,[]),a=(0,Pp.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:d,getBlockRootClientId:p}=(0,g.useSelect)(E_),{duplicateBlocks:f,removeBlocks:v,insertAfterBlock:b,insertBeforeBlock:_,clearSelectedBlock:k,moveBlocksUp:y,moveBlocksDown:E}=(0,g.useDispatch)(E_);const C=xl(n),S=xl(n);return(0,u.createElement)("div",c({},o,{onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);y(t,n)}}else if(a("core/block-editor/move-down",e)){const t=d();if(t.length){e.preventDefault();const n=p(t[0]);E(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=d();t.length&&(e.preventDefault(),f(t))}else if(a("core/block-editor/remove",e)){const t=d();t.length&&(e.preventDefault(),v(t))}else if(a("core/block-editor/insert-after",e)){const t=d();t.length&&(e.preventDefault(),b(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=d();t.length&&(e.preventDefault(),_(t[0]))}else if(a("core/block-editor/unselect",e)){d().length&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}}),(0,u.createElement)(Bp.Provider,{value:(0,u.useRef)(!1)},!s&&(0,u.createElement)(xp,{__unstableContentRef:n}),!i&&(l||!r)&&(0,u.createElement)(Tg,{isFixed:!0}),(0,u.createElement)(Zg,{__unstableContentRef:n}),(0,u.createElement)(h.Popover.Slot,{name:"block-toolbar",ref:C}),t,(0,u.createElement)(h.Popover.Slot,{name:"__unstable-block-tools-after",ref:S}),i&&(0,u.createElement)(YB,{__unstableContentRef:n})))}const XB=()=>{};var JB=(0,u.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:a,onSelect:c=XB,shouldFocusBlock:d=!1}=e;const{destinationRootClientId:p,prioritizePatterns:m}=(0,g.useSelect)((e=>{const{getBlockRootClientId:t,getSettings:r}=e(E_);return{destinationRootClientId:n||t(o)||void 0,prioritizePatterns:r().__experimentalPreferPatternsOnRoot}}),[o,n]);return(0,u.createElement)(Zv,{onSelect:c,rootClientId:p,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:a,shouldFocusBlock:d,prioritizePatterns:m,ref:t})}));function eI(){return null}eI.Register=function(){const{registerShortcut:e}=(0,g.useDispatch)(Pp.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,k.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,k.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,k.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,k.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,k.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,k.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,k.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,k.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,k.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,k.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var tI=eI;function nI(){return W()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const oI=new Set([md.UP,md.RIGHT,md.DOWN,md.LEFT,md.ENTER,md.BACKSPACE]);function rI(){const e=(0,g.useSelect)((e=>e(E_).isTyping()),[]),{stopTyping:t}=(0,g.useDispatch)(E_);return(0,m.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function lI(){const{isTyping:e,hasInlineToolbar:t}=(0,g.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(E_);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,g.useDispatch)(E_),r=rI(),l=(0,m.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,s=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,Di.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==md.ESCAPE&&t!==md.TAB||o()}function p(){s.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function a(e){const{type:t,target:o}=e;(0,Di.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&oI.has(t)}(e))&&n()}return r.addEventListener("keypress",a),r.addEventListener("keydown",a),()=>{r.removeEventListener("keypress",a),r.removeEventListener("keydown",a)}}),[e,t,n,o]);return(0,m.useMergeRefs)([r,l])}var iI=function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:lI()},t)};const sI=-1!==window.navigator.userAgent.indexOf("Trident"),aI=new Set([md.UP,md.DOWN,md.LEFT,md.RIGHT]);function cI(){const e=(0,g.useSelect)((e=>e(E_).hasSelectedBlock()),[]);return(0,m.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,Di.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(aI.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,Di.getScrollContainer)(t);if(!a)return;const c=a===n.body||a===n.documentElement,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const g=c?o.innerHeight:a.clientHeight;i.top+i.height>d+g||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,Di.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var uI=sI?e=>e.children:function(e){let{children:t}=e;return(0,u.createElement)("div",{ref:cI(),className:"block-editor__typewriter"},t)};const dI=(0,u.createContext)({});function pI(e){let{children:t,uniqueId:n,blockName:o=""}=e;const r=(0,u.useContext)(dI),{name:l}=$r();o=o||l;const i=(0,u.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(r,o,n)),[r,o,n]);return(0,u.createElement)(dI.Provider,{value:i},t)}function mI(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,u.useContext)(dI),{name:r}=$r();return n=n||r,Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e))}var gI=(0,u.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,u.createElement)(G.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function fI(e){let{title:t,help:n,actions:o=[],onClose:r}=e;return(0,u.createElement)(h.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,u.createElement)(h.__experimentalHStack,{alignment:"center"},(0,u.createElement)(h.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},t),(0,u.createElement)(h.__experimentalSpacer,null),o.map((e=>{let{label:t,icon:n,onClick:o}=e;return(0,u.createElement)(h.Button,{key:t,className:"block-editor-inspector-popover-header__action",label:t,icon:n,variant:!n&&"tertiary",onClick:o},!n&&t)})),r&&(0,u.createElement)(h.Button,{className:"block-editor-inspector-popover-header__action",label:(0,k.__)("Close"),icon:gI,onClick:r})),n&&(0,u.createElement)(h.__experimentalText,null,n))}var hI=(0,u.forwardRef)((function(e,t){let{onClose:n,onChange:o,...r}=e;return(0,u.createElement)("div",{ref:t,className:"block-editor-publish-date-time-picker"},(0,u.createElement)(fI,{title:(0,k.__)("Publish"),actions:[{label:(0,k.__)("Now"),onClick:()=>null==o?void 0:o(null)}],onClose:n}),(0,u.createElement)(h.DateTimePicker,c({startOfWeek:(0,vS.getSettings)().l10n.startOfWeek,__nextRemoveHelpButton:!0,__nextRemoveResetButton:!0,onChange:o},r)))}));const vI={button:"wp-element-button",caption:"wp-element-caption"},bI=e=>vI[e]?vI[e]:"";function _I(e,t){return Object.entries(t).every((t=>{let[n,o]=t;return"object"==typeof o&&"object"==typeof e[n]?_I(e[n],o):e[n]===o}))}const kI=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&_I(e,n)}));return 1===n.length?n[0]:void 0};function yI(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function EI(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>yI(II(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function CI(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=EI(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return yI(e)}function SI(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function wI(e){let t=!1;const n=e.split(/(?!^-)[+*\/-](\s?-)?/g).filter(Boolean);for(const o of n){const n=yI(II(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function BI(e,t){const n=96,o=.01,r=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),l={em:r.fontSize,rem:r.fontSize,vh:r.height*o,vw:r.width*o,vmin:(r.width<r.height?r.width:r.height)*o,vmax:(r.width>r.height?r.width:r.height)*o,"%":("font"===r.type?r.fontSize:r.width)*o,ch:8,ex:7.15625,lh:r.lineHeight},i={in:n,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":i[e.unit]?(i[e.unit]*e.value).toFixed(0)+"px":null}function II(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=yI(e);return n.unit||(n=CI(e)),SI(e)&&!n.unit?wI(e):BI(n,t)}const xI={};function TI(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var MI=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+TI(t);return xI[n]||(xI[n]=II(e,t)),xI[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();