WordPress/wp-includes/js/dist/block-editor.min.js

26 lines
510 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()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!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",a,!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:a,update:p}),s()}function s(){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 a(e){var t=r.get(e);t&&t.destroy()}function s(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],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),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)for(var a in n)o.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,a=0,s=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(s,s+c.count)),s+=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(a,a+c.count);d=d.map((function(e,t){var n=o[s+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=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 a(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 s=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=s+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=s&&m+1>=c)return a([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<s,g=m&&0<=f&&f<c;if(h||g){if(!h||g&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=s&&f+1>=c)return a(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var h=f();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,a=i-o,s=0;i+1<r&&a+1<l&&this.equals(t[i+1],n[a+1]);)i++,a++,s++;return s&&e.components.push({count:s}),e.newPos=i,a},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,a=n.alignWithLeft,s=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),f=o.outerHeight(e),h=o.outerWidth(e),g=void 0,v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,w=void 0,S=void 0;p?(E=t,S=o.height(E),w=o.width(E),C={left:o.scrollLeft(E),top:o.scrollTop(E)},_={left:m.left-C.left-c,top:m.top-C.top-s},y={left:m.left+h-(C.left+w)+d,top:m.top+f-(C.top+S)+u},k=C):(g=o.offset(t),v=t.clientHeight,b=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},_={left:m.left-(g.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(g.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},y={left:m.left+h-(g.left+b+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+f-(g.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),_.top<0||y.top>0?!0===i?o.scrollTop(t,k.top+_.top):!1===i?o.scrollTop(t,k.top+y.top):_.top<0?o.scrollTop(t,k.top+_.top):o.scrollTop(t,k.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+_.top):o.scrollTop(t,k.top+y.top)),r&&(_.left<0||y.left>0?!0===a?o.scrollLeft(t,k.left+_.left):!1===a?o.scrollLeft(t,k.left+y.left):_.left<0?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.left+y.left):l||((a=void 0===a||!!a)?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.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 a=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),s=/^(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(a.test(n)&&!s.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var a=void 0;a="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,a))||0}return o}function h(e){return null!=e&&e==e.window}var g={};function v(e,t,n){if(h(e))return"width"===t?g.viewportWidth(e):g.viewportHeight(e);if(9===e.nodeType)return"width"===t?g.docWidth(e):g.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 a=void 0!==r||l,s=r||i;if(-1===n)return a?s-f(e,["border","padding"],o):i;if(a){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return s+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){g["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],g["viewport"+e](n))},g["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);g["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];g[e]=function(t,o){if(void 0===o)return t&&k(t,e,-1);if(t){c(t);return d(t)&&(o+=f(t,["padding","border"],n)),_(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"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},g)},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 a=o(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var s=document.body;s.appendChild(i),n=i.offsetHeight,s.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,a,s,c,u,d,p,m,f,h,g=!1;function v(){if(!g){g=!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),f=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(e);i=k?parseFloat(k[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(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 _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;s=!!b[2],c=!!b[3]}else a=s=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()||s},osx:function(){return v()||a},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||h},nativeApp:function(){return v()||f},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 a=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 a.name="Invariant Violation",a}}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 a=n(9196),s=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),s=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",l({},s,{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:s.number,maxRows:s.number,onResize:s.func,innerRef:s.any,async:s.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(f=!1)},delete:function(e){delete h.parent.node[h.key],e&&(f=!1)},remove:function(e){a(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return h;function g(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}g();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),f?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),g(),s(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(a(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===i(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return s(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var a=r(o);return e.push(o),t.push(a),s(l(o),(function(e){a[e]=n(o[e])})),e.pop(),t.pop(),a}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};s(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return jv},AlignmentToolbar:function(){return Kv},Autocomplete:function(){return nb},BlockAlignmentControl:function(){return Fr},BlockAlignmentToolbar:function(){return zr},BlockBreadcrumb:function(){return ab},BlockColorsStyleSelector:function(){return pb},BlockContextProvider:function(){return el},BlockControls:function(){return oo},BlockEdit:function(){return rl},BlockEditorKeyboardShortcuts:function(){return Wy},BlockEditorProvider:function(){return jc},BlockFormatControls:function(){return no},BlockIcon:function(){return Uc},BlockInspector:function(){return Vy},BlockList:function(){return Gf},BlockMover:function(){return rm},BlockNavigationDropdown:function(){return Ab},BlockPreview:function(){return bd},BlockSelectionClearer:function(){return Yc},BlockSettingsMenu:function(){return af},BlockSettingsMenuControls:function(){return nf},BlockStyles:function(){return zb},BlockTitle:function(){return Gp},BlockToolbar:function(){return hf},BlockTools:function(){return Hy},BlockVerticalAlignmentControl:function(){return sr},BlockVerticalAlignmentToolbar:function(){return cr},ButtonBlockAppender:function(){return Pp},ButtonBlockerAppender:function(){return Np},ColorPalette:function(){return ok},ColorPaletteControl:function(){return rk},ContrastChecker:function(){return Ah},CopyHandler:function(){return zm},DefaultBlockAppender:function(){return xp},FontSizePicker:function(){return Sg},InnerBlocks:function(){return Ff},Inserter:function(){return Ip},InspectorAdvancedControls:function(){return Oo},InspectorControls:function(){return Fo},JustifyContentControl:function(){return pr},JustifyToolbar:function(){return mr},LineHeightControl:function(){return ag},MediaPlaceholder:function(){return O_},MediaReplaceFlow:function(){return M_},MediaUpload:function(){return N_},MediaUploadCheck:function(){return P_},MultiSelectScrollIntoView:function(){return $y},NavigableToolbar:function(){return Kp},ObserveTyping:function(){return Yy},PanelColorSettings:function(){return F_},PlainText:function(){return py},RichText:function(){return cy},RichTextShortcut:function(){return hy},RichTextToolbarButton:function(){return gy},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return Ly},ToolSelector:function(){return ky},Typewriter:function(){return Jy},URLInput:function(){return r_},URLInputButton:function(){return Cy},URLPopover:function(){return A_},Warning:function(){return il},WritingFlow:function(){return su},__experimentalBlockAlignmentMatrixControl:function(){return lb},__experimentalBlockContentOverlay:function(){return sb},__experimentalBlockFullHeightAligmentControl:function(){return rb},__experimentalBlockPatternSetup:function(){return Zb},__experimentalBlockPatternsList:function(){return Hd},__experimentalBlockVariationPicker:function(){return Hb},__experimentalBlockVariationTransforms:function(){return tk},__experimentalBorderRadiusControl:function(){return vh},__experimentalBorderStyleControl:function(){return Ch},__experimentalColorGradientControl:function(){return qf},__experimentalColorGradientSettingsDropdown:function(){return Yf},__experimentalDateFormatPicker:function(){return ak},__experimentalDuotoneControl:function(){return pv},__experimentalFontAppearanceControl:function(){return rg},__experimentalFontFamilyControl:function(){return vg},__experimentalGetBorderClassesAndStyles:function(){return Bv},__experimentalGetColorClassesAndStyles:function(){return xv},__experimentalGetGradientClass:function(){return Nh},__experimentalGetGradientObjectByGradientValue:function(){return Mh},__experimentalGetMatchingVariation:function(){return oE},__experimentalGetSpacingClassesAndStyles:function(){return Pv},__experimentalImageEditingProvider:function(){return Vk},__experimentalImageEditor:function(){return Qk},__experimentalImageSizeControl:function(){return Zk},__experimentalImageURLInputUI:function(){return Py},__experimentalLayoutStyle:function(){return Pr},__experimentalLetterSpacingControl:function(){return Kg},__experimentalLibrary:function(){return Gy},__experimentalLinkControl:function(){return I_},__experimentalLinkControlSearchInput:function(){return v_},__experimentalLinkControlSearchItem:function(){return a_},__experimentalLinkControlSearchResults:function(){return u_},__experimentalListView:function(){return Rb},__experimentalPanelColorGradientSettings:function(){return gk},__experimentalPreviewOptions:function(){return My},__experimentalResponsiveBlockControl:function(){return fy},__experimentalTextDecorationControl:function(){return Ag},__experimentalTextTransformControl:function(){return Ug},__experimentalToolsPanelColorDropdown:function(){return Dh},__experimentalUnitControl:function(){return _y},__experimentalUseBlockPreview:function(){return kd},__experimentalUseBorderProps:function(){return Iv},__experimentalUseColorProps:function(){return Nv},__experimentalUseCustomSides:function(){return Qo},__experimentalUseGradient:function(){return Lh},__experimentalUseNoRecursiveRenders:function(){return nE},__experimentalUseResizeCanvas:function(){return Ry},__unstableBlockNameContext:function(){return ff},__unstableBlockSettingsMenuFirstItem:function(){return $m},__unstableBlockToolbarLastItem:function(){return Rm},__unstableEditorStyles:function(){return fd},__unstableIframe:function(){return du},__unstableInserterMenuExtension:function(){return gp},__unstableRichTextInputEvent:function(){return vy},__unstableUseBlockSelectionClearer:function(){return qc},__unstableUseClipboardHandler:function(){return Fm},__unstableUseMouseMoveTypingReset:function(){return Ky},__unstableUseTypewriter:function(){return Zy},__unstableUseTypingObserver:function(){return qy},createCustomColorsHOC:function(){return Dv},getColorClassName:function(){return eh},getColorObjectByAttributeValues:function(){return Zf},getColorObjectByColorValue:function(){return Jf},getFontSize:function(){return Eg},getFontSizeClass:function(){return wg},getFontSizeObjectByValue:function(){return Cg},getGradientSlugByValue:function(){return Rh},getGradientValueBySlug:function(){return Ph},getPxFromCssUnit:function(){return mE},store:function(){return Kn},storeConfig:function(){return jn},transformStyles:function(){return dd},useBlockDisplayInformation:function(){return Vp},useBlockEditContext:function(){return Xn},useBlockProps:function(){return Mc},useCachedTruthy:function(){return Mv},useInnerBlocksProps:function(){return Of},useSetting:function(){return Bo},withColorContext:function(){return nk},withColors:function(){return Ov},withFontSizes:function(){return zv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Rt},__experimentalGetAllowedBlocks:function(){return mt},__experimentalGetAllowedPatterns:function(){return vt},__experimentalGetBlockListSettingsForBlocks:function(){return Ct},__experimentalGetDirectInsertBlock:function(){return ft},__experimentalGetGlobalBlocksByName:function(){return X},__experimentalGetLastBlockAttributeChanges:function(){return Bt},__experimentalGetParsedPattern:function(){return ht},__experimentalGetPatternTransformItems:function(){return kt},__experimentalGetPatternsByBlockTypes:function(){return bt},__experimentalGetReusableBlockTitle:function(){return wt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsFullySelected:function(){return Ie},__unstableIsLastBlockChangeIgnored:function(){return St},__unstableIsSelectionMergeable:function(){return xe},areInnerBlocksControlled:function(){return Mt},canEditBlock:function(){return ot},canInsertBlockType:function(){return Xe},canInsertBlocks:function(){return Ze},canLockBlockType:function(){return rt},canMoveBlock:function(){return tt},canMoveBlocks:function(){return nt},canRemoveBlock:function(){return Je},canRemoveBlocks:function(){return et},didAutomaticChange:function(){return Nt},getAdjacentBlockClientId:function(){return me},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return J},getBlockHierarchyRootClientId:function(){return de},getBlockIndex:function(){return Ne},getBlockInsertionPoint:function(){return We},getBlockListSettings:function(){return _t},getBlockMode:function(){return Oe},getBlockName:function(){return V},getBlockOrder:function(){return Te},getBlockParents:function(){return ce},getBlockParentsByBlockName:function(){return ue},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return oe},getBlockSelectionStart:function(){return ne},getBlockTransformItems:function(){return dt},getBlocks:function(){return $},getBlocksByClientId:function(){return Z},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Ve},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return Q},getInserterItems:function(){return ut},getLastMultiSelectedBlockClientId:function(){return ye},getLowestCommonAncestorWithSelectedBlock:function(){return pe},getMultiSelectedBlockClientIds:function(){return be},getMultiSelectedBlocks:function(){return ke},getMultiSelectedBlocksEndClientId:function(){return Be},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return he},getPreviousBlockClientId:function(){return fe},getSelectedBlock:function(){return ae},getSelectedBlockClientId:function(){return ie},getSelectedBlockClientIds:function(){return ve},getSelectedBlockCount:function(){return re},getSelectedBlocksInitialCaretPosition:function(){return ge},getSelectionEnd:function(){return te},getSelectionStart:function(){return ee},getSettings:function(){return yt},getTemplate:function(){return Ke},getTemplateLock:function(){return qe},hasBlockMovingClientId:function(){return Tt},hasInserterItems:function(){return pt},hasMultiSelection:function(){return Le},hasSelectedBlock:function(){return le},hasSelectedInnerBlock:function(){return Me},isAncestorBeingDragged:function(){return Ge},isAncestorMultiSelected:function(){return we},isBlockBeingDragged:function(){return He},isBlockHighlighted:function(){return Pt},isBlockInsertionPointVisible:function(){return $e},isBlockMultiSelected:function(){return Ce},isBlockSelected:function(){return Pe},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Re},isCaretWithinFormattedText:function(){return Ue},isDraggingBlocks:function(){return ze},isFirstMultiSelectedBlock:function(){return Ee},isLastBlockChangePersistent:function(){return Et},isMultiSelecting:function(){return Ae},isNavigationMode:function(){return xt},isSelectionEnabled:function(){return De},isTyping:function(){return Fe},isValidTemplate:function(){return je},wasBlockJustInserted:function(){return Lt}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return hn},__unstableExpandSelection:function(){return vn},__unstableMarkAutomaticChange:function(){return Dn},__unstableMarkLastChangeAsPersistent:function(){return Ln},__unstableMarkNextChangeAsNotPersistent:function(){return An},__unstableSaveReusableBlock:function(){return Rn},__unstableSplitSelection:function(){return gn},clearSelectedBlock:function(){return Xt},duplicateBlocks:function(){return zn},enterFormattedText:function(){return In},exitFormattedText:function(){return xn},flashBlock:function(){return Un},hideInsertionPoint:function(){return dn},insertAfterBlock:function(){return Hn},insertBeforeBlock:function(){return Vn},insertBlock:function(){return sn},insertBlocks:function(){return cn},insertDefaultBlock:function(){return Nn},mergeBlocks:function(){return bn},moveBlockToPosition:function(){return an},moveBlocksDown:function(){return on},moveBlocksToPosition:function(){return ln},moveBlocksUp:function(){return rn},multiSelect:function(){return Qt},receiveBlocks:function(){return Gt},removeBlock:function(){return _n},removeBlocks:function(){return kn},replaceBlock:function(){return tn},replaceBlocks:function(){return en},replaceInnerBlocks:function(){return yn},resetBlocks:function(){return zt},resetSelection:function(){return Ht},selectBlock:function(){return $t},selectNextBlock:function(){return Kt},selectPreviousBlock:function(){return jt},selectionChange:function(){return Tn},setBlockMovingClientId:function(){return Fn},setHasControlledInnerBlocks:function(){return Wn},setNavigationMode:function(){return On},setTemplateValidity:function(){return pn},showInsertionPoint:function(){return un},startDraggingBlocks:function(){return Sn},startMultiSelect:function(){return qt},startTyping:function(){return Cn},stopDraggingBlocks:function(){return Bn},stopMultiSelect:function(){return Yt},stopTyping:function(){return wn},synchronizeTemplate:function(){return mn},toggleBlockHighlight:function(){return Gn},toggleBlockMode:function(){return En},toggleSelection:function(){return Zt},updateBlock:function(){return Wt},updateBlockAttributes:function(){return Ut},updateBlockListSettings:function(){return Pn},updateSettings:function(){return Mn},validateBlocksToTemplate:function(){return Vt}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var a=window.wp.element,s=n(4403),c=n.n(s),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data;var f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},h=window.wp.i18n;const g={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return E(e,(e=>e.attributes))}function S(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function I(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const x=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=I(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=I(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId&&e.push(n.fromRootClientId),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:w(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=null==o?void 0:o.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!S(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...C(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...C(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=_(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=_(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const a=i.indexOf(r);return{...e,[o]:k(i,a,a+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=_(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...y(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}var N,P,M=(0,m.combineReducers)({blocks:x,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},isCaretWithinFormattedText:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENTER_FORMATTED_TEXT":return!0;case"EXIT_FORMATTED_TEXT":return!1}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:a}=l;return{selectionStart:i,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=l;return s===(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:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let a=null!=i&&i.name?`${l}/${i.name}`:l;const s={name:a};return"core/block"===l&&(s.ref=o.ref,a+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[a]:{time:t.time,count:e.insertUsage[a]?e.insertUsage[a].count+1:1,insert:s}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":if(!n.blocks.length)return t;return{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,a,s=arguments.length;for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];for(a=t.apply(null,i),(n=o(a)).isUniqueByDependants||(n.lastDependants&&!A(a,n.lastDependants,0)&&n.clear(),n.lastDependants=a),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(e){var t,o,r,l,i,a=n,s=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){s=!1;break}a.has(o)?a=a.get(o):(r=new WeakMap,a.set(o,r),a=r)}return a.has(N)||((l=L()).isUniqueByDependants=s,a.set(N,l)),a.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives;var F=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==a.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&Mt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Te(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=D(((e,t)=>{const n=[];for(const o of t)for(const t of Te(e,o))n.push(t,...q(e,[t]));return n}),(e=>[e.blocks.order])),Y=D((e=>{const t=[];for(const n of Te(e))t.push(n,...q(e,[n]));return t}),(e=>[e.blocks.order])),Q=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),X=D(((e,t)=>{if(!t)return z;const n=Y(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:z}),(e=>[e.blocks.order,e.blocks.byClientId])),Z=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function J(e,t){return Te(e,t).length}function ee(e){return e.selection.selectionStart}function te(e){return e.selection.selectionEnd}function ne(e){return e.selection.selectionStart.clientId}function oe(e){return e.selection.selectionEnd.clientId}function re(e){const t=be(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ae(e){const t=ie(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ce=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ue=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ce(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function de(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function pe(e,t){const n=ie(e),o=[...ce(e,t),t],r=[...ce(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 me(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ie(e)),void 0===t&&(t=n<0?_e(e):ye(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),a=i+1*n;return a<0||a===l.length?null:l[a]}function fe(e,t){return me(e,t,-1)}function he(e,t){return me(e,t,1)}function ge(e){return e.initialPosition}const ve=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Te(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 be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:ve(e)}const ke=D((e=>{const t=be(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...ve.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(be(e))||null}function ye(e){return(0,u.last)(be(e))||null}function Ee(e,t){return _e(e)===t}function Ce(e,t){return-1!==be(e).indexOf(t)}const we=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ce(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ie(e){const t=ee(e),n=te(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function xe(e,t){const n=ee(e),o=te(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=se(e,n.clientId);if(l!==se(e,o.clientId))return!1;const i=Te(e,l);let a,s;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(a=o,s=n):(a=n,s=o);const c=t?s.clientId:a.clientId,u=t?a.clientId:s.clientId,d=U(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=U(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}function Te(e,t){return e.blocks.order[t||""]||z}function Ne(e,t){return Te(e,se(e,t)).indexOf(t)}function Pe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Me(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Te(e,t),(t=>Pe(e,t)||Ce(e,t)||n&&Me(e,t,n)))}function Re(e,t){if(!t)return!1;const n=be(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ae(e){return e.isMultiSelecting}function De(e){return e.isSelectionEnabled}function Oe(e,t){return e.blocksMode[t]||"visual"}function Fe(e){return e.isTyping}function ze(e){return!!e.draggedBlocks.length}function Ve(e){return e.draggedBlocks}function He(e,t){return e.draggedBlocks.includes(t)}function Ge(e,t){if(!ze(e))return!1;const n=ce(e,t);return(0,u.some)(n,(t=>He(e,t)))}function Ue(e){return e.isCaretWithinFormattedText}function We(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=Ne(e,r.clientId)+1):n=Te(e).length,{rootClientId:t,index:n}}function $e(e){return null!==e.insertionPoint}function je(e){return e.template.isValid}function Ke(e){return e.settings.template}function qe(e,t){if(!t)return e.settings.templateLock;const n=_t(e,t);return n?n.templateLock:null}const Ye=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Qe=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=yt(e),a=Ye(i,t,!0);if(!a)return!1;const s=!!qe(e,o);if(s)return!1;const c=_t(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Ye(d,t),m=n.parent,f=V(e,o),h=Ye(m,f);let g=!0;const v=n.ancestor;if(v){const t=[o,...ce(e,o)];g=(0,u.some)(t,(t=>Ye(v,V(e,t))))}const b=g&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ue.bind(null,e)}):b},Xe=D(Qe,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(e,V(e,t),n)))}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!qe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function et(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Je(e,t,n)))}function tt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===qe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>tt(e,t,n)))}function ot(e,t){const n=G(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function rt(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function lt(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 it=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Qe(e,t.name,n),at=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=lt(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:st(r,l)}},st=(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}},ct=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Z(e,Y(e)),{name:t.name}));const{time:i,count:a=0}=lt(e,o)||{},s={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:st(i,a)};if("transform"===n)return s;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...s,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ut=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=ct(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===a.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:s=0}=lt(e,l)||{},c=st(i,s);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>it(e,n,t))).map(n),s=Qe(e,"core/block",t)?It(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=at(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...s]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,It(e),(0,r.getBlockTypes)()])),dt=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=ct(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>it(e,t,o))).map(i),s=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=s[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>s[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>it(e,n,t)));if(n)return!0;const o=Qe(e,"core/block",t)&&It(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,It(e),(0,r.getBlockTypes)()])),mt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>it(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ft=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ht=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),gt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=yt(e),o=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ht(e,n)})),r=o.filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!Ye(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])),vt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return Xe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),bt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=vt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...vt.getDependants(e,t)])),kt=D((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||Mt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return bt(e,o,n)}),((e,t)=>[...bt.getDependants(e,t)]));function _t(e,t){return e.blockListSettings[t]}function yt(e){return e.settings}function Et(e){return e.blocks.isPersistentChange}const Ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),wt=D(((e,t)=>{var n;const o=(0,u.find)(It(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[It(e)]));function St(e){return e.blocks.isIgnoredChange}function Bt(e){return e.lastBlockAttributesChange}function It(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 xt(e){return e.isNavigationMode}function Tt(e){return e.hasBlockMovingClientId}function Nt(e){return!!e.automaticChangeStatus}function Pt(e,t){return e.highlightedBlock===t}function Mt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Rt=D(((e,t)=>{if(!t.length)return null;const n=ie(e);if(t.includes(V(e,n)))return n;const o=be(e),r=ue(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Lt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var At=window.wp.a11y,Dt=window.wp.richText,Ot=window.wp.deprecated,Ft=n.n(Ot);const zt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Vt(e))},Vt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),a=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(a!==n.isValidTemplate())return o.setTemplateValidity(a),a};function Ht(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Gt(e){return Ft()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ut(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Wt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function $t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Kt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function qt(){return{type:"START_MULTI_SELECT"}}function Yt(){return{type:"STOP_MULTI_SELECT"}}const Qt=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,At.speak)((0,h.sprintf)((0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function Xt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Zt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Jt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,a=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${a}`.trim()}}}))}const en=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:a}=l;e=(0,u.castArray)(e),t=Jt((0,u.castArray)(t),i.getSettings());const s=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,s))return}a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),a((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function tn(e,t){return en(e,t)}const nn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},on=nn("MOVE_BLOCKS_DOWN"),rn=nn("MOVE_BLOCKS_UP"),ln=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 an(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 ln([e],t,n,o)}function sn(e,t,n,o,r){return cn([e],t,n,o,0,r)}const cn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:a,dispatch:s}=i;(0,u.isObject)(r)&&(l=r,r=0,Ft()("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=Jt((0,u.castArray)(e),a.getSettings());const c=[];for(const t of e){a.canInsertBlockType(t.name,n)&&c.push(t)}c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function un(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function dn(){return{type:"HIDE_INSERTION_POINT"}}function pn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const mn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)};function fn(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const hn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),a=o.getSelectionEnd();if(i.clientId===a.clientId)return;if(!i.attributeKey||!a.attributeKey||void 0===i.offset||void 0===a.offset)return!1;const s=o.getBlockRootClientId(i.clientId);if(s!==o.getBlockRootClientId(a.clientId))return;const c=o.getBlockOrder(s);let d,p;c.indexOf(i.clientId)>c.indexOf(a.clientId)?(d=a,p=i):(d=i,p=a);const m=e?p:d,f=o.getBlock(m.clientId),h=(0,r.getBlockType)(f.name);if(!h.merge)return;const g=d,v=p,b=o.getBlock(g.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[g.attributeKey],C=_.attributes[v.attributeKey],w=k.attributes[g.attributeKey],S=y.attributes[v.attributeKey];let B=(0,Dt.create)({html:E,...fn(w)}),I=(0,Dt.create)({html:C,...fn(S)});B=(0,Dt.remove)(B,g.offset,B.text.length),I=(0,Dt.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[g.attributeKey]:(0,Dt.toHTMLString)({value:B,...fn(w)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,Dt.toHTMLString)({value:I,...fn(S)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,h.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=h.merge(e.attributes,T.attributes)}else{const e=P.shift();M=h.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,Dt.create)({html:L,...fn(h.attributes[R])}),D=A.text.indexOf("†"),O=(0,Dt.remove)(A,D,D+1),F=(0,Dt.toHTMLString)({value:O,...fn(h.attributes[R])});M[R]=F;const z=o.getSelectedBlockClientIds(),V=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},gn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const a=t.getBlockOrder(i);let s,c;a.indexOf(o.clientId)>a.indexOf(l.clientId)?(s=l,c=o):(s=o,c=l);const u=s,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),f=t.getBlock(d.clientId),h=(0,r.getBlockType)(f.name),g=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,Dt.create)({html:g,...fn(b)}),y=(0,Dt.create)({html:v,...fn(k)});_=(0,Dt.remove)(_,u.offset,_.text.length),y=(0,Dt.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,Dt.toHTMLString)({value:_,...fn(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,Dt.toHTMLString)({value:y,...fn(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},vn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},bn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[a,s]=i,c=o.getBlock(a),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(s),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:h,offset:g}=o.getSelectionStart(),v=(f===a?d:m).attributes[h],b=(f===a||f===s)&&void 0!==h&&void 0!==g&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===a?k:_,t=e.attributes[h],n=(0,Dt.insert)((0,Dt.create)({html:t,...fn(v)}),"†",g,g);e.attributes[h]=(0,Dt.toHTMLString)({value:n,...fn(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],n=(0,Dt.create)({html:t,...fn(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,Dt.remove)(n,o,o+1),i=(0,Dt.toHTMLString)({value:r,...fn(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},kn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function _n(e,t){return kn([e],t)}function yn(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 En(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Cn(){return{type:"START_TYPING"}}function wn(){return{type:"STOP_TYPING"}}function Sn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Bn(){return{type:"STOP_DRAGGING_BLOCKS"}}function In(){return{type:"ENTER_FORMATTED_TEXT"}}function xn(){return{type:"EXIT_FORMATTED_TEXT"}}function Tn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Nn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const a=(0,r.createBlock)(i,e);return l.insertBlock(a,n,t)};function Pn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Mn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Rn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Ln(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function An(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Dn=()=>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"})}))},On=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,At.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,At.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Fn=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,At.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},zn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if((0,u.some)(i,(e=>!e)))return;const a=i.map((e=>e.name));if(a.some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),c=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),d=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(d,c+1,s,t),d.length>1&&t&&l.multiSelect((0,u.first)(d).clientId,(0,u.last)(d).clientId),d.map((e=>e.clientId))}},Vn=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)},Hn=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 Gn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Un=e=>async t=>{let{dispatch:n}=t;n(Gn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Gn(e,!1))};function Wn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const $n="core/block-editor",jn={reducer:M,selectors:e,actions:t},Kn=(0,m.createReduxStore)($n,{...jn,persist:["preferences"]});(0,m.registerStore)($n,{...jn,persist:["preferences"]});const qn={name:"",isSelected:!1},Yn=(0,a.createContext)(qn),{Provider:Qn}=Yn;function Xn(){return(0,a.useContext)(Yn)}function Zn(){const{isSelected:e,clientId:t,name:n}=Xn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Kn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Jn(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Zn(),{clientId:o}=Xn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Kn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,a.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function eo(e){let{group:t="default",...n}=e;const o=(0,a.useContext)(p.__experimentalToolbarContext),r=f[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const to=Jn;to.Slot=eo;const no=e=>(0,a.createElement)(Jn,i({group:"inline"},e));no.Slot=e=>(0,a.createElement)(eo,i({group:"inline"},e));var oo=to;var ro=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"}));var lo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"}));var io=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"}));var ao=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"}));var so=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));var co=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));var uo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var po=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"}));var mo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var fo=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var ho=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}));var go=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function vo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const bo=(0,a.createContext)({refs:new Map,callbacks:new Map});function ko(e){let{children:t}=e;const n=(0,a.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,a.createElement)(bo.Provider,{value:n},t)}function _o(e){const{refs:t,callbacks:n}=(0,a.useContext)(bo),o=(0,a.useRef)();return(0,a.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function yo(e){const{refs:t}=(0,a.useContext)(bo),n=(0,a.useRef)();return n.current=e,(0,a.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Eo(e){const{callbacks:t}=(0,a.useContext)(bo),n=yo(e),[o,r]=(0,a.useState)(null);return(0,a.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const Co=["color","border","typography","spacing"],wo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},So={"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 Bo(e){const{name:t}=Xn(),n=(0,m.useSelect)((n=>{var o;if(Co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Kn).getSettings(),i=(e=>So[e]||e)(e),a=`__experimentalFeatures.${i}`,s=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,s))&&void 0!==o?o:(0,u.get)(l,a);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=wo[i]?wo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e]);return n}window.wp.warning;var Io={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function xo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Zn(),l=null===(t=Io[n])||void 0===t?void 0:t.Fill;return l?r?(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,a.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const To=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,To),u.identity);return(0,u.isEmpty)(t)?void 0:t};function No(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Po(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let a=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var s;a=null===(s=o[r])||void 0===s?void 0:s.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(a,e);t&&(c={...c,attributes:No(c.attributes,e,t)})}))})),c}function Mo(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Ro(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Kn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:c}=(0,m.useSelect)(Kn),u=s(),d=(0,a.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:To(r.style)},t[n]=r})),r(n,t,!0)}),[To,l,i,c,u,r]);return(0,a.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Lo(e){let{Slot:t,...n}=e;const o=(0,a.useContext)(p.__experimentalToolsPanelContext);return(0,a.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Ao(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=Io[n])||void 0===t?void 0:t.Slot,s=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);if(!l||!s)return"undefined"!=typeof process&&process.env,null;return Boolean(s.fills&&s.fills.length)?o?(0,a.createElement)(Ro,{group:n,label:o},(0,a.createElement)(Lo,i({},r,{Slot:l}))):(0,a.createElement)(l,i({},r,{bubblesVirtually:!0})):null}const Do=xo;Do.Slot=Ao;const Oo=e=>(0,a.createElement)(xo,i({},e,{__experimentalGroup:"advanced"}));Oo.Slot=e=>(0,a.createElement)(Ao,i({},e,{__experimentalGroup:"advanced"})),Oo.slotName="InspectorAdvancedControls";var Fo=Do;function zo(e){const t=(0,r.getBlockSupport)(e,$o);return!!(!0===t||null!=t&&t.margin)}function Vo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.margin"),n=!Xo(e,"margin");return!zo(e)||t||n}function Ho(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),i=Qo(n,"margin"),s=i&&i.some((e=>Ko.includes(e)));if(Vo(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:To(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:To(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}function Go(e){const t=(0,r.getBlockSupport)(e,$o);return!!(!0===t||null!=t&&t.padding)}function Uo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.padding"),n=!Xo(e,"padding");return!Go(e)||t||n}function Wo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),i=Qo(n,"padding"),s=i&&i.some((e=>Ko.includes(e)));if(Uo(e))return null;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:To(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:To(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:s})),native:null})}const $o="spacing",jo=["top","right","bottom","left"],Ko=["vertical","horizontal"];function qo(e){const t=er(e),n=Uo(e),o=Vo(e),l=Yo(e),i=function(e){if("web"!==a.Platform.OS)return!1;return Zo(e)||Go(e)||zo(e)}(e.name);if(l||!i)return null;const s=(0,r.getBlockSupport)(e.name,[$o,"__experimentalDefaultControls"]),c=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,a.createElement)(Fo,{__experimentalGroup:"dimensions"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:c("padding"),isShownByDefault:null==s?void 0:s.padding,panelId:e.clientId},(0,a.createElement)(Wo,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:c("margin"),isShownByDefault:null==s?void 0:s.margin,panelId:e.clientId},(0,a.createElement)(Ho,e)),!t&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:c("blockGap"),isShownByDefault:null==s?void 0:s.blockGap,panelId:e.clientId},(0,a.createElement)(tr,e)))}const Yo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=er(e),n=Uo(e),o=Vo(e);return t&&n&&o};function Qo(e,t){const n=(0,r.getBlockSupport)(e,$o);if(n&&"boolean"!=typeof n[t])return n[t]}function Xo(e,t){const n=Qo(e,t);return!(n&&n.some((e=>jo.includes(e)))&&n.some((e=>Ko.includes(e))))||(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),!1)}function Zo(e){const t=(0,r.getBlockSupport)(e,$o);return!!(!0===t||null!=t&&t.blockGap)}function Jo(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 er(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("spacing.blockGap");return!Zo(e)||t}function tr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]}),s=Qo(r,"blockGap"),c=yo(n);if(er(e))return null;const u=s&&s.some((e=>Ko.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...Jo(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:To(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 a;c.current&&i&&(null===(a=c.current.parentNode)||void 0===a||a.replaceChild(c.current,c.current))},m=Jo(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return a.Platform.select({web:(0,a.createElement)(a.Fragment,null,u?(0,a.createElement)(p.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:s,values:f,allowReset:!1,splitOnAxis:u}):(0,a.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const nr=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),or=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),rr={top:{icon:(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:or,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:nr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},lr=["top","center","bottom"],ir={isAlternate:!0};var ar=function(e){let{value:t,onChange:n,controls:o=lr,isCollapsed:r=!0,isToolbar:l}=e;const s=rr[t],c=rr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,a.createElement)(u,i({popoverProps:ir,icon:s?s.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...rr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const sr=e=>(0,a.createElement)(ar,i({},e,{isToolbar:!1})),cr=e=>(0,a.createElement)(ar,i({},e,{isToolbar:!0})),ur={left:uo,center:po,right:mo,"space-between":fo};var dr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:s}=e;const c=e=>{o(e===r?void 0:e)},u=r?ur[r]:ur.left,d=[{name:"left",icon:uo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:po,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:mo,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=s?p.ToolbarGroup:p.ToolbarDropdownMenu,f=s?{isCollapsed:n}:{};return(0,a.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const pr=e=>(0,a.createElement)(dr,i({},e,{isToolbar:!1})),mr=e=>(0,a.createElement)(dr,i({},e,{isToolbar:!0})),fr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},hr={left:"flex-start",right:"flex-end",center:"center"},gr={top:"flex-start",center:"center",bottom:"flex-end"},vr=["wrap","nowrap"];var br={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Flex,null,(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(_r,{layout:t,onChange:n})),(0,a.createElement)(p.FlexItem,null,r&&(0,a.createElement)(Er,{layout:t,onChange:n}))),(0,a.createElement)(yr,{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,a.createElement)(oo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(_r,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,a.createElement)(kr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:s="horizontal"}=r,c=null!==Bo("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Mo(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Jo(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=fr[r.justifyContent]||fr.left,p=vr.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${gr[r.verticalAlignment]||gr.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${hr[r.justifyContent]||hr.left};\n\t\t`;return(0,a.createElement)("style",null,`\n\t\t\t\t${vo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===s?m:f}\n\t\t\t\t}\n\n\t\t\t\t${vo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function kr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=gr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,a.createElement)(sr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,a.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,a.createElement)("div",null,i.map(((e,t,n)=>(0,a.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function _r(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"),o)return(0,a.createElement)(pr,{allowedControls:s,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:uo,label:(0,h.__)("Justify items left")},{value:"center",icon:po,label:(0,h.__)("Justify items center")},{value:"right",icon:mo,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,a.createElement)("legend",null,(0,h.__)("Justification")),(0,a.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,a.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function yr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,a.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Er(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,a.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,a.createElement)("legend",null,(0,h.__)("Orientation")),(0,a.createElement)(p.Button,{label:"horizontal",icon:ho,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,a.createElement)(p.Button,{label:"vertical",icon:go,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Cr=function(e){let{icon:t,size:n=24,...o}=e;return(0,a.cloneElement)(t,{width:n,height:n,...o})},wr={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"]});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,a.createElement)(Cr,{icon:io})),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,a.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,a.createElement)(Cr,{icon:so}))),(0,a.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,a.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,h.__)("Reset"))),(0,a.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:s}=o,c=null!==Bo("spacing.blockGap"),u=Jo(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Mo(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||s?`\n\t\t\t\t\t${vo(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:s};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${vo(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:i};\n\t\t\t\t\t}\n\t\t\t\t\t${vo(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${vo(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${vo(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${vo(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${vo(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${vo(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,a.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;r.test(t)&&(o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t));r.test(n)&&(o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n));return o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}};const Sr=[wr,br];function Br(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Sr.find((t=>t.name===e))}const Ir={type:"default"},xr=(0,a.createContext)(Ir),Tr=xr.Provider;function Nr(){return(0,a.useContext)(xr)}function Pr(e){let{layout:t={},...n}=e;const o=Br(t.type);return o?(0,a.createElement)(o.save,i({layout:t},n)):null}const Mr=["none","left","center","right","wide","full"],Rr=["wide","full"];function Lr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Nr(),r=Br(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Mr}=o,a=e.filter((e=>(o.alignments||t||!Rr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?[]:a}const Ar={none:{icon:ro,title:(0,h.__)("None")},left:{icon:lo,title:(0,h.__)("Align left")},center:{icon:io,title:(0,h.__)("Align center")},right:{icon:ao,title:(0,h.__)("Align right")},wide:{icon:so,title:(0,h.__)("Wide width")},full:{icon:co,title:(0,h.__)("Full width")}},Dr={isAlternate:!0};var Or=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const s=Lr(o);if(!!!s.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Ar[t],m=Ar.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,g={popoverProps:Dr,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r||a.Platform.isNative?{isCollapsed:r?l:void 0,controls:s.map((e=>{let{name:n}=e;return{...Ar[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},s.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Ar[o],s=o===t||!t&&"none"===o;return(0,a.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,a.createElement)(f,i({},g,v))};const Fr=e=>(0,a.createElement)(Or,i({},e,{isToolbar:!1})),zr=e=>(0,a.createElement)(Or,i({},e,{isToolbar:!0})),Vr=["left","center","right","wide","full"],Hr=["wide","full"];function Gr(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)?Vr.filter((t=>e.includes(t))):!0===e?[...Vr]:[],!o||!0===e&&!n?(0,u.without)(t,...Hr):t}const Ur=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Lr(Gr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,a.createElement)(a.Fragment,null,!!o.length&&(0,a.createElement)(oo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(Fr,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,a.createElement)(e,t))}),"withToolbarControls"),Wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,s=Lr(Gr((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,a.createElement)(e,t);let c=t.wrapperProps;return s.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,a.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Vr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Wr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ur),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Gr((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const $r=/[\s#]/g,jr={type:"string",source:"attribute",attribute:"id",selector:"*"};const Kr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===a.Platform.OS,o=(0,a.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,a.createElement)(a.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, youll be able to link directly to this section of your page."),n&&(0,a.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace($r,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(Fo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,a.createElement)(Fo,null,(0,a.createElement)(p.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,a.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:jr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Kr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const qr=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),(0,a.createElement)(Fo,{__experimentalGroup:"advanced"},(0,a.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,a.createElement)(e,t)),"withInspectorControl");function Yr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",qr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Qr=[{name:"margin",generate:(e,t)=>Yr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Yr(e,t,["spacing","padding"],"padding")}];function Xr(e,t){const n=[];return Qr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Zr=window.wp.dom;const Jr=(0,a.createContext)({});function el(e){let{value:t,children:n}=e;const o=(0,a.useContext)(Jr),r=(0,a.useMemo)((()=>({...o,...t})),[o,t]);return(0,a.createElement)(Jr.Provider,{value:r,children:n})}var tl=Jr;const nl={};var ol=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,a.useContext)(tl),s=(0,a.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):nl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,a.createElement)(d,i({},e,{context:s}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,a.createElement)(d,i({},e,{context:s,className:m}))}));function rl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,a.createElement)(Qn,{value:(0,a.useMemo)((()=>r),Object.values(r))},(0,a.createElement)(ol,e))}var ll=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"}));var il=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,a.createElement)("div",{className:c()(t,"block-editor-warning")},(0,a.createElement)("div",{className:"block-editor-warning__contents"},(0,a.createElement)("p",{className:"block-editor-warning__message"},o),(a.Children.count(n)>0||r)&&(0,a.createElement)("div",{className:"block-editor-warning__actions"},a.Children.count(n)>0&&a.Children.map(n,((e,t)=>(0,a.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,a.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:ll,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,a.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,a.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},al=n(1973);function sl(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,a.createElement)("div",{className:i},(0,a.createElement)("div",{className:"block-editor-block-compare__content"},(0,a.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,a.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,a.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,a.createElement)(a.RawHTML,null,(0,Zr.safeHTML)(o)))),(0,a.createElement)("div",{className:"block-editor-block-compare__action"},(0,a.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var cl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const s=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=s,(0,al.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,a.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,a.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,a.createElement)(sl,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,a.createElement)(sl,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:s}))};const ul=e=>(0,r.rawHandler)({HTML:e.originalContent});var dl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Kn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Kn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,ul(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const s=!!(0,r.getBlockType)("core/html"),[c,u]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>u(!0)),[]),m=(0,a.useCallback)((()=>u(!1)),[]),f=(0,a.useMemo)((()=>[{title:(0,h._x)("Resolve","imperative verb"),onClick:d},s&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(il,{actions:[(0,a.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:f},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,a.createElement)(p.Modal,{title:(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,a.createElement)(cl,{block:i,onKeep:t,onConvert:n,convertor:ul,convertButtonText:(0,h.__)("Convert to Blocks")})))}));const pl=(0,a.createElement)(il,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed."));var ml=()=>pl;class fl extends a.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var hl=fl,gl=n(773);var vl=function(e){let{clientId:t}=e;const[n,o]=(0,a.useState)(""),l=(0,m.useSelect)((e=>e(Kn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Kn);return(0,a.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,a.createElement)(gl.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const a=(0,r.getBlockAttributes)(e,n,l.attributes),s=n||(0,r.getSaveContent)(e,a),[c]=n?(0,r.validateBlock)({...l,attributes:a,originalContent:s}):[!0];i(t,{attributes:a,originalContent:s,isValid:c}),n||o({content:s})},onChange:e=>o(e.target.value)})};let bl=Ll();const kl=e=>Nl(e,bl);let _l=Ll();kl.write=e=>Nl(e,_l);let yl=Ll();kl.onStart=e=>Nl(e,yl);let El=Ll();kl.onFrame=e=>Nl(e,El);let Cl=Ll();kl.onFinish=e=>Nl(e,Cl);let wl=[];kl.setTimeout=(e,t)=>{let n=kl.now()+t,o=()=>{let e=wl.findIndex((e=>e.cancel==o));~e&&wl.splice(e,1),xl-=~e?1:0},r={time:n,handler:e,cancel:o};return wl.splice(Sl(n),0,r),xl+=1,Pl(),r};let Sl=e=>~(~wl.findIndex((t=>t.time>e))||~wl.length);kl.cancel=e=>{yl.delete(e),El.delete(e),bl.delete(e),_l.delete(e),Cl.delete(e)},kl.sync=e=>{Tl=!0,kl.batchedUpdates(e),Tl=!1},kl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,kl.onStart(n)}return o.handler=e,o.cancel=()=>{yl.delete(n),t=null},o};let Bl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};kl.use=e=>Bl=e,kl.now="undefined"!=typeof performance?()=>performance.now():Date.now,kl.batchedUpdates=e=>e(),kl.catch=console.error,kl.frameLoop="always",kl.advance=()=>{"demand"!==kl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Rl()};let Il=-1,xl=0,Tl=!1;function Nl(e,t){Tl?(t.delete(e),e(0)):(t.add(e),Pl())}function Pl(){Il<0&&(Il=0,"demand"!==kl.frameLoop&&Bl(Ml))}function Ml(){~Il&&(Bl(Ml),kl.batchedUpdates(Rl))}function Rl(){let e=Il;Il=kl.now();let t=Sl(Il);t&&(Al(wl.splice(0,t),(e=>e.handler())),xl-=t),yl.flush(),bl.flush(e?Math.min(64,Il-e):16.667),El.flush(),_l.flush(),Cl.flush(),xl||(Il=-1)}function Ll(){let e=new Set,t=e;return{add(n){xl+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(xl-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,xl-=t.size,Al(t,(t=>t(n)&&e.add(t))),xl+=e.size,t=e)}}}function Al(e,t){e.forEach((e=>{try{t(e)}catch(e){kl.catch(e)}}))}var Dl=n(9196),Ol=n.n(Dl);function Fl(){}const zl={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 Vl(e,t){if(zl.arr(e)){if(!zl.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 Hl=(e,t)=>e.forEach(t);function Gl(e,t,n){if(zl.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 Ul=e=>zl.und(e)?[]:zl.arr(e)?e:[e];function Wl(e,t){if(e.size){const n=Array.from(e);e.clear(),Hl(n,t)}}const $l=(e,...t)=>Wl(e,(e=>e(...t))),jl=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Kl,ql,Yl=null,Ql=!1,Xl=Fl;var Zl=Object.freeze({__proto__:null,get createStringInterpolator(){return Kl},get to(){return ql},get colors(){return Yl},get skipAnimation(){return Ql},get willAdvance(){return Xl},assign:e=>{e.to&&(ql=e.to),e.now&&(kl.now=e.now),void 0!==e.colors&&(Yl=e.colors),null!=e.skipAnimation&&(Ql=e.skipAnimation),e.createStringInterpolator&&(Kl=e.createStringInterpolator),e.requestAnimationFrame&&kl.use(e.requestAnimationFrame),e.batchedUpdates&&(kl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Xl=e.willAdvance),e.frameLoop&&(kl.frameLoop=e.frameLoop)}});const Jl=new Set;let ei=[],ti=[],ni=0;const oi={get idle(){return!Jl.size&&!ei.length},start(e){ni>e.priority?(Jl.add(e),kl.onStart(ri)):(li(e),kl(ai))},advance:ai,sort(e){if(ni)kl.onFrame((()=>oi.sort(e)));else{const t=ei.indexOf(e);~t&&(ei.splice(t,1),ii(e))}},clear(){ei=[],Jl.clear()}};function ri(){Jl.forEach(li),Jl.clear(),kl(ai)}function li(e){ei.includes(e)||ii(e)}function ii(e){ei.splice(function(e,t){const n=e.findIndex(t);return n<0?e.length:n}(ei,(t=>t.priority>e.priority)),0,e)}function ai(e){const t=ti;for(let n=0;n<ei.length;n++){const o=ei[n];ni=o.priority,o.idle||(Xl(o),o.advance(e),o.idle||t.push(o))}return ni=0,ti=ei,ti.length=0,ei=t,ei.length>0}const si="[-+]?\\d*\\.?\\d+",ci=si+"%";function ui(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const di=new RegExp("rgb"+ui(si,si,si)),pi=new RegExp("rgba"+ui(si,si,si,si)),mi=new RegExp("hsl"+ui(si,ci,ci)),fi=new RegExp("hsla"+ui(si,ci,ci,si)),hi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vi=/^#([0-9a-fA-F]{6})$/,bi=/^#([0-9a-fA-F]{8})$/;function ki(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _i(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=ki(r,o,e+1/3),i=ki(r,o,e),a=ki(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function yi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ei(e){return(parseFloat(e)%360+360)%360/360}function Ci(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function wi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Si(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=vi.exec(e))?parseInt(t[1]+"ff",16)>>>0:Yl&&void 0!==Yl[e]?Yl[e]:(t=di.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|255)>>>0:(t=pi.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|Ci(t[4]))>>>0:(t=hi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bi.exec(e))?parseInt(t[1],16)>>>0:(t=gi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=mi.exec(e))?(255|_i(Ei(t[1]),wi(t[2]),wi(t[3])))>>>0:(t=fi.exec(e))?(_i(Ei(t[1]),wi(t[2]),wi(t[3]))|Ci(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Bi=(e,t,n)=>{if(zl.fun(e))return e;if(zl.arr(e))return Bi({range:e,output:t,extrapolate:n});if(zl.str(e.output[0]))return Kl(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",a=o.extrapolateRight||o.extrapolate||"extend",s=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,a,s){let c=s?s(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(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],s,i,a,o.map)}};function Ii(){return Ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ii.apply(this,arguments)}const xi=Symbol.for("FluidValue.get"),Ti=Symbol.for("FluidValue.observers"),Ni=e=>Boolean(e&&e[xi]),Pi=e=>e&&e[xi]?e[xi]():e,Mi=e=>e[Ti]||null;function Ri(e,t){let n=e[Ti];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Li{constructor(e){if(this[xi]=void 0,this[Ti]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ai(this,e)}}const Ai=(e,t)=>Fi(e,xi,t);function Di(e,t){if(e[xi]){let n=e[Ti];n||Fi(e,Ti,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Oi(e,t){let n=e[Ti];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ti]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Fi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),zi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Hi=new RegExp(`(${zi.source})(%|[a-z]+)`,"i"),Gi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ui=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Wi=e=>{const[t,n]=$i(e);if(!t||jl())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&&Ui.test(n)?Wi(n):n||e},$i=e=>{const t=Ui.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let ji;const Ki=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,qi=e=>{ji||(ji=Yl?new RegExp(`(${Object.keys(Yl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Pi(e).replace(Ui,Wi).replace(Vi,Si).replace(ji,Si))),n=t.map((e=>e.match(zi).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),r=o.map((t=>Bi(Ii({},e,{output:t}))));return e=>{var n;const o=!Hi.test(t[0])&&(null==(n=t.find((e=>Hi.test(e))))?void 0:n.replace(zi,""));let l=0;return t[0].replace(zi,(()=>`${r[l++](e)}${o||""}`)).replace(Gi,Ki)}},Yi="react-spring: ",Qi=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Yi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Xi=Qi(console.warn);const Zi=Qi(console.warn);function Ji(e){return zl.str(e)&&("#"==e[0]||/\d/.test(e)||!jl()&&Ui.test(e)||e in(Yl||{}))}const ea=e=>(0,Dl.useEffect)(e,ta),ta=[];function na(){const e=(0,Dl.useState)()[1],t=(0,Dl.useState)(oa)[0];return ea(t.unmount),()=>{t.current&&e({})}}function oa(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ra(e){const t=(0,Dl.useRef)();return(0,Dl.useEffect)((()=>{t.current=e})),t.current}const la="undefined"!=typeof window&&window.document&&window.document.createElement?Dl.useLayoutEffect:Dl.useEffect,ia=Symbol.for("Animated:node"),aa=e=>e&&e[ia],sa=(e,t)=>{return n=e,o=ia,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ca=e=>e&&e[ia]&&e[ia].getPayload();class ua{constructor(){this.payload=void 0,sa(this,this)}getPayload(){return this.payload||[]}}class da extends ua{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,zl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new da(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return zl.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,zl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class pa extends da{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Bi({output:[e,e]})}static create(e){return new pa(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(zl.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Bi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ma={dependencies:null};class fa extends ua{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Gl(this.source,((n,o)=>{var r;(r=n)&&r[ia]===r?t[o]=n.getValue(e):Ni(n)?t[o]=Pi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Hl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Gl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ma.dependencies&&Ni(e)&&ma.dependencies.add(e);const t=ca(e);t&&Hl(t,(e=>this.add(e)))}}class ha extends fa{constructor(e){super(e)}static create(e){return new ha(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(ga)),!0)}}function ga(e){return(Ji(e)?pa:da).create(e)}function va(e){const t=aa(e);return t?t.constructor:zl.arr(e)?ha:Ji(e)?pa:da}function ba(){return ba=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},ba.apply(this,arguments)}const ka=(e,t)=>{const n=!zl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Dl.forwardRef)(((o,r)=>{const l=(0,Dl.useRef)(null),i=n&&(0,Dl.useCallback)((e=>{l.current=function(e,t){e&&(zl.fun(e)?e(t):e.current=t);return t}(r,e)}),[r]),[a,s]=function(e,t){const n=new Set;ma.dependencies=n,e.style&&(e=ba({},e,{style:t.createAnimatedStyle(e.style)}));return e=new fa(e),ma.dependencies=null,[e,n]}(o,t),c=na(),u=()=>{const e=l.current;if(n&&!e)return;!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new _a(u,s),p=(0,Dl.useRef)();la((()=>{const e=p.current;p.current=d,Hl(s,(e=>Di(e,d))),e&&(Hl(e.deps,(t=>Oi(t,e))),kl.cancel(e.update))})),(0,Dl.useEffect)(u,[]),ea((()=>()=>{const e=p.current;Hl(e.deps,(t=>Oi(t,e)))}));const m=t.getComponentProps(a.getValue());return Dl.createElement(e,ba({},m,{ref:i}))}))};class _a{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&kl.write(this.update)}}const ya=Symbol.for("AnimatedComponent"),Ea=e=>zl.str(e)?e:e&&zl.str(e.displayName)?e.displayName:zl.fun(e)&&e.name||null;function Ca(){return Ca=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},Ca.apply(this,arguments)}function wa(e,...t){return zl.fun(e)?e(...t):e}const Sa=(e,t)=>!0===e||!!(t&&e&&(zl.fun(e)?e(t):Ul(e).includes(t))),Ba=(e,t)=>zl.obj(e)?t&&e[t]:e,Ia=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,xa=e=>e,Ta=(e,t=xa)=>{let n=Na;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);zl.und(n)||(o[r]=n)}return o},Na=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Pa={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 Ma(e){const t=function(e){const t={};let n=0;if(Gl(e,((e,o)=>{Pa[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Gl(e,((e,o)=>o in t||(n[o]=e))),n}return Ca({},e)}function Ra(e){return e=Pi(e),zl.arr(e)?e.map(Ra):Ji(e)?Zl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function La(e){for(const t in e)return!0;return!1}function Aa(e){return zl.fun(e)||zl.arr(e)&&zl.obj(e[0])}function Da(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Oa(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Fa=1.70158,za=1.525*Fa,Va=Fa+1,Ha=2*Math.PI/3,Ga=2*Math.PI/4.5,Ua=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},Wa={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=>Va*e*e*e-Fa*e*e,easeOutBack:e=>1+Va*Math.pow(e-1,3)+Fa*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-za)/2:(Math.pow(2*e-2,2)*((za+1)*(2*e-2)+za)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*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)*Ga)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ga)/2+1,easeInBounce:e=>1-Ua(1-e),easeOutBounce:Ua,easeInOutBounce:e=>e<.5?(1-Ua(1-2*e))/2:(1+Ua(2*e-1))/2},$a=Ca({},{tension:170,friction:26},{mass:1,damping:1,easing:Wa.linear,clamp:!1});class ja{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,$a)}}function Ka(e,t){if(zl.und(t.decay)){const n=!zl.und(t.tension)||!zl.und(t.friction);!n&&zl.und(t.frequency)&&zl.und(t.damping)&&zl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const qa=[];class Ya{constructor(){this.changed=!1,this.values=qa,this.toValues=null,this.fromValues=qa,this.to=void 0,this.from=void 0,this.config=new ja,this.immediate=!1}}function Qa(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{var s;let c,u,d=Sa(null!=(s=n.cancel)?s:null==o?void 0:o.cancel,t);if(d)f();else{zl.und(n.pause)||(r.paused=Sa(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Sa(e,t)),c=wa(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-kl.now()}function m(){c>0&&!Zl.skipAnimation?(r.delayed=!0,u=kl.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ca({},n,{callId:e,cancel:d}),i)}catch(e){a(e)}}}))}const Xa=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?es(e.get()):t.every((e=>e.noop))?Za(e.get()):Ja(e.get(),t.every((e=>e.finished))),Za=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ja=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),es=e=>({value:e,cancelled:!0,finished:!1});function ts(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:a,promise:s}=n;return l||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Ta(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)&&es(o)||r!==n.asyncId&&Ja(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new os,i=new rs;return(async()=>{if(Zl.skipAnimation)throw ns(n),i.result=Ja(o,!1),d(i),i;m(l);const a=zl.obj(e)?Ca({},e):Ca({},t,{to:e});a.parentId=r,Gl(c,((e,t)=>{zl.und(a[t])&&(a[t]=e)}));const s=await o.start(a);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};let h;if(Zl.skipAnimation)return ns(n),Ja(o,!1);try{let t;t=zl.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=Ja(o.get(),!0,!1)}catch(e){if(e instanceof os)h=e.result;else{if(!(e instanceof rs))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return zl.fun(i)&&kl.batchedUpdates((()=>{i(h,o,o.item)})),h})():s}function ns(e,t){Wl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class os 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 rs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ls=e=>e instanceof as;let is=1;class as extends Li{constructor(...e){super(...e),this.id=is++,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=aa(this);return e&&e.getValue()}to(...e){return Zl.to(this,e)}interpolate(...e){return Xi(`${Yi}The "interpolate" function is deprecated in v9 (use "to" instead)`),Zl.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ri(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||oi.sort(this),Ri(this,{type:"priority",parent:this,priority:e})}}const ss=Symbol.for("SpringPhase"),cs=e=>(1&e[ss])>0,us=e=>(2&e[ss])>0,ds=e=>(4&e[ss])>0,ps=(e,t)=>t?e[ss]|=3:e[ss]&=-3,ms=(e,t)=>t?e[ss]|=4:e[ss]&=-5;class fs extends as{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ya,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,!zl.und(e)||!zl.und(t)){const n=zl.obj(e)?Ca({},e):Ca({},t,{from:e});zl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(us(this)||this._state.asyncTo)||ds(this)}get goal(){return Pi(this.animation.to)}get velocity(){const e=aa(this);return e instanceof da?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return cs(this)}get isAnimating(){return us(this)}get isPaused(){return ds(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=ca(o.to);!i&&Ni(o.to)&&(l=Ul(Pi(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;const c=a.constructor==pa?1:i?i[s].lastPosition:l[s];let u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t=a.elapsedTime+=e;const n=o.fromValues[s],l=null!=a.v0?a.v0:a.v0=zl.arr(r.velocity)?r.velocity[s]:r.velocity;let i;if(zl.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(a.lastPosition-d)<.1,i=l*o}else{i=null==a.lastVelocity?l:a.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,s=r.clamp?0:r.bounce,p=!zl.und(s),m=n==c?a.v0>0:n<c;let f,h=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e){p&&(h=d==c||d>c==m,h&&(i=-i*s,d=c));i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*g,d+=i*g}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,t=a.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,r.round)&&(n=!0)}));const a=aa(this),s=a.getValue();if(t){const e=Pi(o.to);s===e&&!n||r.decay?n&&r.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return kl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(us(this)){const{to:e,config:t}=this.animation;kl.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 zl.und(e)?(n=this.queue||[],this.queue=[]):n=[zl.obj(e)?e:Ca({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Xa(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ns(this._state,e&&this._lastCallId),kl.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=zl.obj(n)?n[t]:n,(null==n||Aa(n))&&(n=void 0),o=zl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return cs(this)||(e.reverse&&([n,o]=[o,n]),o=Pi(o),zl.und(o)?aa(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ca({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ta(n,((e,t)=>/^on/.test(t)?Ba(e,o):e))),ys(this,n,"onProps"),Es(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 Qa(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ds(this)||(ms(this,!0),$l(i.pauseQueue),Es(this,"onPause",Ja(this,hs(this,this.animation.to)),this))},resume:()=>{ds(this)&&(ms(this,!1),us(this)&&this._resume(),$l(i.resumeQueue),Es(this,"onResume",Ja(this,hs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=gs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(es(this));const o=!zl.und(e.to),r=!zl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(es(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a;let{to:u=s,from:d=c}=e;!r||o||t.default&&!zl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Vl(d,c);p&&(a.from=d),d=Pi(d);const m=!Vl(u,s);m&&this._focus(u);const f=Aa(t.to),{config:h}=a,{decay:g,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(Ka(n=Ca({},n),t),t=Ca({},n,t)),Ka(e,t),Object.assign(e,t);for(const t in $a)null==e[t]&&(e[t]=$a[t]);let{mass:o,frequency:r,damping:l}=e;zl.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,wa(t.config,l),t.config!==i.config?wa(i.config,l):void 0);let b=aa(this);if(!b||zl.und(u))return n(Ja(this,!0));const k=zl.und(t.reset)?r&&!t.default:!zl.und(d)&&Sa(t.reset,l),_=k?d:this.get(),y=Ra(u),E=zl.num(y)||zl.arr(y)||Ji(y),C=!f&&(!E||Sa(i.immediate||t.immediate,l));if(m){const e=va(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 w=b.constructor;let S=Ni(u),B=!1;if(!S){const e=k||!cs(this)&&p;(m||e)&&(B=Vl(Ra(_),y),S=!B),(Vl(a.immediate,C)||C)&&Vl(h.decay,g)&&Vl(h.velocity,v)||(S=!0)}if(B&&us(this)&&(a.changed&&!k?S=!0:S||this._stop(s)),!f&&((S||Ni(s))&&(a.values=b.getPayload(),a.toValues=Ni(u)?null:w==pa?[1]:Ul(y)),a.immediate!=C&&(a.immediate=C,C||k||this._set(s)),S)){const{onRest:e}=a;Hl(_s,(e=>ys(this,t,e)));const o=Ja(this,hs(this,s));$l(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&kl.batchedUpdates((()=>{a.changed=!k,null==e||e(o,this),k?wa(i.onRest,o):null==a.onStart||a.onStart(o,this)}))}k&&this._set(_),f?n(ts(t.to,t,this._state,this)):S?this._start():us(this)&&!m?this._pendingCalls.add(n):n(Za(_))}_focus(e){const t=this.animation;e!==t.to&&(Mi(this)&&this._detach(),t.to=e,Mi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ni(t)&&(Di(t,this),ls(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ni(e)&&Oi(e,this)}_set(e,t=!0){const n=Pi(e);if(!zl.und(n)){const e=aa(this);if(!e||!Vl(n,e.getValue())){const o=va(n);e&&e.constructor==o?e.setValue(n):sa(this,o.create(n)),e&&kl.batchedUpdates((()=>{this._onChange(n,t)}))}}return aa(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Es(this,"onStart",Ja(this,hs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),wa(this.animation.onChange,e,this)),wa(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;aa(this).reset(Pi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),us(this)||(ps(this,!0),ds(this)||this._resume())}_resume(){Zl.skipAnimation?this.finish():oi.start(this)}_stop(e,t){if(us(this)){ps(this,!1);const n=this.animation;Hl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ri(this,{type:"idle",parent:this});const o=t?es(this.get()):Ja(this.get(),hs(this,null!=e?e:n.to));$l(this._pendingCalls,o),n.changed&&(n.changed=!1,Es(this,"onRest",o,this))}}}function hs(e,t){const n=Ra(t);return Vl(Ra(e.get()),n)}function gs(e,t=e.loop,n=e.to){let o=wa(t);if(o){const r=!0!==o&&Ma(o),l=(r||e).reverse,i=!r||r.reset;return vs(Ca({},e,{loop:t,default:!1,pause:void 0,to:!l||Aa(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function vs(e){const{to:t,from:n}=e=Ma(e),o=new Set;return zl.obj(t)&&ks(t,o),zl.obj(n)&&ks(n,o),e.keys=o.size?Array.from(o):null,e}function bs(e){const t=vs(e);return zl.und(t.default)&&(t.default=Ta(t)),t}function ks(e,t){Gl(e,((e,n)=>null!=e&&t.add(n)))}const _s=["onStart","onRest","onChange","onPause","onResume"];function ys(e,t,n){e.animation[n]=t[n]!==Ia(t,n)?Ba(t[n],e.key):void 0}function Es(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 Cs=["onStart","onChange","onRest"];let ws=1;class Ss{constructor(e,t){this.id=ws++,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(Ca({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];zl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(vs(e)),this}start(e){let{queue:t}=this;return e?t=Ul(e).map(vs):this.queue=[],this._flush?this._flush(this,t):(Ms(this,t),Bs(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Hl(Ul(t),(t=>n[t].stop(!!e)))}else ns(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(zl.und(e))this.start({pause:!0});else{const t=this.springs;Hl(Ul(e),(e=>t[e].pause()))}return this}resume(e){if(zl.und(e))this.start({pause:!1});else{const t=this.springs;Hl(Ul(e),(e=>t[e].resume()))}return this}each(e){Gl(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,Wl(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&&Wl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Wl(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)}kl.onFrame(this._onFrame)}}function Bs(e,t){return Promise.all(t.map((t=>Is(e,t)))).then((t=>Xa(e,t)))}async function Is(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=zl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=zl.arr(r)||zl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Hl(Cs,(n=>{const o=t[n];if(zl.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,$l(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===Ia(t,"cancel");(u||m&&d.asyncId)&&p.push(Qa(++e._lastAsyncId,{props:t,state:d,actions:{pause:Fl,resume:Fl,start(t,n){m?(ns(d,e._lastAsyncId),n(es(e))):(t.onRest=a,n(ts(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Xa(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=gs(t,i,r);if(n)return Ms(e,[n]),Is(e,n,!0)}return s&&kl.batchedUpdates((()=>s(f,e,e.item))),f}function xs(e,t){const n=Ca({},e.springs);return t&&Hl(Ul(t),(e=>{zl.und(e.keys)&&(e=vs(e)),zl.obj(e.to)||(e=Ca({},e,{to:void 0})),Ps(n,e,(e=>Ns(e)))})),Ts(e,n),n}function Ts(e,t){Gl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Di(t,e))}))}function Ns(e,t){const n=new fs;return n.key=e,t&&Di(n,t),n}function Ps(e,t,n){t.keys&&Hl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ms(e,t){Hl(t,(t=>{Ps(e.springs,t,(t=>Ns(t,e)))}))}function Rs(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 Ls=["children"],As=e=>{let{children:t}=e,n=Rs(e,Ls);const o=(0,Dl.useContext)(Ds),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Dl.useState)((()=>({inputs:t,result:e()}))),o=(0,Dl.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,Dl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ds;return Dl.createElement(i,{value:n},t)},Ds=(Os=As,Fs={},Object.assign(Os,Dl.createContext(Fs)),Os.Provider._context=Os,Os.Consumer._context=Os,Os);var Os,Fs;As.Provider=Ds.Provider,As.Consumer=Ds.Consumer;const zs=()=>{const e=[],t=function(t){Zi(`${Yi}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 Hl(e,((e,r)=>{if(zl.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 Hl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Hl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Hl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Hl(e,((e,o)=>{if(zl.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 Hl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Hl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return zl.fun(e)?e(n,t):e};return t._getProps=n,t};function Vs(e,t,n){const o=zl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Dl.useMemo)((()=>o||3==arguments.length?zs():void 0),[]),l=(0,Dl.useRef)(0),i=na(),a=(0,Dl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=xs(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Bs(e,t):new Promise((o=>{Ts(e,n),a.queue.push((()=>{o(Bs(e,t))})),i()}))}})),[]),s=(0,Dl.useRef)([...a.ctrls]),c=[],u=ra(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=s.current[r]||(s.current[r]=new Ss(null,a.flush)),n=o?o(r,e):t[r];n&&(c[r]=bs(n))}}(0,Dl.useMemo)((()=>{Hl(s.current.slice(e,u),(e=>{Da(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,Dl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=s.current.map(((e,t)=>xs(e,c[t]))),m=(0,Dl.useContext)(As),f=ra(m),h=m!==f&&La(m);la((()=>{l.current++,a.ctrls=s.current;const{queue:e}=a;e.length&&(a.queue=[],Hl(e,(e=>e()))),Hl(s.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Oa(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ea((()=>()=>{Hl(a.ctrls,(e=>e.stop(!0)))}));const g=p.map((e=>Ca({},e)));return r?[g,r]:g}function Hs(e,t){const n=zl.fun(e),[[o],r]=Vs(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}let Gs;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Gs||(Gs={}));class Us extends as{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Bi(...t);const n=this._get(),o=va(n);sa(this,o.create(n))}advance(e){const t=this._get();Vl(t,this.get())||(aa(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&$s(this._active)&&js(this)}_get(){const e=zl.arr(this.source)?this.source.map(Pi):Ul(Pi(this.source));return this.calc(...e)}_start(){this.idle&&!$s(this._active)&&(this.idle=!1,Hl(ca(this),(e=>{e.done=!1})),Zl.skipAnimation?(kl.batchedUpdates((()=>this.advance())),js(this)):oi.start(this))}_attach(){let e=1;Hl(Ul(this.source),(t=>{Ni(t)&&Di(t,this),ls(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Hl(Ul(this.source),(e=>{Ni(e)&&Oi(e,this)})),this._active.clear(),js(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=Ul(this.source).reduce(((e,t)=>Math.max(e,(ls(t)?t.priority:0)+1)),0))}}function Ws(e){return!1!==e.idle}function $s(e){return!e.size||Array.from(e).every(Ws)}function js(e){e.idle||(e.idle=!0,Hl(ca(e),(e=>{e.done=!0})),Ri(e,{type:"idle",parent:e}))}Zl.assign({createStringInterpolator:qi,to:(e,t)=>new Us(e,t)});oi.advance;var Ks=window.ReactDOM;function qs(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 Ys=["style","children","scrollTop","scrollLeft"],Qs=/^--/;function Xs(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Qs.test(e)||Js.hasOwnProperty(e)&&Js[e]?(""+t).trim():t+"px"}const Zs={};let Js={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 ec=["Webkit","Ms","Moz","O"];Js=Object.keys(Js).reduce(((e,t)=>(ec.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Js);const tc=["x","y","z"],nc=/^(matrix|translate|scale|rotate|skew)/,oc=/^(translate)/,rc=/^(rotate|skew)/,lc=(e,t)=>zl.num(e)&&0!==e?e+t:e,ic=(e,t)=>zl.arr(e)?e.every((e=>ic(e,t))):zl.num(e)?e===t:parseFloat(e)===t;class ac extends fa{constructor(e){let{x:t,y:n,z:o}=e,r=qs(e,tc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>lc(e,"px"))).join(",")})`,ic(e,0)]))),Gl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(nc.test(t)){if(delete r[t],zl.und(e))return;const n=oc.test(t)?"px":rc.test(t)?"deg":"";l.push(Ul(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${lc(r,n)})`,ic(r,0)]:e=>[`${t}(${e.map((e=>lc(e,n))).join(",")})`,ic(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new sc(l,i)),super(r)}}class sc extends Li{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Hl(this.inputs,((n,o)=>{const r=Pi(n[0]),[l,i]=this.transforms[o](zl.arr(r)?r:n.map(Pi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Hl(this.inputs,(e=>Hl(e,(e=>Ni(e)&&Di(e,this)))))}observerRemoved(e){0==e&&Hl(this.inputs,(e=>Hl(e,(e=>Ni(e)&&Oi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ri(this,e)}}const cc=["scrollTop","scrollLeft"];Zl.assign({batchedUpdates:Ks.unstable_batchedUpdates,createStringInterpolator:qi,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 uc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new fa(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ea(e)||"Anonymous";return(e=zl.str(e)?l[e]||(l[e]=ka(e,r)):e[ya]||(e[ya]=ka(e,r))).displayName=`Animated(${t})`,e};return Gl(e,((t,n)=>{zl.arr(e)&&(n=Ea(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:a}=o,s=qs(o,Ys),c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:Zs[t]||(Zs[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=Xs(t,r[t]);Qs.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==a&&(e.scrollLeft=a)},createAnimatedStyle:e=>new ac(e),getComponentProps:e=>qs(e,cc)}),dc=uc.animated,pc=e=>e+1,mc=e=>({top:e.offsetTop,left:e.offsetLeft});var fc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,a.useRef)(),i=(0,d.useReducedMotion)()||!o,[s,c]=(0,a.useReducer)(pc,0),[u,p]=(0,a.useReducer)(pc,0),[m,f]=(0,a.useState)({x:0,y:0}),h=(0,a.useMemo)((()=>l.current?mc(l.current):null),[r]),g=(0,a.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Zr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(!function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",g()}({x:o,y:r}),v.x=o,v.y=r)}return(0,a.useLayoutEffect)((()=>{s&&p()}),[s]),(0,a.useLayoutEffect)((()=>{if(!h)return;if(i)return void g();l.current.style.transform="";const e=mc(l.current);c(),f({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,Hs({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:s!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l};const hc=".block-editor-block-list__block",gc=".block-list-appender",vc=".block-editor-button-block-appender";function bc(e,t){return t.closest([hc,gc,vc].join(","))===e}function kc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(hc);return t?t.id.slice("block-".length):void 0}function _c(e){const t=(0,a.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Kn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Kn);return(0,a.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Zr.focus.tabbable.find(t.current).filter((e=>(0,Zr.isTextField)(e))),a=-1===n,s=(a?u.last:u.first)(i)||t.current;if(bc(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=Zr.focus.tabbable.findNext(t.current);if(e&&bc(t.current,e)&&(0,Zr.isFormElement)(e))return void e.focus()}(0,Zr.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function yc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Ec(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Kn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",yc),t.addEventListener("mouseover",yc),()=>{t.removeEventListener("mouseout",yc),t.removeEventListener("mouseover",yc),t.classList.remove("is-hovered")}}),[e])}function Cc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:a,getSettings:s,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Kn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=s(),h=n(e),g=l(e),v=a(e),b=u(e,!0),k=p(m);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":g&&f&&d()})}),[e])}function wc(e){return(0,m.useSelect)((t=>{const n=t(Kn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Sc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Kn),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Bc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Kn);if(!i(e))return;const a=n();return a?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Ic(e){const{isBlockSelected:t}=(0,m.useSelect)(Kn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):bc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var xc=window.wp.keycodes;function Tc(e){const t=(0,m.useSelect)((t=>t(Kn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Kn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",a),i.addEventListener("dragstart",s),()=>{i.removeEventListener("keydown",a),i.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==xc.ENTER&&a!==xc.BACKSPACE&&a!==xc.DELETE||s!==i||(0,Zr.isTextField)(s)||(t.preventDefault(),a===xc.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Nc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Kn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Pc(){const e=(0,a.useContext)(Vf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Mc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,a.useContext)(Rc),{index:s,mode:u,name:p,blockApiVersion:f,blockTitle:g,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Kn),p=s(n),m=c(n)||u(n),f=l(n),h=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&a()<=200}}),[n]),_=(0,h.sprintf)((0,h.__)("Block: %s"),g),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,_c(n),_o(n),Ic(n),Tc(n),Nc(n),Ec(),Pc(),fc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:s})]),C=Xn();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":g,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,Cc(n),wc(n),Sc(n),Bc(n)),style:{...l.style,...e.style}}}Mc.save=r.__unstableGetBlockProps;const Rc=(0,a.createContext)();function Lc(e){let{children:t,isHtml:n,...o}=e;return(0,a.createElement)("div",Mc(o,{__unstableIsHtml:n}),t)}const Ac=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(Kn),d=s(n),p=r(n),m=a(o),f=c(n,o),h=u(n,o),{name:g,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Dc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:a,replaceBlocks:s,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Kn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Kn),r=n(),{clientId:i}=t,a=r.length?r:[i];l(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(Kn),a=l(n);i(e,a+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Kn);if(e){const e=l(n);e&&a(n,e)}else{const e=r(n);e&&a(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),s([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Oc=(0,d.compose)(d.pure,Ac,Dc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:s,isSelected:d,isSelectionEnabled:p,className:f,name:h,isValid:g,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const w=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return t().supportsLayout}),[]),{removeBlock:S}=(0,m.useDispatch)(Kn),B=(0,a.useCallback)((()=>S(s)),[s]);let I=(0,a.createElement)(rl,{name:h,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:s,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!w;let N;if(T&&(I=(0,a.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),g)N="html"===o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{style:{display:"none"}},I),(0,a.createElement)(Lc,{isHtml:!0},(0,a.createElement)(vl,{clientId:s}))):(null==x?void 0:x.apiVersion)>1?I:(0,a.createElement)(Lc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,a.createElement)(Lc,{className:"has-warning"},(0,a.createElement)(dl,{clientId:s}),(0,a.createElement)(a.RawHTML,null,(0,Zr.safeHTML)(e)))}const P={clientId:s,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&w?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,a.useMemo)((()=>P),Object.values(P));return(0,a.createElement)(Rc.Provider,{value:M},(0,a.createElement)(hl,{fallback:(0,a.createElement)(Lc,{className:"has-warning"},(0,a.createElement)(ml,null))},N))})),Fc=window.wp.htmlEntities;var zc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Vc=[(0,a.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,a.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,a.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")];var Hc=function(){const[e]=(0,a.useState)(Math.floor(Math.random()*Vc.length));return(0,a.createElement)(p.Tip,null,Vc[e])};var Gc=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));var Uc=(0,a.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:Gc});const l=(0,a.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,a.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)}));var Wc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Ft()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,a.createElement)("div",{className:"block-editor-block-card"},(0,a.createElement)(Uc,{icon:n,showColors:!0}),(0,a.createElement)("div",{className:"block-editor-block-card__content"},(0,a.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,a.createElement)("span",{className:"block-editor-block-card__description"},o)))};function $c(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const s=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:h}=s.dispatch(Kn),{getBlockName:g,getBlocks:v}=s.select(Kn),b=(0,m.useSelect)((e=>!t||e(Kn).areInnerBlocksControlled(t)),[t]),k=(0,a.useRef)({incoming:null,outgoing:[]}),_=(0,a.useRef)(!1),y=()=>{n&&(h(),t?s.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,a.useRef)(i),C=(0,a.useRef)(l);(0,a.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,a.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,a.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,a.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=s.select(Kn);let a=v(t),c=r(),u=!1;_.current=!0;const d=s.subscribe((()=>{if(null!==t&&null===g(t))return;if(!(!t||i(t)))return;const s=r(),d=v(t),p=d!==a;if(a=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=s);if(p||u&&!p&&s&&!c){c=s,k.current.outgoing.push(a);(c?C.current:E.current)(a,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})}u=p}));return()=>d()}),[s,t])}var jc=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,a.createElement)(e,i({registry:o},r));const[l,s]=(0,a.useState)(null);return(0,a.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore($n,jn),s(e)}),[o]),l?(0,a.createElement)(m.RegistryProvider,{value:l},(0,a.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Kn);return(0,a.useEffect)((()=>{o(n)}),[n]),$c(e),(0,a.createElement)(ko,null,t)}));function Kc(e){let{onClick:t}=e;return(0,a.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,a.createElement)(p.Disabled,null,(0,a.createElement)(Gf,null)))}function qc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Kn),{clearSelectedBlock:n}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Yc(e){return(0,a.createElement)("div",i({ref:qc()},e))}function Qc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Kn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Xc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Qc,[]),i=yo(r),a=yo((0,u.first)(n)),s=yo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!a.current||!s.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(a.current),f.setEndAfter(s.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Zc(e,t,n,o){let r,l=Zr.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Zr.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 Jc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Kn);return(0,d.useRefEffect)((i=>{let a;function s(){a=null}function c(e,t){const n=Zc(e,t,i);return!n||!function(e,t){return e.closest(hc)===t.closest(hc)}(e,n)}function u(s){const{keyCode:u,target:d}=s,p=u===xc.UP,m=u===xc.DOWN,f=u===xc.LEFT,h=u===xc.RIGHT,g=p||f,v=f||h,b=p||m,k=v||b,_=s.shiftKey,y=_||s.ctrlKey||s.altKey||s.metaKey,E=b?Zr.isVerticalEdge:Zr.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:w}=C;if(l())return;if(b?a||(a=(0,Zr.computeCaretRect)(w)):a=null,s.defaultPrevented)return;if(!k)return;if(!function(e,t,n){if((t===xc.UP||t===xc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(d,u,y))return;const S=(0,Zr.isRTL)(d)?!g:g,{keepCaretInsideBlock:B}=r(),I=e();if(_){const e=t(),r=n(e||I),l=o(e||I);(g&&r||!g&&l)&&c(d,g)&&E(d,g)&&(i.contentEditable=!0,i.focus())}else if(b&&(0,Zr.isVerticalEdge)(d,g)&&!B){const e=Zc(d,g,i,!0);e&&((0,Zr.placeCaretAtVerticalEdge)(e,g,a),s.preventDefault())}else if(v&&w.getSelection().isCollapsed&&(0,Zr.isHorizontalEdge)(d,S)&&!B){const e=Zc(d,S,i);(0,Zr.placeCaretAtHorizontalEdge)(e,g),s.preventDefault()}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",u),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",u)}}),[])}var eu=window.wp.keyboardShortcuts;function tu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Kn),{multiSelect:o}=(0,m.useDispatch)(Kn),r=(0,eu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Zr.isEntirelySelected)(l.target))return;const[a]=i,s=n(a);let c=e(s);i.length===c.length&&(c=e(n(s)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function nu(e,t){e.contentEditable=t,t&&e.focus()}function ou(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Kn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Kn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let a,s;function c(){t(),i.removeEventListener("mouseup",c),s=i.requestAnimationFrame((()=>{if(o())return;nu(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function u(t){let{buttons:o,target:s}=t;1===o&&s.getAttribute("contenteditable")&&n()&&(a=l.activeElement,e(),i.addEventListener("mouseup",c),nu(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(s)}}),[e,t,n,o])}function ru(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Kn),{getBlockParents:o}=(0,m.useSelect)(Kn);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:l}=r;function i(){const r=l.getSelection();if(!r.rangeCount||r.isCollapsed)return void function(e,t){e.contentEditable=t,t&&e.focus()}(n,!1);const i=kc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(r)),a=kc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(r));if(i===a)t(i);else{const t=[...o(i),i],n=[...o(a),a],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function a(){r.addEventListener("selectionchange",i),l.addEventListener("mouseup",i)}function s(){r.removeEventListener("selectionchange",i),l.removeEventListener("mouseup",i)}function c(){s(),a()}return a(),n.addEventListener("focusin",c),()=>{s(),n.removeEventListener("focusin",c)}}),[e,t,n,o])}function lu(){const{multiSelect:e,selectBlock:t}=(0,m.useDispatch)(Kn),{isSelectionEnabled:n,getBlockParents:o,getBlockSelectionStart:r,hasMultiSelection:l}=(0,m.useSelect)(Kn);return(0,d.useRefEffect)((e=>{function o(o){if(!n()||0!==o.button)return;const i=r(),a=kc(o.target);o.shiftKey?i!==a&&(e.contentEditable=!0,e.focus()):l()&&t(a)}return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[e,t,n,o,r,l])}function iu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Kn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:a,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===xc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===xc.BACKSPACE||d.keyCode===xc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?a(t()):n()?s(d.keyCode===xc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===xc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function au(){const[e,t,n]=function(){const e=(0,a.useRef)(),t=(0,a.useRef)(),n=(0,a.useRef)(),o=(0,a.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(Kn),{setNavigationMode:s}=(0,m.useDispatch)(Kn),c=(0,m.useSelect)((e=>e(Kn).isNavigationMode()),[])?void 0:"0",u=(0,a.useRef)();function p(t){if(u.current)u.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";Zr.focus.tabbable[n](t.target).focus()}}const f=(0,a.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,a.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),g=(0,d.useRefEffect)((a=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===xc.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==xc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===a&&s(!0));if(((0,Zr.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Zr.isFormElement)(Zr.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=a;e.relatedTarget||t.activeElement!==t.body||0!==i()||a.focus()}function p(o){var r;if(o.keyCode!==xc.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=Zr.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=a,{defaultView:f}=m;return f.addEventListener("keydown",p),a.addEventListener("keydown",c),a.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),a.removeEventListener("keydown",c),a.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,g]),h]}(),o=(0,m.useSelect)((e=>e(Kn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,iu(),ou(),ru(),lu(),Xc(),tu(),Jc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var su=(0,a.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,s]=au();return(0,a.createElement)(a.Fragment,null,r,(0,a.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),s)}));const cu="editor-styles-wrapper";function uu(e){return(0,a.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var du=(0,a.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:s,...u}=e;const[,m]=(0,a.useReducer)((()=>({}))),[f,g]=(0,a.useState)(),[v,b]=(0,a.useState)([]),k=uu(null==s?void 0:s.styles),_=uu(null==s?void 0:s.scripts),y=qc(),[E,C,w]=au(),S=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),g(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]);return(0,a.useEffect)((()=>{var e;f&&(e=f,Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${cu}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),r=(0,a.createElement)(a.Fragment,null,(0,a.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const s=t.toLowerCase();return"style"===s?(0,a.createElement)(s,{id:o,key:o},i):(0,a.createElement)(s,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,a.createElement)(a.Fragment,null,l>=0&&E,(0,a.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,S]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),f&&(0,a.createPortal)((0,a.createElement)(a.Fragment,null,(0,a.createElement)("head",{ref:B},r),(0,a.createElement)("body",{ref:I,className:c()(cu,...v)},(0,a.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&w)})),pu={grad:.9,turn:360,rad:360/(2*Math.PI)},mu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},fu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},hu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},gu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},vu=function(e){return{r:hu(e.r,0,255),g:hu(e.g,0,255),b:hu(e.b,0,255),a:hu(e.a)}},bu=function(e){return{r:fu(e.r),g:fu(e.g),b:fu(e.b),a:fu(e.a,3)}},ku=/^#([0-9a-f]{3,8})$/i,_u=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},yu=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),a=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:l?i/l*100:0,v:l/255*100,a:r}},Eu=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),a=o*(1-(t-l)*n),s=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,a,i,i,s,o][c],g:255*[s,o,o,a,i,i][c],b:255*[i,i,s,o,o,a][c],a:r}},Cu=function(e){return{h:gu(e.h),s:hu(e.s,0,100),l:hu(e.l,0,100),a:hu(e.a)}},wu=function(e){return{h:fu(e.h),s:fu(e.s),l:fu(e.l),a:fu(e.a,3)}},Su=function(e){return Eu((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},Bu=function(e){return{h:(t=yu(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},Iu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pu={string:[[function(e){var t=ku.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?fu(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?fu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Tu.exec(e)||Nu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vu({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=Iu.exec(e)||xu.exec(e);if(!t)return null;var n,o,r=Cu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(pu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Su(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return mu(t)&&mu(n)&&mu(o)?vu({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!mu(t)||!mu(n)||!mu(o))return null;var i=Cu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Su(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!mu(t)||!mu(n)||!mu(o))return null;var i=function(e){return{h:gu(e.h),s:hu(e.s,0,100),v:hu(e.v,0,100),a:hu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Eu(i)},"hsv"]]},Mu=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]},Ru=function(e){return"string"==typeof e?Mu(e.trim(),Pu.string):"object"==typeof e&&null!==e?Mu(e,Pu.object):[null,void 0]},Lu=function(e,t){var n=Bu(e);return{h:n.h,s:hu(n.s+100*t,0,100),l:n.l,a:n.a}},Au=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Du=function(e,t){var n=Bu(e);return{h:n.h,s:n.s,l:hu(n.l+100*t,0,100),a:n.a}},Ou=function(){function e(e){this.parsed=Ru(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 fu(Au(this.rgba),2)},e.prototype.isDark=function(){return Au(this.rgba)<.5},e.prototype.isLight=function(){return Au(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=bu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?_u(fu(255*r)):"","#"+_u(t)+_u(n)+_u(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return bu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=bu(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 wu(Bu(this.rgba))},e.prototype.toHslString=function(){return t=(e=wu(Bu(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=yu(this.rgba),{h:fu(e.h),s:fu(e.s),v:fu(e.v),a:fu(e.a,3)};var e},e.prototype.invert=function(){return Fu({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),Fu(Lu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Fu(Lu(this.rgba,-e))},e.prototype.grayscale=function(){return Fu(Lu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Fu(Du(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Fu(Du(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?Fu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):fu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Bu(this.rgba);return"number"==typeof e?Fu({h:e,s:t.s,l:t.l,a:t.a}):fu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Fu(e).toHex()},e}(),Fu=function(e){return e instanceof Ou?e:new Ou(e)},zu=[],Vu=function(e){e.forEach((function(e){zu.indexOf(e)<0&&(e(Ou,Pu),zu.push(e))}))};function Hu(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,a=o[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var s=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=s,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 Gu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Uu=function(e){return.2126*Gu(e.r)+.7152*Gu(e.g)+.0722*Gu(e.b)};function Wu(e){e.prototype.luminance=function(){return e=Uu(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,a,s,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(a=Uu(l))>(s=Uu(i))?(a+.05)/(s+.05):(s+.05)/(a+.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 $u=n(3124),ju=n.n($u);const Ku=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function qu(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 a=[];function s(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;a.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=w()||S());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("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 g(){const e=p(/^([^{]+)/);if(e)return Yu(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=Yu(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ku,""),value:n?Yu(n[0]).replace(Ku,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return s("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:s("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function w(){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 s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=f();for(;r=k();)i.push(r),i=i.concat(f());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):s("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Yu(t[1]);if(!c())return s("@media missing '{'");const o=f().concat(d());return u()?e({type:"media",media:n,rules:o}):s("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Yu(t[1]),media:Yu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Yu(t[1]);if(!c())return s("@supports missing '{'");const o=f().concat(d());return u()?e({type:"supports",supports:n,rules:o}):s("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Yu(t[1]),o=Yu(t[2]);if(!c())return s("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):s("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=g()||[];if(!c())return s("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):s("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function S(){const e=l(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return Qu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Yu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Qu(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){Qu(e,o)})):n&&"object"==typeof n&&Qu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Xu=n(8575),Zu=n.n(Xu),Ju=ed;function ed(e){this.options=e||{}}ed.prototype.emit=function(e){return e},ed.prototype.visit=function(e){return this[e.type](e)},ed.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 td=nd;function nd(e){Ju.call(this,e)}Zu()(nd,Ju),nd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},nd.prototype.comment=function(e){return this.emit("",e.position)},nd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},nd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},nd.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("}")},nd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},nd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},nd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},nd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},nd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},nd.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("}")},nd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},nd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},nd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},nd.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("}"):""},nd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var od=rd;function rd(e){e=e||{},Ju.call(this,e),this.indentation=e.indent}Zu()(rd,Ju),rd.prototype.compile=function(e){return this.stylesheet(e)},rd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},rd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},rd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},rd.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}")},rd.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}")},rd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},rd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},rd.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}")},rd.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)+"}")},rd.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")},rd.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}")},rd.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}")},rd.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}")},rd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},rd.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()+"}"):""},rd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},rd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var ld=function(e,t){try{const r=qu(e),l=ju().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new td(o):new od(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function id(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 ad(e,t){return new URL(e,t).toString()}var sd=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]};id(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ad(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 cd=/^(body|html|:root).*$/;var ud=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(cd)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n}};var dd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(ud(t)),o&&r.push(sd(o)),r.length?ld(n,(0,d.compose)(r)):n}))};const pd=".editor-styles-wrapper";function md(e){return(0,a.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(pd);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=Fu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function fd(e){let{styles:t}=e;const n=(0,a.useMemo)((()=>dd(t,pd)),[t]);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("style",{ref:md(t)}),n.map(((e,t)=>(0,a.createElement)("style",{key:t},e))))}let hd;Vu([Hu,Wu]);const gd=2e3;var vd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:s}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Kn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,a.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);hd=hd||(0,d.pure)(Gf);const h=l/t;return(0,a.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,a.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${h})`,height:s*h,maxHeight:s>gd?gd*h:void 0,minHeight:o}},(0,a.createElement)(du,{head:(0,a.createElement)(fd,{styles:f}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:s,pointerEvents:"none",maxHeight:gd,minHeight:h<1&&o?o/h:o}},i,(0,a.createElement)(hd,{renderAppender:!1}))))};var bd=(0,a.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const s=(0,m.useSelect)((e=>e(Kn).getSettings()),[]),c=(0,a.useMemo)((()=>{const e={...s};return e.__experimentalBlockPatterns=[],e}),[s]),d=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,a.createElement)(jc,{value:d,settings:c},r?(0,a.createElement)(Kc,{onClick:l}):(0,a.createElement)(vd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function kd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Kn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),s=(0,a.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,a.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,a.createElement)(jc,{value:p,settings:s},(0,a.createElement)(Wf,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?f:null}}var _d=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:s,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,a.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,a.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,a.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,a.createElement)(bd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,a.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!p&&(0,a.createElement)(Wc,{title:i,icon:s,description:c}))};var yd=(0,a.createContext)();var Ed=(0,a.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const s=(0,a.useContext)(yd);return(0,a.createElement)(p.__unstableCompositeItem,i({ref:t,state:s,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,a.createElement)(o,t,r):"function"==typeof r?r(t):(0,a.createElement)(p.Button,t,r)}))}));var Cd=(0,a.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function wd(e){let{count:t,icon:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,a.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,a.createElement)(p.FlexItem,null,n?(0,a.createElement)(Uc,{icon:n}):(0,h.sprintf)((0,h._n)("%d block","%d blocks",t),t)),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Uc,{icon:Cd})))))}var Sd=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,a.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,a.createElement)(wd,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))};function Bd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var Id=(0,a.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:s,isDraggable:u,...d}=e;const p=(0,a.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(0,a.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,a.createElement)(Sd,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,a.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(s(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,a.createElement)(Ed,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Bd()?e.metaKey:e.ctrlKey),s(null)},onKeyDown:e=>{const{keyCode:t}=e;t===xc.ENTER&&(e.preventDefault(),l(o,Bd()?e.metaKey:e.ctrlKey),s(null))},onFocus:()=>{p.current||s(o)},onMouseEnter:()=>{p.current||s(o)},onMouseLeave:()=>s(null),onBlur:()=>s(null)},d),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,a.createElement)(Uc,{icon:o.icon,showColors:!0})),(0,a.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))}));var xd=(0,a.forwardRef)((function(e,t){const[n,o]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{n&&(0,At.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,a.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))}));var Td=(0,a.forwardRef)((function(e,t){const n=(0,a.useContext)(yd);return(0,a.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))}));var Nd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:s=!0}=e;return(0,a.createElement)(xd,{className:"block-editor-block-types-list","aria-label":i},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,a.createElement)(Td,{key:t},e.map(((e,l)=>(0,a.createElement)(Id,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:s,isFirst:0===t&&0===l})))))),l)};var Pd=function(e){let{title:t,icon:n,children:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,a.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,a.createElement)(p.Icon,{icon:n})),(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},o))};var Md=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Kn),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,a.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const a=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(a,void 0,n)}),[t])]};var Rd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,a.createElement)(yd.Provider,{value:n},t)};const Ld=[];var Ad=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,s,c]=Md(t,n),p=(0,a.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,a.useMemo)((()=>l.filter((e=>!e.category))),[l]),f=(0,a.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),g=(0,a.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,a.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,k=(0,a.useMemo)((()=>Object.entries(s)),[s]),_=(0,d.useAsyncList)(b?k:Ld);return(0,a.createElement)(Rd,null,(0,a.createElement)("div",null,r&&!!p.length&&(0,a.createElement)(Pd,{title:(0,h._x)("Most used","blocks")},(0,a.createElement)(Nd,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,a.createElement)(Pd,{key:e.slug,title:e.title,icon:e.icon},(0,a.createElement)(Nd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,a.createElement)(Pd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,a.createElement)(Nd,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=g[t];return r&&r.length?(0,a.createElement)(Pd,{key:t,title:n.title,icon:n.icon},(0,a.createElement)(Nd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))};var Dd=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,a.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,a.createElement)(p.FlexItem,{isBlock:!0},(0,a.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,h.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},Od=window.wp.notices;var Fd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Kn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Od.store),i=(0,a.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)((0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[o,n,i]};function zd(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:s}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(zd)}`;return(0,a.createElement)(Sd,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,a.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,a.createElement)(bd,{blocks:l,viewportWidth:s}),(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,a.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Vd(){return(0,a.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Hd=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:s=(0,h.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,a.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((e=>o.includes(e)?(0,a.createElement)(zd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,a.createElement)(Vd,{key:e.name}))))};function Gd(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,a.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,a.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Ud(e){let{filterValue:t,setFilterValue:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,a.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}var Wd=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,a.createElement)(Ud,{filterValue:r,setFilterValue:l}),!r&&(0,a.createElement)(Gd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))};var $d=function(){return(0,a.createElement)("div",{className:"block-editor-inserter__no-results"},(0,a.createElement)(Cr,{className:"block-editor-inserter__no-results-icon",icon:Gc}),(0,a.createElement)("p",null,(0,h.__)("No results found.")))};var jd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:s=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Kn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=e(Kn),c=r();let u,d=t;return void 0!==n?u=n:o?u=a(o):!l&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:f,insertBlocks:g,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Kn),k=(0,a.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?f(o.clientId,e,null,s||n?0:null,t):g(e,p,d,!0,s||n?0:null,t);const a=(0,h.sprintf)((0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,At.speak)(a),i&&i()}),[l,c,f,g,d,p,i,s]),_=(0,a.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Kd=e=>e.name||"",qd=e=>e.title,Yd=e=>e.description||"",Qd=e=>e.keywords||[],Xd=e=>e.category,Zd=()=>null;function Jd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const ep=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Jd(e))},tp=(e,t)=>(0,u.differenceWith)(e,ep(t),((e,t)=>t.includes(e))),np=(e,t,n,o)=>{if(0===ep(o).length)return e;return op(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}})},op=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=ep(t);if(0===o.length)return e;const r=e.map((e=>[e,rp(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 rp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Kd,getTitle:r=qd,getDescription:l=Yd,getKeywords:i=Qd,getCategory:a=Xd,getCollection:s=Zd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=a(e),h=s(e),g=Jd(t),v=Jd(d);let b=0;if(g===v)b+=30;else if(v.startsWith(g))b+=20;else{const e=[c,d,p,...m,f,h].join(" "),t=(0,u.words)(g);0===tp(t,e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}function lp(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,a.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)((0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var ip=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(At.speak,500),[l,i]=jd({shouldFocusBlock:!0}),[s,,c]=Fd(i,l),u=(0,a.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,a.useMemo)((()=>t?op(s,t):s.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,s]);(0,a.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,a.createElement)(lp,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,a.createElement)(Rd,null,!f&&(0,a.createElement)($d,null),f&&(0,a.createElement)(Hd,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function ap(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,a.useState)(""),[l,i]=(0,a.useState)(null==t?void 0:t.name);return(0,a.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,a.createElement)(Wd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,a.createElement)(ip,{filterValue:o,selectedCategory:l,patternCategories:n}))}var sp=function(e){let{onModalClose:t,...n}=e;return(0,a.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,a.createElement)(ap,n))};function cp(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Fd(n,t),s=(0,a.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,a.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?s(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,a.useMemo)((()=>c.sort(((e,t)=>s(e)-s(t)))),[c,s]),p=(0,d.useAsyncList)(u);return c.length?(0,a.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,a.createElement)(Hd,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var up=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,a.useState)(!1),[s,c]=Fd(),u=(0,a.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,a.useMemo)((()=>{const e=c.filter((e=>s.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return s.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,h._x)("Uncategorized")}),e}),[s,c]),p=r||d[0];return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Dd,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,a.createElement)(cp,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,a.createElement)(sp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},dp=window.wp.url;function pp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Md(o,n),i=(0,a.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,a.createElement)($d,null):(0,a.createElement)(Pd,{title:(0,h.__)("Reusable blocks")},(0,a.createElement)(Nd,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}var mp=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(pp,{onHover:o,onInsert:n,rootClientId:t}),(0,a.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,a.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,dp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))};const{Fill:fp,Slot:hp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");fp.Slot=hp;var gp=fp;const vp=[];var bp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:s,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:g=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(At.speak,500),[_,y]=jd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:s,shouldFocusBlock:v}),[E,C,w,S]=Md(_,y),[B,,I]=Fd(y,_),x=(0,a.useMemo)((()=>{if(0===c)return[];const e=op(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,a.useMemo)((()=>{if(0===T)return[];const e=np((0,u.orderBy)(E,["frecency"],["desc"]),C,w,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,w,m]);(0,a.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,h.sprintf)((0,h._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:vp),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,a.createElement)(Pd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,a.createElement)(Nd,{items:P,onSelect:S,onHover:o,label:(0,h.__)("Blocks"),isDraggable:g})),A=!!x.length&&(0,a.createElement)(Pd,{title:(0,a.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,a.createElement)(Hd,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:g})));return(0,a.createElement)(Rd,null,!f&&!R&&(0,a.createElement)($d,null),b?A:L,!!N.length&&!!x.length&&(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,a.createElement)(gp.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,a.createElement)($d,null))))};const kp={name:"blocks",title:(0,h.__)("Blocks")},_p={name:"patterns",title:(0,h.__)("Patterns")},yp={name:"reusable",title:(0,h.__)("Reusable")};var Ep=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,a.useMemo)((()=>{const e=[kp];return n&&e.push(_p),o&&e.push(yp),e}),[kp,n,_p,o,yp]);return(0,a.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)};var Cp=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:s,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,g]=(0,a.useState)(u),[v,b]=(0,a.useState)(null),[k,_]=(0,a.useState)(null),[y,E,C]=jd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:w,hasReusableBlocks:S}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Kn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,a.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,a.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,a.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,a.useCallback)((e=>{_(e)}),[_]),N=(0,a.useMemo)((()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"block-editor-inserter__block-list"},(0,a.createElement)(Ad,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),s&&(0,a.createElement)("div",{className:"block-editor-inserter__tips"},(0,a.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,a.createElement)(Hc,null)))),[y,B,x,f,c,s]),P=(0,a.useMemo)((()=>(0,a.createElement)(up,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,a.useMemo)((()=>(0,a.createElement)(mp,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,a.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,a.useRef)();return(0,a.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(0,a.createElement)("div",{className:"block-editor-inserter__menu"},(0,a.createElement)("div",{className:"block-editor-inserter__main-area"},(0,a.createElement)("div",{className:"block-editor-inserter__content"},(0,a.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),g(e)},value:f,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:L}),!!f&&(0,a.createElement)(bp,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(w||S)&&(0,a.createElement)(Ep,{showPatterns:w,showReusableBlocks:S},R),!f&&!w&&!S&&N)),s&&v&&(0,a.createElement)(_d,{item:v}))}));function wp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,a.useState)(""),[s,u]=jd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Md(s,u),[f]=Fd(u,s),{setInserterIsOpened:g,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Kn),i=t(),a=r(o),s=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&a>0&&(a<s||0===s),insertionIndex:-1===a?s:a}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,a.useEffect)((()=>{g&&g(!1)}),[g]);let y=0;return k&&(y=b?4:2),(0,a.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":g})},_&&(0,a.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,a.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,a.createElement)(bp,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),g&&(0,a.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{g({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const Sp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:s,toggleProps:c={}}=e;t=s?(0,h.sprintf)((0,h._x)("Add %s","directly add the only allowed block"),l):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,a.createElement)(p.Button,i({icon:zc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!s&&"true","aria-expanded":!s&&r,disabled:o},d))};class Bp extends a.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:a,hasItems:s,renderToggle:c=Sp}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!s,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:a})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,a.createElement)(wp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,a.createElement)(Cp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,a.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var Ip=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:s}=e(Kn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=a(o),p=s(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:a,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u}=t;if(!a&&!c)return;const{insertBlock:d}=e(Kn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Kn);if(!e||!l&&!n)return{};const i={};let a={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var s;const e=t(n);if(null!=e&&null!==(s=e.innerBlocks)&&void 0!==s&&s.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(s.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:a}=o(Kn);if(l)return e(l);const s=t();return!i&&s&&a(s)===n?e(s)+1:r(n).length}(),n),u&&u();const m=(0,h.sprintf)((0,h.__)("%s block added"),s.title);(0,At.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Bp);var xp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Kn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Kn);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,Fc.decodeEntities)(r)||(0,h.__)("Type / to choose a block");return(0,a.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,a.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{xc.ENTER!==e.keyCode&&xc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,a.createElement)(Ip,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Tp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,a.createElement)(Ip,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:s,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,h.sprintf)((0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const f=!m;let g=(0,a.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:s,label:n},!m&&(0,a.createElement)(p.VisuallyHidden,{as:"span"},n),(0,a.createElement)(Cr,{icon:zc}));return(f||m)&&(g=(0,a.createElement)(p.Tooltip,{text:n},g)),g},isAppender:!0})}const Np=(0,a.forwardRef)(((e,t)=>(Ft()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Tp(e,t))));var Pp=(0,a.forwardRef)(Tp);var Mp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Kn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:s,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,a.createElement)(l,null);else{if(!(s===n||!n&&!s))return null;t=o?(0,a.createElement)(xp,{rootClientId:n}):(0,a.createElement)(Pp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,a.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));function Rp(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])}const Lp=(0,a.createContext)();function Ap(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Kn),l=(0,a.useContext)(Lp),i=(0,a.useRef)(),{orientation:s,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:a}=e(Kn),s=r(),c=n(s.rootClientId);if(!c.length)return{};let u=c[s.index-1],d=c[s.index];for(;l(u);)u=i(u);for(;l(d);)d=a(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(s.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:s.rootClientId,isInserterShown:null==s?void 0:s.__unstableWithInserter}}),[]),b=Eo(u),k=Eo(f),_="vertical"===s,y=(0,a.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,a.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,h.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=Rp(n),w=(0,d.useReducedMotion)(),S=c()("block-editor-block-list__insertion-point","is-"+s);const B=b&&k&&v,I={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:B?.4:0}},hover:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:w?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,a.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+g},(0,a.createElement)(p.__unstableMotion.div,{layout:!w,initial:w?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(S,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,a.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,a.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,a.createElement)(Ip,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Dp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Kn).isBlockInsertionPointVisible()),[]);return(0,a.createElement)(Lp.Provider,{value:(0,a.useRef)(!1)},r&&(0,a.createElement)(Ap,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Op(){const e=(0,a.useContext)(Lp),t=(0,m.useSelect)((e=>e(Kn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:s,getTemplateLock:c}=(0,m.useSelect)(Kn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Kn);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",a),()=>{o.removeEventListener("mousemove",a)};function a(t){var o,a;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(!t.target.classList.contains("is-root-container")){d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),h=t.clientY-f.top,g=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(a=v.parentElement)||void 0===a?void 0:a.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(s().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,s])}const Fp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,zp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Vp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Kn),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),a=n(e),s=l(a);if(!s)return null;const c=o(e),u=i(a,c),d={title:s.title,icon:s.icon,description:s.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||s.title,icon:u.icon||s.icon,description:u.description||s.description}:d}),[e])}function Hp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Kn),i=n(e);if(!i)return{};const a=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:a&&l(o(e).ref)}}),[e]),i=Vp(e);if(!o||!i)return null;const a=(0,r.getBlockType)(o),s=a?(0,r.__experimentalGetBlockLabel)(a,n):null,c=l||s,d=c&&c!==a.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Gp(e){let{clientId:t,maximumLength:n}=e;return Hp(t,n)}var Up=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:s,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Kn),a=l(n[0]),s=i(n[0]);return{srcRootClientId:a,isDraggable:o(n,a),icon:null===(t=(0,r.getBlockType)(s))||void 0===t?void 0:t.icon}}),[n]),d=(0,a.useRef)(!1),[f,h,g]=function(){const e=(0,a.useRef)(null),t=(0,a.useRef)(null),n=(0,a.useRef)(null),o=(0,a.useRef)(null);return(0,a.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,a.useCallback)((r=>{e.current=r.clientY,n.current=(0,Zr.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,a.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(Kn);if((0,a.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:s};return(0,a.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,g(),i&&i()},__experimentalDragComponent:(0,a.createElement)(wd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))};var Wp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Vp(t),s=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:a}=e(Kn),s=l(t),{name:c,attributes:u}=r(t);return{index:s,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=a(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:g,orientation:v}=s,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Kn),_=(0,a.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,a.useEffect)((()=>{_.current.focus(),(0,At.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Kn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Kn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("Drag");return(0,a.createElement)("div",{className:D},(0,a.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Uc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(Up,{clientIds:[t]},(e=>(0,a.createElement)(p.Button,i({icon:Cd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,tabIndex:"-1"},e))))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{ref:_,onClick:()=>b(!1),onKeyDown:function(e){const{keyCode:n}=e,r=n===xc.UP,l=n===xc.DOWN,i=n===xc.LEFT,a=n===xc.RIGHT,s=n===xc.TAB,c=n===xc.ESCAPE,u=n===xc.ENTER,d=n===xc.SPACE,p=e.shiftKey;if(n===xc.BACKSPACE||n===xc.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),h=T(f||m),g=N(f||m),v=s&&p||r,b=s&&!p||l,_=i,y=a;let E;if(v)E=h;else if(b)E=g;else if(_){var D;E=null!==(D=S(m))&&void 0!==D?D:m}else if(y){var O;E=null!==(O=B([m])[0])&&void 0!==O?O:m}const F=C();if(c&&P()&&(R(),e.preventDefault()),c&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(u||d)&&F){const e=S(F),t=S(m),n=w(F);let o=w(m);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(s&&m){let t;if(b){t=o;do{t=Zr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=Zr.focus.tabbable.findNext(t))}else t=Zr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,a.createElement)(Gp,{clientId:t,maximumLength:35})))))};function $p(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function jp(e,t,n,o,r){const[l]=(0,a.useState)(t),[i]=(0,a.useState)(o),s=(0,a.useCallback)((()=>{!function(e){const[t]=Zr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,eu.useShortcut)("core/block-editor/focus-toolbar",s),(0,a.useEffect)((()=>{l&&s()}),[n,l,s]),(0,a.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=$p(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=$p(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}var Kp=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const s=(0,a.useRef)(),c=function(e){const[t,n]=(0,a.useState)(!0),o=(0,a.useCallback)((()=>{const t=!Zr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Ft()("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,a.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(s);return jp(s,n,c,o,r),c?(0,a.createElement)(p.Toolbar,i({label:l["aria-label"],ref:s},l),t):(0,a.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:s},l),t)};var qp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Yp=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Qp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var Xp=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function Zp(e,t,n,o,r,l,i){const a=n+1,s=e=>"up"===e?"horizontal"===i?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;if(r<0&&n)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if(r>0&&o)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if(r<0&&!n)return(0,h.sprintf)((0,h._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l);if(r>0&&!o)return(0,h.sprintf)((0,h._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l)}(e,n,o,r,l);if(o&&r)return(0,h.sprintf)((0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=s("down");if("down"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=s("down");if("down"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and cant be moved down"),t);if("left"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and cant be moved left"),t);if("right"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the end of the content and cant be moved right"),t)}if(l<0&&!o){const e=s("up");if("up"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,h.sprintf)((0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=s("up");if("up"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and cant be moved up"),t);if("left"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and cant be moved left"),t);if("right"===e)return(0,h.sprintf)((0,h.__)("Block %1$s is at the beginning of the content and cant be moved right"),t)}}const Jp=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?qp:Yp:Qp:"down"===e?"horizontal"===t?(0,h.isRTL)()?Yp:qp:Xp:null,em=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,tm=(0,a.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...s}=e;const f=(0,d.useInstanceId)(tm),h=(0,u.castArray)(n).length,{blockType:g,isDisabled:v,rootClientId:b,isFirst:k,isLast:_,firstIndex:y,orientation:E="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:a,getBlock:s,getBlockListSettings:c}=e(Kn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),h=t((0,u.last)(d)),g=a(m),v=s(p),b=0===f,k=h===g.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:C,moveBlocksUp:w}=(0,m.useDispatch)(Kn),S="up"===o?w:C,B=`block-editor-block-mover-button__description-${f}`;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Jp(o,E),label:em(o,E),"aria-describedby":B},s,{onClick:v?null:e=>{S(n,b),s.onClick&&s.onClick(e)},"aria-disabled":v})),(0,a.createElement)("span",{id:B,className:"block-editor-block-mover-button__description"},Zp(h,g&&g.title,y,k,_,"up"===o?-1:1,E)))})),nm=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tm,i({direction:"up",ref:t},e)))),om=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(tm,i({direction:"down",ref:t},e))));var rm=(0,m.withSelect)(((e,t)=>{var n;let{clientIds:o}=t;const{getBlock:l,getBlockIndex:i,getBlockListSettings:a,canMoveBlocks:s,getBlockOrder:c,getBlockRootClientId:d}=e(Kn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),h=d((0,u.first)(p)),g=i(m),v=0===g,b=i((0,u.last)(p))===c(h).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:s(o,h),rootClientId:h,firstIndex:g,isFirst:v,isLast:b,orientation:null===(n=a(h))||void 0===n?void 0:n.orientation}}))((function(e){let{isFirst:t,isLast:n,clientIds:o,canMove:r,isHidden:l,rootClientId:s,orientation:u,hideDragHandle:d}=e;const[m,f]=(0,a.useState)(!1),g=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!s)return null;const b=(0,h.__)("Drag");return(0,a.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,a.createElement)(Up,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,a.createElement)(p.Button,i({icon:Cd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:b,tabIndex:"-1"},e)))),(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-mover__move-button-container"},(0,a.createElement)(p.ToolbarItem,{onFocus:g,onBlur:v},(e=>(0,a.createElement)(nm,i({clientIds:o},e)))),(0,a.createElement)(p.ToolbarItem,{onFocus:g,onBlur:v},(e=>(0,a.createElement)(om,i({clientIds:o},e))))))}));const{clearTimeout:lm,setTimeout:im}=window,am=200;function sm(e){let{ref:t,isFocused:n,debounceTimeout:o=am,onChange:r=u.noop}=e;const[l,i]=(0,a.useState)(!1),s=(0,a.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e},p=()=>{const e=s.current;e&&lm&&lm(e)};return(0,a.useEffect)((()=>()=>{c(!1),p()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),p(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),p(),s.current=im((()=>{d()&&c(!1)}),o)}}}function cm(e){let{ref:t,debounceTimeout:n=am,onChange:o=u.noop}=e;const[r,l]=(0,a.useState)(!1),{showMovers:i,debouncedShowMovers:s,debouncedHideMovers:c}=sm({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,a.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,a.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),s())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,s,c]),{showMovers:i,gestures:{onMouseMove:s,onMouseLeave:c}}}function um(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Kn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Kn),{hasBlockSupport:i}=e(r.store),a=n(o()),s=a[a.length-1],c=t(s),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:s,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),s=Vp(n),c=(0,a.useRef)(),{gestures:u}=cm({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,a.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,a.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)((0,h.__)("Select %s"),s.title),showTooltip:!0,icon:(0,a.createElement)(Uc,{icon:s.icon})}))}var dm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function pm(e){let{blocks:t}=e;return(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,a.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,a.createElement)(bd,{viewportWidth:500,blocks:t})))))}var mm=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,s]=(0,a.useState)();return(0,a.createElement)(p.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,a.createElement)(pm,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,a.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>s(null),onMouseEnter:()=>s(t)},(0,a.createElement)(Uc,{icon:n,showColors:!0}),l)})))};var fm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),hm=window.wp.tokenList,gm=n.n(hm);function vm(e,t,n){const o=new(gm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function bm(e){return(0,u.find)(e,"isDefault")}function km(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:s}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Kn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Kn),d=function(e){return e&&0!==e.length?bm(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(gm())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,s),f=function(e,t){return(0,a.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=vm(s,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:s}}function _m(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=km({clientId:t,onSwitch:n});return r&&0!==r.length?(0,a.createElement)(a.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,a.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?fm:null,onClick:()=>o(e)},(0,a.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function ym(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,a.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,a.createElement)(_m,{clientId:o,onSwitch:n}))}const Em=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=Em(e,t,n);if(o)return o}}},Cm=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var wm=(e,t)=>(0,a.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Em(r,t.name,o);if(n){e=!0,o.add(n.clientId),Cm(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function Sm(e){let{patterns:t,onSelect:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,a.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,a.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,a.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,a.createElement)(Bm,{patterns:t,onSelect:n})))))}function Bm(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,a.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,h.__)("Patterns list")}),t.map((e=>(0,a.createElement)(Im,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Im(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Im,`${r}-list__item-description`);return(0,a.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,a.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,a.createElement)(bd,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,a.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,a.createElement)(p.VisuallyHidden,{id:l},t.description))}var xm=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[r,l]=(0,a.useState)(!1),i=wm(n,t);return i.length?(0,a.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},r&&(0,a.createElement)(Sm,{patterns:i,onSelect:o}),(0,a.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),l(!r)},icon:qp},(0,h.__)("Patterns"))):null};const Tm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Kn),l=Vp(n[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:c,icon:d,blockTitle:f,patterns:g}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:a,__experimentalGetPatternTransformItems:s}=e(Kn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Kn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,h=1===n.length,g=h&&c(f);let v;if(h)v=null==l?void 0:l.icon;else{var b;v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:dm}return{possibleBlockTransformations:a(n,m),canRemove:p(t,m),hasBlockStyles:!(null==g||!g.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:s(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&s,_=!(null==g||!g.length)&&s;if(!c&&!k)return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Uc,{icon:d,showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Gp,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,h.sprintf)((0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)((0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k||_;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Uc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,a.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,a.createElement)(Gp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,a.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,a.createElement)(xm,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,a.createElement)(mm,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,a.createElement)(ym,{hoveredBlock:n[0],onSwitch:l}))})))))};var Nm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Kn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,a.createElement)(Tm,{clientIds:t,blocks:n})};const{Fill:Pm,Slot:Mm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Pm.Slot=Mm;var Rm=Pm;var Lm=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Am=window.wp.blob;function Dm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Om(){const{getBlockName:e}=(0,m.useSelect)(Kn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Od.store);return(0,a.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],a=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)((0,h.__)('Copied "%s" to clipboard.'),a):(0,h.sprintf)((0,h.__)('Moved "%s" to clipboard.'),a)}else l="copy"===o?(0,h.sprintf)((0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)((0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Fm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(Kn),{flashBlock:l,removeBlocks:i,replaceBlocks:a}=(0,m.useDispatch)(Kn),s=Om();return(0,d.useRefEffect)((c=>{function u(u){const d=t();if(0===d.length)return;if(!n()){const{target:e}=u,{ownerDocument:t}=e;if("copy"===u.type||"cut"===u.type?(0,Zr.documentHasUncollapsedSelection)(t):(0,Zr.documentHasSelection)(t))return}if(!c.contains(u.target.ownerDocument.activeElement))return;const p=u.defaultPrevented;if(u.preventDefault(),"copy"===u.type||"cut"===u.type){1===d.length&&l(d[0]),s(u.type,d);const t=e(d),n=(0,r.serialize)(t);u.clipboardData.setData("text/plain",n),u.clipboardData.setData("text/html",n)}if("cut"===u.type)i(d);else if("paste"===u.type){if(p)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Zr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Dm(r,o)&&(o=r.map((e=>`<img src="${(0,Am.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(u),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});a(d,l,l.length-1,-1)}}return c.ownerDocument.addEventListener("copy",u),c.ownerDocument.addEventListener("cut",u),c.ownerDocument.addEventListener("paste",u),()=>{c.ownerDocument.removeEventListener("copy",u),c.ownerDocument.removeEventListener("cut",u),c.ownerDocument.removeEventListener("paste",u)}}),[])}var zm=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Fm()},t)};function Vm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:a,canMoveBlocks:s,canRemoveBlocks:c}=(0,m.useSelect)(Kn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=a(t),h=i(t[0]),g=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=s(t,h),k=c(t,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Kn),T=Om();return n({canDuplicate:g,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:h,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){w((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&S(e[0]),T("copy",e)}})}var Hm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Kn),a=o(n),s=i().codeEditingEnabled;return{mode:l(n),blockType:a?(0,r.getBlockType)(a.name):null,isCodeEditingEnabled:s}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=u.noop,clientId:o}=t;return{onToggleMode(){e(Kn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const s="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,a.createElement)(p.MenuItem,{onClick:o},!l&&s)}));var Gm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Kn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Kn).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,a.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Um,Slot:Wm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Um.Slot=Wm;var $m=Um;function jm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:s=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Kn);return n||o?(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),s()}},(0,h._x)("Group","verb")),o&&(0,a.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),s()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Km(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(Kn),{getGroupingBlockName:a}=e(r.store),s=i(),c=a(),u=l(c,null!=s&&s.length?n(s[0]):void 0),d=o(s),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:s,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}var qm=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"}));var Ym=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Qm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,m.useSelect)((n=>{const{canEditBlock:o,canMoveBlock:r,canRemoveBlock:l,canLockBlockType:i,getBlockName:a,getBlockRootClientId:s}=n(Kn),c=t?s(e):null,u=o(e),d=r(e,c),p=l(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(a(e)),isLocked:!u||!d||!p}}),[e,t])}function Xm(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,a.useState)({move:!1,remove:!1}),{canEdit:i,canMove:s,canRemove:c}=Qm(t,!0),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Kn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Kn),g=Vp(t),v=(0,d.useInstanceId)(Xm,"block-editor-block-lock-modal__options-title");(0,a.useEffect)((()=>{l({move:!s,remove:!c,...u?{edit:!i}:{}})}),[i,s,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,a.createElement)(p.Modal,{title:(0,h.sprintf)((0,h.__)("Lock %s"),g.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,a.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,a.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,a.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,a.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,a.createElement)("span",{id:v},(0,h.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,a.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,h.__)("Restrict editing"),(0,a.createElement)(p.Icon,{icon:o.edit?Ym:qm})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,h.__)("Disable movement"),(0,a.createElement)(p.Icon,{icon:o.move?Ym:qm})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,a.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,a.createElement)(p.CheckboxControl,{label:(0,a.createElement)(a.Fragment,null,(0,h.__)("Prevent removal"),(0,a.createElement)(p.Icon,{icon:o.remove?Ym:qm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(0,a.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,h.__)("Cancel"))),(0,a.createElement)(p.FlexItem,null,(0,a.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function Zm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Qm(t,!0),[r,l]=(0,a.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuItem,{icon:o?qm:Ym,onClick:l},i),r&&(0,a.createElement)(Xm,{clientId:t,onClose:l}))}const{Fill:Jm,Slot:ef}=(0,p.createSlotFill)("BlockSettingsMenuControls");function tf(e){let{...t}=e;return(0,a.createElement)(p.__experimentalStyleProvider,{document:document},(0,a.createElement)(Jm,t))}tf.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Kn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),s=1===r.length,c=Km(),{isGroupable:d,isUngroupable:f}=c,h=(d||f)&&l;return(0,a.createElement)(ef,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!h&&!s?null:(0,a.createElement)(p.MenuGroup,null,s&&(0,a.createElement)(Zm,{clientId:r[0]}),e,h&&(0,a.createElement)(jm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var nf=tf;const of={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function rf(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,a.createElement)(p.MenuItem,{ref:o},(0,h.__)("Copy"))}var lf=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const s=(0,u.castArray)(t),c=s.length,d=s[0],{firstParentClientId:f,hasReducedUI:g,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:a,getSettings:s}=e(Kn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:s().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:a()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(eu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:C,toggleBlockHighlight:w}=(0,m.useDispatch)(Kn),S=(0,a.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Hp(d,25),I=(0,a.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,h.sprintf)((0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,a.useRef)(),{gestures:P}=cm({ref:N,onChange(e){e&&g||w(f,e)}});return(0,a.createElement)(Vm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:s,canRemove:m,onDuplicate:g,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:w,onMoveTo:B,blocks:x}=e;return(0,a.createElement)(p.DropdownMenu,i({icon:Lm,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:of,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)($m.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,a.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,a.createElement)(Uc,{icon:b.icon}),onClick:()=>C(f)}),(0,h.sprintf)((0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,a.createElement)(Gm,{clientId:d}),(0,a.createElement)(rf,{blocks:x,onCopy:w}),n&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,g,S),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,h.__)("Insert after"))),s&&!v&&(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,a.createElement)(Hm,{clientId:d,onToggle:l})),(0,a.createElement)(nf.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):a.Children.map((e=>(0,a.cloneElement)(e,{onClose:l}))),m&&(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))};var af=function(e){let{clientIds:t,...n}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(lf,i({clientIds:t,toggleProps:e},n)))))};function sf(e){let{clientId:t}=e;const n=Vp(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Qm(t),[s,c]=(0,a.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,a.createElement)(p.ToolbarButton,{icon:Ym,label:(0,h.sprintf)((0,h.__)("Unlock %s"),n.title),onClick:c})),s&&(0,a.createElement)(Xm,{clientId:t,onClose:c})):null}var cf=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"}));var uf=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"}));var df=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const pf={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var mf=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Km(),{replaceBlocks:l}=(0,m.useDispatch)(Kn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(Kn);return{canRemove:n(t)}}),[t]),s=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=pf[o],l(t,i))};return o&&i?(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{icon:cf,label:(0,h._x)("Group","verb"),onClick:s}),(0,a.createElement)(p.ToolbarButton,{icon:uf,label:(0,h._x)("Row","single horizontal line"),onClick:()=>s("row")}),(0,a.createElement)(p.ToolbarButton,{icon:df,label:(0,h._x)("Stack","verb"),onClick:()=>s("stack")})):null};var ff=(0,a.createContext)("");var hf=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:s,hasReducedUI:u,isValid:f,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:a}=e(Kn),s=o(),c=s[0],u=i(c),d=a();return{blockClientIds:s,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:s.every((e=>l(e))),isVisual:s.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:g}=(0,m.useDispatch)(Kn),v=(0,a.useRef)(),{showMovers:b,gestures:k}=cm({ref:v,onChange(e){e&&u||g(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||s;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&h,C=n.length>1,w=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,a.createElement)("div",{className:w},!C&&!_&&(0,a.createElement)(um,{clientIds:n}),(0,a.createElement)("div",i({ref:v},k),(E||C)&&(0,a.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,a.createElement)(Nm,{clientIds:n}),!C&&(0,a.createElement)(sf,{clientId:n[0]}),(0,a.createElement)(rm,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,a.createElement)(mf,null),E&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(oo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(oo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(oo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(oo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(oo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,a.createElement)(ff.Provider,{value:null==l?void 0:l.name},(0,a.createElement)(Rm.Slot,null))),(0,a.createElement)(af,{clientIds:n}))};var gf=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:s,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(Kn),{getBlockType:l}=e(r.store),i=o(),a=i[0],s=n(a),c=l(t(s[s.length-1]));return{blockType:a&&l(t(a)),hasParents:s.length,showParentSelector:(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":s&&u,"is-fixed":n});return(0,a.createElement)(Kp,i({focusOnMount:t,className:d,"aria-label":(0,h.__)("Block tools")},o),(0,a.createElement)(hf,{hideDragHandle:n}))};function vf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:a}=e(Kn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:a()}}function bf(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:s}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:h,isCaretWithinFormattedText:g,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(vf,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Kn);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),y=(0,d.useViewportMatch)("medium"),[E,C]=(0,a.useState)(!1),[w,S]=(0,a.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Kn),I=!h&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!h||g),N=!(u||T||b||r);(0,eu.useShortcut)("core/block-editor/focus-toolbar",(()=>{C(!0),B(!0)}),{isDisabled:!N}),(0,a.useEffect)((()=>{T||C(!1)}),[T]);const P=(0,a.useRef)(),M=Eo(t),R=Eo(k),L=Eo(l),A=Rp(s);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,Zr.getScrollContainer)(D)||z.body;return(0,a.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==s?void 0:s.current},(T||E)&&(0,a.createElement)("div",{onFocus:function(){S(!0)},onBlur:function(){S(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":w})},(0,a.createElement)(Ip,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,a.createElement)(gf,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,a.createElement)(Wp,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,a.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,a.createElement)(Ip,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function kf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:a}=e(Kn),s=t()||n();if(!s)return;const{name:c,attributes:d={},isValid:p}=l(s)||{},m=i(s),f=a(m),h=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:s,rootClientId:o(s),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:h}}function _f(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(kf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,a.createElement)(bf,{clientId:r,rootClientId:l,isValid:s,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function yf(e){let{children:t}=e;const n=(0,a.useContext)(Lp),o=(0,a.useContext)(p.Disabled.Context);return n||o?t:(Ft()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,a.createElement)(Dp,{__unstablePopoverSlot:"block-toolbar"},(0,a.createElement)(_f,{__unstablePopoverSlot:"block-toolbar"}),t))}var Ef=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Xn();return(0,a.createElement)(e,i({},t,{clientId:n}))}),"withClientId");var Cf=Ef((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,a.createElement)(Pp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})}));var wf=(0,d.compose)([Ef,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Kn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,a.createElement)(xp,{rootClientId:t})})),Sf=window.wp.isShallowEqual,Bf=n.n(Sf);const If=new WeakMap;function xf(e,t,n,o,l,i,a){return s=>{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}(s);if("inserter"===d){a();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;l(u,c,e,i&&r<t?t-a:t)}}}function Tf(e,t){const n=(0,m.useSelect)((e=>e(Kn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Kn),{insertBlocks:a,moveBlocksToPosition:s,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Kn),d=xf(e,t,l,i,s,a,u),p=function(e,t,n,o,l,i){return a=>{if(!n)return;const s=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(a)));if(s){const n=s.transform(a,o);i(n,t,e)}}}(e,t,n,c,o,a),f=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,a);return e=>{const t=(0,Zr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function Nf(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,a=o?l:r,s=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=s&&i<=c?i:i<c?s:c,Math.sqrt((i-d)**2+(a-u)**2)}function Pf(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Nf(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Mf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const a=e.getBoundingClientRect(),[s,c]=Pf(t,a,o);if(void 0===i||s<i){i=s,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0)}})),l}function Rf(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,a.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(Kn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Kn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Kn),s=Tf(e,t),c=(0,d.useThrottle)((0,a.useCallback)(((t,o)=>{var i;const a=Mf(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===a?0:a),null!==a&&l(e,a)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:s,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function Lf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:s,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:h,orientation:g,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,s){const{updateBlockListSettings:c}=(0,m.useDispatch)(Kn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Kn).getBlockRootClientId(e);return{blockListSettings:t(Kn).getBlockListSettings(e),parentLock:t(Kn).getTemplateLock(n)}}),[e]),p=(0,a.useMemo)((()=>t),t);(0,a.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Br(null==s?void 0:s.type);t.orientation=e.getOrientation(s)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Bf()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,s])}(t,n,o,l,s,p,g,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Kn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Kn),s=(0,m.useSelect)((t=>t(Kn).getBlocks(e)),[e]),c=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{if((0===s.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(s,t);(0,u.isEqual)(n,s)||i(e,n,0===s.length&&o&&0!==n.length,l())}}),[s,t,n,e])}(t,i,s,d);const k=(0,m.useSelect)((e=>{const n=e(Kn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){If.has(t)||If.set(t,new WeakMap);const n=If.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,a.createElement)(el,{value:k},(0,a.createElement)(Wf,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Af(e){return $c(e),(0,a.createElement)(Lf,e)}const Df=(0,a.forwardRef)(((e,t)=>{const n=Of({ref:t},e);return(0,a.createElement)("div",{className:"block-editor-inner-blocks"},(0,a.createElement)("div",n))}));function Of(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Xn(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:s}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:a}=e(Kn),s=t(n),c=a()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(s,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==s&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Rf({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Af:Lf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":s}),children:n?(0,a.createElement)(f,i({},p,{clientId:n})):(0,a.createElement)(Wf,t)}}Of.save=r.__unstableGetInnerBlocksProps,Df.DefaultBlockAppender=wf,Df.ButtonBlockAppender=Cf,Df.Content=()=>Of.save().children;var Ff=Df;const zf=(0,a.createContext)(),Vf=(0,a.createContext)();function Hf(e){let{className:t,...n}=e;const[o,r]=(0,a.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:s,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(Kn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=Of({ref:(0,d.useMergeRefs)([qc(),Op(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":s&&l,"is-navigate-mode":u})},n);return(0,a.createElement)(zf.Provider,{value:o},(0,a.createElement)("div",p))}function Gf(e){return function(){const e=(0,m.useSelect)((e=>e(Kn).getSettings().__experimentalBlockPatterns),[]);(0,a.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Kn).__experimentalGetParsedPattern(e[n].name),t=Fp(o))};return t=Fp(o),()=>zp(t)}),[e])}(),(0,a.createElement)(yf,null,(0,a.createElement)(Qn,{value:qn},(0,a.createElement)(Hf,e)))}function Uf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Ir}=e;const[i,s]=(0,a.useState)(new Set),c=(0,a.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{s((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[s]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Kn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,a.createElement)(Tr,{value:l},(0,a.createElement)(Vf.Provider,{value:c},u.map((e=>(0,a.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,a.createElement)(Oc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,a.createElement)(Mp,{tagName:r,rootClientId:n,renderAppender:o}))}function Wf(e){return(0,a.createElement)(m.AsyncModeProvider,{value:!1},(0,a.createElement)(Uf,e))}Gf.__unstableElementContext=zf;const $f=["colors","disableCustomColors","gradients","disableCustomGradients"];function jf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:s,label:d,onColorChange:m,onGradientChange:f,colorValue:g,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,w]=(0,a.useState)(v?"gradient":!!y&&"color");return y||E?(0,a.createElement)(p.BaseControl,{className:c()("block-editor-color-gradient-control",s)},(0,a.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,a.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,a.createElement)("legend",null,(0,a.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,a.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,a.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:w,label:(0,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,a.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,a.createElement)(p.ColorPalette,{value:g,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,a.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function Kf(e){const t={};return t.colors=Bo("color.palette"),t.gradients=Bo("color.gradients"),t.disableCustomColors=!Bo("color.custom"),t.disableCustomGradients=!Bo("color.customGradient"),(0,a.createElement)(jf,i({},t,e))}var qf=function(e){return(0,u.every)($f,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(jf,e):(0,a.createElement)(Kf,e)};function Yf(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,a.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,a.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,a.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,a.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,a.createElement)(qf,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:s,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Qf(){return{disableCustomColors:!Bo("color.custom"),disableCustomGradients:!Bo("color.customGradient")}}function Xf(){const e=Qf(),t=Bo("color.palette.custom"),n=Bo("color.palette.theme"),o=Bo("color.palette.default"),r=Bo("color.defaultPalette");e.colors=(0,a.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Bo("color.gradients.custom"),i=Bo("color.gradients.theme"),s=Bo("color.gradients.default"),c=Bo("color.defaultGradients");return e.gradients=(0,a.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&s&&s.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:s}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,s]),e}Vu([Hu,Wu]);const Zf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Jf=(e,t)=>(0,u.find)(e,{color:t});function eh(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const th=[];function nh(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Xf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:s}=(null==n?void 0:n.border)||{},[c,u]=(0,a.useState)((()=>{var e;return null===(e=Zf(l,t,s))||void 0===e?void 0:e.color}));(0,a.useEffect)((()=>{var e;u(null===(e=Zf(l,t,s))||void 0===e?void 0:e.color)}),[t,s,l]);const d=[{label:(0,h.__)("Color"),onColorChange:e=>{u(e);const t=Jf(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:To(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,a.createElement)(Yf,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function oh(e,t,n){var o;if(!xh(t,"color")||Mo(t,Bh,"color"))return e;const{borderColor:r,style:l}=n,i=eh("border-color",r),a=c()(e.className,{"has-border-color":r||(null==l||null===(o=l.border)||void 0===o?void 0:o.color),[i]:!!i});return e.className=a||void 0,e}const rh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:s}=l,c=Bo("color.palette")||th;if(!xh(r,"color")||Mo(r,Bh,"color"))return(0,a.createElement)(e,t);const u={borderColor:s?null===(n=Zf(c,s))||void 0===n?void 0:n.color:void 0};let d=t.wrapperProps;return d={...t.wrapperProps,style:{...u,...null===(o=t.wrapperProps)||void 0===o?void 0:o.style}},(0,a.createElement)(e,i({},t,{wrapperProps:d}))}));function lh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function ih(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=lh(o),i=0===r||r?`${r}${l}`:void 0;return i}function ah(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ih(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function sh(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function ch(e){let{onChange:t,values:n,...o}=e;const r=ih(n),l=sh(n)&&ah(n),s=l?(0,h.__)("Mixed"):null;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:s}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return xh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",oh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!xh(e,"color")||Mo(e,Bh,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),oh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",rh);const uh={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function dh(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,a.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(uh).map((e=>{let[n,l]=e;return(0,a.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(s=n,e=>{t&&t({...r,[s]:e||void 0})})}));var s})))}var ph=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"}));var mh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function fh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,a.createElement)(p.Tooltip,{text:o},(0,a.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?ph:mh,iconSize:16,"aria-label":o})))}const hh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},gh={px:100,em:20,rem:20};function vh(e){let{onChange:t,values:n}=e;const[o,r]=(0,a.useState)(!sh(n)||!ah(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}const t=Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t}));return lh(t)||"px"}(n),s=l&&l.find((e=>e.value===i)),c=(null==s?void 0:s.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(ih(n));return(0,a.createElement)("fieldset",{className:"components-border-radius-control"},(0,a.createElement)("legend",null,(0,h.__)("Radius")),(0,a.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(ch,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,a.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:gh[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,a.createElement)(dh,{min:0,onChange:t,values:n||hh,units:l}),(0,a.createElement)(fh,{onClick:()=>r(!o),isLinked:o})))}function bh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(vh,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=To(t)),o({style:t})}})}var kh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"}));var _h=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"}));var yh=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,a.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const Eh=[{label:(0,h.__)("Solid"),icon:kh,value:"solid"},{label:(0,h.__)("Dashed"),icon:_h,value:"dashed"},{label:(0,h.__)("Dotted"),icon:yh,value:"dotted"}];function Ch(e){let{onChange:t,value:n}=e;return(0,a.createElement)("fieldset",{className:"components-border-style-control"},(0,a.createElement)("legend",null,(0,h.__)("Style")),(0,a.createElement)("div",{className:"components-border-style-control__buttons"},Eh.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}const wh=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Ch,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:To(t)})}})};const Sh=e=>{const{attributes:{borderColor:t,style:n},setAttributes:o}=e,{width:r,color:l,style:i}=(null==n?void 0:n.border)||{},[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),[m,f]=(0,a.useState)(),g=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["px","em","rem"]});return(0,a.createElement)(p.__experimentalUnitControl,{value:r,label:(0,h.__)("Width"),min:0,onChange:e=>{let a={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const h=0===parseFloat(e),g=0===parseFloat(r);h&&!g&&(d(t),f(l),c(i),p=void 0,a.border.color=void 0,a.border.style="none"),!h&&g&&("none"===i&&(a.border.style=s),void 0===t&&(p=u,a.border.color=m)),void 0!==e&&""!==e||(a=To(a)),o({borderColor:p,style:a})},units:g})};const Bh="__experimentalBorder";function Ih(e){const{clientId:t}=e,n=Bo("border.color")&&xh(e.name,"color"),o=Bo("border.radius")&&xh(e.name,"radius"),l=Bo("border.style")&&xh(e.name,"style"),i=Bo("border.width")&&xh(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const s=(0,r.getBlockSupport)(e.name,[Bh,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,a.createElement)(Fo,{__experimentalGroup:"border"},i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.width)}(e),label:(0,h.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Th(o,"width")})}(e),isShownByDefault:null==s?void 0:s.width,resetAllFilter:c("width"),panelId:t},(0,a.createElement)(Sh,e)),l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n||!n.style)}(e),label:(0,h.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Th(o,"style")})}(e),isShownByDefault:null==s?void 0:s.style,resetAllFilter:c("style"),panelId:t},(0,a.createElement)(wh,e)),n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,h.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:Th(o,"color")})}(e),isShownByDefault:null==s?void 0:s.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,a.createElement)(nh,e)),o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Th(o,"radius")})}(e),isShownByDefault:null==s?void 0:s.radius,resetAllFilter:c("radius"),panelId:t},(0,a.createElement)(bh,e)))}function xh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==a.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Bh);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 Th(e,t){return To({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Nh(e){if(e)return`has-${e}-gradient-background`}function Ph(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Mh(e,t){return(0,u.find)(e,["gradient",t])}function Rh(e,t){const n=Mh(e,t);return n&&n.slug}function Lh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Xn(),o=Bo("color.gradients.custom"),r=Bo("color.gradients.theme"),l=Bo("color.gradients.default"),i=(0,a.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(Kn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Kn),d=(0,a.useCallback)((o=>{const r=Rh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Nh(s);let f;return f=s?Ph(i,s):c,{gradientClass:p,gradientValue:f,setGradient:d}}Vu([Hu,Wu]);var Ah=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:s,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=s||o,f=c||r;if(!m&&!f)return null;const g=[{color:m,description:(0,h.__)("text color")},{color:f,description:(0,h.__)("link color")}],v=Fu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of g){if(!e.color)continue;const t=Fu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)((0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)((0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,At.speak)(E),(0,a.createElement)("div",{className:"block-editor-contrast-checker"},(0,a.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Dh(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Xf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},s=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,a.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,a.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,a.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,a.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,a.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:s}),(0,a.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,a.createElement)(qf,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function Oh(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Fh(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,a.useState)(),[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)(),p=yo(o);return(0,a.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(Oh(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(Oh(t).color);let n=p.current,o=Oh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Oh(n).backgroundColor;i(o)})),(0,a.createElement)(Fo,{__experimentalGroup:"color"},n.map(((e,n)=>(0,a.createElement)(Dh,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,a.createElement)(Ah,{backgroundColor:l,textColor:s,enableAlphaChecker:t,linkColor:u}))}const zh="color",Vh=e=>{const t=(0,r.getBlockSupport)(e,zh);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Hh=e=>{if("web"!==a.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,zh);return(0,u.isObject)(t)&&!!t.link},Gh=e=>{const t=(0,r.getBlockSupport)(e,zh);return(0,u.isObject)(t)&&!!t.gradients},Uh=e=>{const t=(0,r.getBlockSupport)(e,zh);return t&&!1!==t.background},Wh=e=>{const t=(0,r.getBlockSupport)(e,zh);return t&&!1!==t.text},$h=e=>t=>{var n,o,r,l,i,a,s,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(a=i.color)&&void 0!==a&&a.gradient):"link"===e?!(null===(s=t.attributes.style)||void 0===s||null===(c=s.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},jh=(e,t)=>To(No(t,e,void 0)),Kh=e=>({textColor:void 0,style:jh(["color","text"],e.style)}),qh=e=>({style:jh(["elements","link","color","text"],e.style)}),Yh=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 Qh(e,t,n){var o,r,l,i,a,s;if(!Vh(t)||Mo(t,zh))return e;const u=Gh(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,h=e=>!Mo(t,zh,e),g=h("text")?eh("color",p):void 0,v=h("gradients")?Nh(m):void 0,b=h("background")?eh("background-color",d):void 0,k=h("background")||h("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,g,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":h("link")&&(null==f||null===(a=f.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=y||void 0,e}const Xh=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Zf(e,n[1]).color:t};function Zh(e){var t,n,o,l,i,s,c,u,d;const{name:p,attributes:m}=e,f=Bo("color.palette.custom"),g=Bo("color.palette.theme"),v=Bo("color.palette.default"),b=(0,a.useMemo)((()=>[...f||[],...g||[],...v||[]]),[f,g,v]),k=Bo("color.gradients.custom"),_=Bo("color.gradients.theme"),y=Bo("color.gradients.default"),E=(0,a.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Bo("color.custom"),w=Bo("color.customGradient"),S=Bo("color.background"),B=Bo("color.link"),I=Bo("color.text"),x=C||!g||(null==g?void 0:g.length)>0,T=w||!_||(null==_?void 0:_.length)>0,N=(0,a.useRef)(m);if((0,a.useEffect)((()=>{N.current=m}),[m]),!Vh(p))return null;const P=Hh(p)&&B&&x,M=Wh(p)&&I&&x,R=Uh(p)&&S&&x,L=Gh(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=Ph(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Jf(b,n),i=t+"Color",a={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},s=null!=l&&l.slug?l.slug:void 0,c={style:To(a),[i]:s};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==a.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[zh,"__experimentalDefaultControls"]);return(0,a.createElement)(Fh,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:Zf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>$h("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:jh(["color","text"],t.style)})})(e),resetAllFilter:Kh}]:[],...R||L?[{label:(0,h.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Zf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=Rh(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:To(e),gradient:n}}else{var a,s,c;const e={...null===(a=N.current)||void 0===a?void 0:a.style,color:{...null===(s=N.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};o={style:To(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>$h("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Yh(t))})(e),resetAllFilter:Yh}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{const n=Jf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=To(No(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Xh(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(s=i.color)||void 0===s?void 0:s.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>$h("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:jh(["elements","link","color","text"],t.style)})})(e),resetAllFilter:qh}]:[]]})}const Jh=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:s}=r,c=Bo("color.palette.custom")||[],u=Bo("color.palette.theme")||[],d=Bo("color.palette.default")||[],p=(0,a.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Vh(o)||Mo(o,zh))return(0,a.createElement)(e,t);const m={};var f,h;s&&!Mo(o,zh,"text")&&(m.color=null===(f=Zf(p,s))||void 0===f?void 0:f.color);l&&!Mo(o,zh,"background")&&(m.backgroundColor=null===(h=Zf(p,l))||void 0===h?void 0:h.color);let g=t.wrapperProps;return g={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,a.createElement)(e,i({},t,{wrapperProps:g}))})),eg={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Vh(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Gh(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Qh),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Vh(e)||Mo(e,zh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Jh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Po({linkColor:Hh(r),textColor:Wh(r),backgroundColor:Uh(r),gradient:Gh(r)},eg,e,t,n,o)}));const tg=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],ng=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],og=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function rg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,s=og(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,a.useMemo)((()=>n&&o?(()=>{const e=[c];return tg.forEach((t=>{let{name:n,value:o}=t;ng.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)((0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return tg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return ng.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,a.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:s,describedBy:d?n?o?(0,h.sprintf)((0,h.__)("Currently selected font appearance: %s"),d.name):(0,h.sprintf)((0,h.__)("Currently selected font style: %s"),d.name):(0,h.sprintf)((0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}const lg=1.5,ig=.1;var ag=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Ft()("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 s=o?void 0:{marginBottom:24};return(0,a.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,a.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return lg;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,h.__)("Line height"),placeholder:lg,step:ig,value:i,min:0}))};const sg="typography.lineHeight";function cg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(ag,{__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:To(t)})}})}function ug(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Bo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,sg)||t}const dg="typography.__experimentalFontStyle",pg="typography.__experimentalFontWeight";function mg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!fg(e),i=!hg(e),s=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,a.createElement)(rg,{onChange:e=>{r({style:To({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:s,fontWeight:c}})}function fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,dg),n=Bo("typography.fontStyle");return!t||!n}function hg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,pg),n=Bo("typography.fontWeight");return!t||!n}function gg(e){const t=fg(e),n=hg(e);return t&&n}function vg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Bo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const s=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,a.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:s,value:t,onChange:n,labelPosition:"top"},r))}const bg="typography.__experimentalFontFamily";function kg(e,t,n){if(!(0,r.hasBlockSupport)(t,bg))return e;if(Mo(t,Xg,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(gm())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function _g(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Bo("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,a.createElement)(vg,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function yg(e){let{name:t}=e;const n=Bo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,bg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,bg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",kg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,bg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),kg(o,e,n)},e}));const Eg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Cg(e,t){const n=(0,u.find)(e,{size:t});return n||{size:t}}function wg(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Sg=function(e){const t=Bo("typography.fontSizes"),n=!Bo("typography.customFontSize");return(0,a.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Bg="typography.fontSize";function Ig(e,t,n){if(!(0,r.hasBlockSupport)(t,Bg))return e;if(Mo(t,Xg,"fontSize"))return e;const o=new(gm())(e.className);o.add(wg(n.fontSize));const l=o.value;return e.className=l||void 0,e}function xg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Bo("typography.fontSizes"),s=Eg(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==s?void 0:s.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,a.createElement)(Sg,{onChange:e=>{const t=Cg(i,e).slug;l({style:To({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Tg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Bo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Bg)||!n}const Ng=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Bo("typography.fontSizes"),{name:i,attributes:{fontSize:s,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Bg)||Mo(i,Xg,"fontSize")||!s||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,a.createElement)(e,t);const d=Eg(l,s,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,a.createElement)(e,p)}),"withFontSizeInlineStyles"),Pg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Bg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Ig),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Bg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ig(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Ng),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Po({fontSize:(0,r.hasBlockSupport)(l,Bg)},Pg,e,t,n,o)}));var Mg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var Rg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Lg=[{name:(0,h.__)("Underline"),value:"underline",icon:Mg},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:Rg}];function Ag(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,a.createElement)("legend",null,(0,h.__)("Decoration")),(0,a.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},Lg.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const Dg="typography.__experimentalTextDecoration";function Og(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Ag,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Dg),n=Bo("typography.textDecoration");return t||!n}var zg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var Vg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var Hg=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const Gg=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:zg},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:Vg},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:Hg}];function Ug(e){let{value:t,onChange:n}=e;return(0,a.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,a.createElement)("legend",null,(0,h.__)("Letter case")),(0,a.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Gg.map((e=>(0,a.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const Wg="typography.__experimentalTextTransform";function $g(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Ug,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function jg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Wg),n=Bo("typography.textTransform");return t||!n}function Kg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,a.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const qg="typography.__experimentalLetterSpacing";function Yg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,a.createElement)(Kg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:To({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,qg),n=Bo("typography.letterSpacing");return t||!n}const Xg="typography",Zg=[sg,Bg,dg,pg,bg,Dg,Wg,qg];function Jg(e){const{clientId:t}=e,n=yg(e),o=Tg(e),l=gg(e),i=ug(e),s=Fg(e),c=jg(e),u=Qg(e),d=!fg(e),m=!hg(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[gg(e),Tg(e),ug(e),yg(e),Fg(e),jg(e),Qg(e)];return t.filter(Boolean).length===t.length}(e),g=ev(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[Xg,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,a.createElement)(Fo,{__experimentalGroup:"typography"},!n&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,a.createElement)(_g,e)),!o&&(0,a.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:To({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,a.createElement)(xg,e)),!l&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:og(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,a.createElement)(mg,e)),!i&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,a.createElement)(cg,e)),!s&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,a.createElement)(Og,e)),!c&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,a.createElement)($g,e)),!u&&(0,a.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:To({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,a.createElement)(Yg,e)))}const ev=e=>Zg.some((t=>(0,r.hasBlockSupport)(e,t)));const tv=[...Zg,Bh,zh,$o],nv=e=>tv.some((t=>(0,r.hasBlockSupport)(e,t))),ov="var:";function rv(e){if((0,u.startsWith)(e,ov)){return`var(--wp--${e.slice(ov.length).split("|").join("--")})`}return e}function lv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const a=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(a)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(a,[o]);r&&(n[t]=rv(r))})):t.includes(l.join("."))||(n[o]=rv((0,u.get)(e,l))))}}));const o=Xr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const iv={[`${Bh}.__experimentalSkipSerialization`]:["border"],"color.__experimentalSkipSerialization":[zh],[`${Xg}.__experimentalSkipSerialization`]:[Xg],[`${$o}.__experimentalSkipSerialization`]:["spacing"]},av={...iv,[`${$o}`]:["spacing.blockGap"]},sv={gradients:"gradient"};function cv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:av;if(!nv(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=sv[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...lv(l),...e.style},e}const uv=(0,d.createHigherOrderComponent)((e=>t=>{const n=Zn();return(0,a.createElement)(a.Fragment,null,n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Zh,t),(0,a.createElement)(Jg,t),(0,a.createElement)(Ih,t),(0,a.createElement)(qo,t)),(0,a.createElement)(e,t))}),"withToolbarControls"),dv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,s=Mo(t.name,zh,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=lv(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,s),m=(0,a.useContext)(Gf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,s&&m&&(0,a.createPortal)((0,a.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,a.createElement)(e,i({},t,{className:s?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return nv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",cv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!nv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),cv(o,e,n,iv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",uv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",dv);var pv=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,a.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==xc.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,a.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,a.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,a.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,a.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const mv=[];function fv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Fu(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 hv(e){let{selector:t,id:n,values:o}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,a.createElement)("defs",null,(0,a.createElement)("filter",{id:n},(0,a.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,a.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,a.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,a.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,a.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,a.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,a.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"})))),(0,a.createElement)("style",{dangerouslySetInnerHTML:{__html:r}}))}function gv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Bo(n),r=Bo(`${t}.custom`)||mv,l=Bo(`${t}.theme`)||mv,i=Bo(`${t}.default`)||mv;return(0,a.useMemo)((()=>[...r,...l,...o?mv:i]),[o,r,l,i])}function vv(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=gv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),s=gv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Bo("color.custom"),u=!Bo("color.customDuotone")||0===(null==s?void 0:s.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,a.createElement)(oo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,a.createElement)(pv,{duotonePalette:i,colorPalette:s,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}Vu([Hu]);const bv=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(e,t),n&&(0,a.createElement)(vv,t))}),"withDuotoneControls");const kv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const s=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!s||!u)return(0,a.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,s),f=c()(null==t?void 0:t.className,p),h=(0,a.useContext)(Gf.__unstableElementContext);return(0,a.createElement)(a.Fragment,null,h&&(0,a.createPortal)((0,a.createElement)(hv,{selector:m,id:p,values:fv(u)}),h),(0,a.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",bv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",kv);const _v="__experimentalLayout";function yv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Bo("layout"),s=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,_v,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||g||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!s)return null;const y=Br(_),E=e=>t({layout:e});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Fo,null,(0,a.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,a.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,a.createElement)(Ev,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,a.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,a.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function Ev(e){let{type:t,onChange:n}=e;return(0,a.createElement)(p.ButtonGroup,null,Sr.map((e=>{let{name:o,label:r}=e;return(0,a.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Cv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,_v)&&(0,a.createElement)(yv,i({key:"layout"},t)),(0,a.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),wv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,_v),s=(0,d.useInstanceId)(e),u=Bo("layout")||{},p=(0,a.useContext)(Gf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,_v)||{},h=null!=m&&m.inherit?u:m||f||{},g=c()(null==t?void 0:t.className,{[`wp-container-${s}`]:l});return(0,a.createElement)(a.Fragment,null,l&&p&&(0,a.createPortal)((0,a.createElement)(Pr,{blockName:n,selector:`.wp-container-${s}`,layout:h,style:null==o?void 0:o.style}),p),(0,a.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,_v)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",wv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Cv);const Sv=[];function Bv(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=eh("border-color",n);return{className:c()({[l]:!!l,"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color)})||void 0,style:lv({border:r})}}function Iv(e){const t=Bo("color.palette")||Sv,n=Bv(e);if(e.borderColor){const o=Zf(t,e.borderColor);n.style.borderColor=o.color}return n}function xv(e){var t,n,o,r,l,i;const{backgroundColor:a,textColor:s,gradient:u,style:d}=e,p=eh("background-color",a),m=eh("color",s),f=Nh(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!h&&!!p,"has-text-color":s||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":a||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:lv({color:(null==d?void 0:d.color)||{}})}}const Tv={};function Nv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Bo("color.palette.custom")||[],l=Bo("color.palette.theme")||[],i=Bo("color.palette.default")||[],s=Bo("color.gradients")||Tv,c=(0,a.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,a.useMemo)((()=>[...(null==s?void 0:s.custom)||[],...(null==s?void 0:s.theme)||[],...(null==s?void 0:s.default)||[]]),[s]),d=xv(e);if(t){const e=Zf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Ph(u,o)),n){const e=Zf(c,n);d.style.color=e.color}return d}function Pv(e){const{style:t}=e;return{style:lv({spacing:(null==t?void 0:t.spacing)||{}})}}function Mv(e){const[t,n]=(0,a.useState)(e);return(0,a.useEffect)((()=>{e&&n(e)}),[e]),t}const Rv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,a.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Lv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Bo("color.palette.custom"),o=Bo("color.palette.theme"),r=Bo("color.palette.default"),l=(0,a.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,a.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function Av(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends a.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=Fu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Jf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Zf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),a=t[l];return(null==a?void 0:a.color)===i.color&&a?e[l]=a:e[l]={...i,class:eh(n,i.slug)},e}),{})}render(){return(0,a.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Dv(e){return function(){const t=Rv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(Av(o,t),"withCustomColors")}}function Ov(){const e=Lv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(Av(n,e),"withColors")}const Fv=[];var zv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Bo("typography.fontSizes")||Fv;return(0,a.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends a.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=Eg(r,l,n[t]);return e[o]={...i,class:wg(l)},e}),{});return{...t,...i}}render(){return(0,a.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")};var Vv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var Hv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var Gv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Uv=[{icon:Vv,title:(0,h.__)("Align text left"),align:"left"},{icon:Hv,title:(0,h.__)("Align text center"),align:"center"},{icon:Gv,title:(0,h.__)("Align text right"),align:"right"}],Wv={position:"bottom right",isAlternate:!0};var $v=function(e){let{value:t,onChange:n,alignmentControls:o=Uv,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:s=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,g=c?{isCollapsed:s}:{};return(0,a.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?Gv:Vv,label:r,toggleProps:{describedBy:l},popoverProps:Wv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:s?"menuitemradio":void 0,onClick:d(n)}}))},g))};const jv=e=>(0,a.createElement)($v,i({},e,{isToolbar:!1})),Kv=e=>(0,a.createElement)($v,i({},e,{isToolbar:!0}));var qv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Kn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Md(t,u.noop),i=(0,a.useMemo)((()=>(e.trim()?np(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]),s=(0,a.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Uc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i]);return[s]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Yv=window.wp.apiFetch,Qv=n.n(Yv);var Xv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Zv=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"}));var Jv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Qv()({path:(0,dp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Cr,{key:"icon",icon:"page"===e.subtype?Xv:Zv}),e.title),getOptionCompletion:e=>(0,a.createElement)("a",{href:e.url},e.title)};const eb=[];function tb(e){let{completers:t=eb}=e;const{name:n}=Xn();return(0,a.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([qv,Jv])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var nb=function(e){return(0,a.createElement)(p.Autocomplete,i({},e,{completers:tb(e)}))};var ob=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"}));var rb=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,a.createElement)(p.ToolbarButton,{isActive:t,icon:ob,label:n,onClick:()=>o(!t),disabled:r})};var lb=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,a.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",s=`${i}__popover`;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:s,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,a.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==xc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,a.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};var ib=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var ab=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Kn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Kn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),s=t||(0,h.__)("Document");return(0,a.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,a.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,a.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},s),!i&&s,!!r&&(0,a.createElement)(Cr,{icon:ib,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,a.createElement)("li",{key:e},(0,a.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,a.createElement)(Gp,{clientId:e,maximumLength:35})),(0,a.createElement)(Cr,{icon:ib,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,a.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,a.createElement)(Gp,{clientId:r,maximumLength:35})))};function sb(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,s]=(0,a.useState)(!0),[u,d]=(0,a.useState)(!1),{canEdit:p,isParentSelected:f,hasChildSelected:h,isDraggingBlocks:g,isParentHighlighted:v}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l,canEditBlock:i}=e(Kn);return{canEdit:i(t),isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),b=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":v,"is-dragging-blocks":g});return(0,a.useEffect)((()=>{p?(f||h||l||s(!0),f&&!u&&l&&s(!1),h&&l&&s(!1)):s(!0)}),[f,h,l,u,p]),(0,a.createElement)(n,i({},o,{className:b,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l&&p?()=>s(!1):void 0}),null==o?void 0:o.children)}const cb=()=>(0,a.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,a.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),ub=e=>{let{style:t,className:n}=e;return(0,a.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,a.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,a.createElement)(cb,null)))},db=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==xc.DOWN||(e.preventDefault(),o())},icon:(0,a.createElement)(n,null,(0,a.createElement)(t,null,(0,a.createElement)(ub,null)))}))}};var pb=e=>{let{children:t,...n}=e;return(0,a.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:db(n),renderContent:()=>t})};var mb=(0,a.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const fb=dc(p.__experimentalTreeGridRow);function hb(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:s,path:u,...d}=e;const p=fc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,a.createElement)(fb,i({ref:p,className:c()("block-editor-list-view-leaf",s),level:o,positionInSet:n,setSize:r},d),l)}function gb(e){let{onClick:t}=e;return(0,a.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,a.createElement)(Cr,{icon:ib}))}var vb=(0,a.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:s,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=Vp(o),{isLocked:h}=Qm(o);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==xc.ENTER&&e.keyCode!==xc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:s,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,a.createElement)(gb,{onClick:l}),(0,a.createElement)(Uc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,a.createElement)(Gp,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),h&&(0,a.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,a.createElement)(Cr,{icon:Ym}))))}));const bb=(0,a.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:s,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...h}=e;const{clientId:g}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Kn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[g]),k=v&&b===g,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(g)?f:[g];return(0,a.createElement)(Up,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,a.createElement)(vb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:s,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},h))}))}));var kb=bb;const _b=(0,a.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),yb=()=>(0,a.useContext)(_b);var Eb=(0,a.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:s,level:u,rowCount:f,siblingBlockCount:g,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,a.useRef)(null),[C,w]=(0,a.useState)(!1),{clientId:S}=n,B=r&&_[0]===S,I=r&&_[_.length-1]===S,{toggleBlockHighlight:x}=(0,m.useDispatch)(Kn),T=Vp(S),N=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,P=((e,t,n)=>(0,h.sprintf)((0,h.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(s,g,u),M=T?(0,h.sprintf)((0,h.__)("%s link"),T.title):(0,h.__)("Link"),R=T?(0,h.sprintf)((0,h.__)("Options for %s block"),T.title):(0,h.__)("Options"),{__experimentalFeatures:L,__experimentalPersistentListViewFeatures:A,__experimentalHideContainerBlockActions:D,isTreeGridMounted:O,expand:F,collapse:z}=yb(),V=v&&g>0,H=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),G=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||B});(0,a.useEffect)((()=>{A&&!O&&r&&E.current.focus()}),[]);const U=A?x:()=>{},W=(0,a.useCallback)((()=>{w(!0),U(S,!0)}),[S,w,U]),$=(0,a.useCallback)((()=>{w(!1),U(S,!1)}),[S,w,U]),j=(0,a.useCallback)((e=>{i(e,S),e.preventDefault()}),[S,i]),K=(0,a.useCallback)((e=>{i(void 0,e)}),[i]),q=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?z(S):!1===k&&F(S)}),[S,F,z,k]),Y=L&&(!D||D&&u>1),Q=L&&!Y;let X;V?X=2:Q&&(X=3);const Z=c()({"is-selected":r,"is-first-selected":B,"is-last-selected":I,"is-branch-selected":A&&l,"is-dragging":o,"has-single-cell":Q}),J=_.includes(S)?_:[S];return(0,a.createElement)(hb,{className:Z,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:u,position:s,rowCount:f,path:b,id:`list-view-block-${S}`,"data-block":S,isExpanded:k,"aria-selected":!!r},(0,a.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:X,ref:E,"aria-label":M,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":N},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,a.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,a.createElement)(kb,{block:n,onClick:j,onToggleExpanded:q,isSelected:r,position:s,siblingBlockCount:g,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,a.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:N},P))})),V&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalTreeGridCell,{className:H,withoutGridItem:!0},(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(nm,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})),(0,a.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(om,{orientation:"vertical",clientIds:[S],ref:t,tabIndex:n,onFocus:o})})))),Y&&(0,a.createElement)(p.__experimentalTreeGridCell,{className:G,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,a.createElement)(lf,{clientIds:J,icon:Lm,label:R,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function Cb(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(wb(t,n,o),0):1}const wb=(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+Cb(r,e,t,n):o+1};function Sb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:s="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p,expandNested:f}=e,{expandedState:h,draggedClientIds:g,__experimentalPersistentListViewFeatures:v}=yb(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,a.createElement)(a.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=Cb(b[t-1],h,g,f));const C=v,{itemInView:w}=p,S=!C||w(_),B=t+1,I=s.length>0?`${s}_${B}`:`${B}`,x=r&&!!E&&!!E.length,T=x?null!==(d=h[y])&&void 0!==d?d:f:void 0,N=!(null==g||!g.includes(y)),P=N||S,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&x;return(0,a.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,a.createElement)(Eb,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:I,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,a.createElement)("tr",null,(0,a.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!N&&(0,a.createElement)(Sb,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:I,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}Sb.defaultProps={selectBlock:()=>{}};var Bb=(0,a.memo)(Sb);function Ib(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,s]=(0,a.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]),c=s||i,u=(0,a.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,a.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,a.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,a.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,a.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function xb(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Kn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:s,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Kn),{getBlockType:f}=(0,m.useSelect)(r.store),g=(0,a.useCallback)((async(r,a,s)=>{if(null==r||!r.shiftKey)return await e(),void n(a);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===xc.UP||r.keyCode===xc.DOWN||r.keyCode===xc.HOME||r.keyCode===xc.END);if(!m&&!p()&&!d())return void n(a,null);const g=c(),v=[...l(a),a];m&&!g.some((e=>v.includes(e)))&&await e();let b=i(),k=a;m&&(p()||d()||(b=a),s&&(k=s));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const w=c();if((r.keyCode===xc.HOME||r.keyCode===xc.END)&&w.length>1)return;const S=(0,u.difference)(g,w);let B;if(1===S.length){var I;const e=null===(I=f(o(S[0])))||void 0===I?void 0:I.title;e&&(B=(0,h.sprintf)((0,h.__)("%s deselected."),e))}else S.length>1&&(B=(0,h.sprintf)((0,h.__)("%s blocks deselected."),S.length));B&&(0,At.speak)(B)}),[e,o,f,l,i,s,c,d,p,t,n]);return{updateBlockSelection:g}}function Tb(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Nb=["top","bottom"];function Pb(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Kn),[l,i]=(0,a.useState)(),{rootClientId:s,blockIndex:c}=l||{},u=Tf(s,c),p=o(),f=(0,d.useThrottle)((0,a.useCallback)(((o,l)=>{const a={x:o.clientX,y:o.clientY},s=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const a=i.element.getBoundingClientRect(),[s,c]=Pf(t,a,Nb),u=Tb(t,a);if(void 0===r||s<r||u){r=s;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=a),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 a=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+a,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:!!s&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!s||r(p,i),canInsertDraggedBlocksAsChild:!s||r(p,l)}})),a);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}const Mb=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Rb=(0,a.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,showNestedBlocks:s,showBlockMovers:c,id:u,expandNested:f=!1,...g}=e;const{clientIdsTree:v,draggedClientIds:b,selectedClientIds:k}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Kn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Kn),o=(null==b?void 0:b.length)>0?n(b).length+1:0;return{visibleBlockCount:t()-o}}),[b]),{updateBlockSelection:y}=xb(),[E,C]=(0,a.useReducer)(Mb,{}),{ref:w,target:S}=Pb(),B=(0,a.useRef)(),I=(0,d.useMergeRefs)([B,w,t]),x=(0,a.useRef)(!1),{setSelectedTreeId:T}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,a.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Kn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,a.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:k[0],setExpandedState:C}),N=(0,a.useCallback)(((e,t)=>{y(e,t),T(t)}),[T,y]);(0,a.useEffect)((()=>{x.current=!0}),[]);const[P]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:r,windowOverscan:40}),M=(0,a.useCallback)((e=>{e&&C({type:"expand",clientIds:[e]})}),[C]),R=(0,a.useCallback)((e=>{e&&C({type:"collapse",clientIds:[e]})}),[C]),L=(0,a.useCallback)((e=>{var t;M(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[M]),A=(0,a.useCallback)((e=>{var t;R(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[R]),D=(0,a.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&y(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)}),[y]),O=(0,a.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:r,__experimentalHideContainerBlockActions:l,isTreeGridMounted:x.current,draggedClientIds:b,expandedState:E,expand:M,collapse:R})),[o,r,l,x.current,b,E,M,R]);return(0,a.createElement)(m.AsyncModeProvider,{value:!0},(0,a.createElement)(Ib,{listViewRef:B,blockDropTarget:S}),(0,a.createElement)(p.__experimentalTreeGrid,{id:u,className:"block-editor-list-view-tree","aria-label":(0,h.__)("Block navigation structure"),ref:I,onCollapseRow:A,onExpandRow:L,onFocusRow:D},(0,a.createElement)(_b.Provider,{value:O},(0,a.createElement)(Bb,i({blocks:v,selectBlock:N,showNestedBlocks:s,showBlockMovers:c,fixedListWindow:P,selectedClientIds:k,expandNested:f},g)))))}));function Lb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,a.createElement)(p.Button,i({},l,{ref:r,icon:mb,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Ab=(0,a.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Kn).getBlockCount()),[])&&!n;return(0,a.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,a.createElement)(Lb,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,a.createElement)("div",{className:"block-editor-block-navigation__container"},(0,a.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,a.createElement)(Rb,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function Db(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=vm(o,r,n),i=(0,a.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,a.createElement)(_d,{item:i,isStylePreview:!0})}function Ob(e){let{children:t,scope:n,...o}=e;return(0,a.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,a.createElement)("div",o,t))}function Fb(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:s,genericPreviewBlock:m,className:f}=km({clientId:t,onSwitch:n}),[h,g]=(0,a.useState)(null),[v,b]=(0,a.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,a.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(g,250),y=e=>{l(e),o(null),g(null),_.cancel()},E=e=>{var t;h!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,a.createElement)("div",{className:"block-editor-block-styles"},(0,a.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,a.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":s.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{xc.ENTER!==t.keyCode&&xc.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,a.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),h&&!k&&(0,a.createElement)(Ob,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,a.createElement)(Db,{activeStyle:s,className:f,genericPreviewBlock:m,style:h})))}Fb.Slot=function(e){let{scope:t}=e;return(0,a.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var zb=Fb;var Vb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Hb=function(e){let{icon:t=Vb,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const s=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,a.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:s},(0,a.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,a.createElement)("li",{key:e.name},(0,a.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,a.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,a.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,a.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))};var Gb=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Ub="carousel",Wb="grid",$b=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,a.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,a.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},jb=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,a.createElement)(p.Button,{icon:Yp,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,a.createElement)(p.Button,{icon:qp,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Kb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:s,onStartBlank:c}=e;const u=t===Ub,d=(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,a.createElement)(p.Button,{icon:co,label:(0,h.__)("Carousel view"),onClick:()=>n(Ub),isPressed:u}),(0,a.createElement)(p.Button,{icon:Gb,label:(0,h.__)("Grid view"),onClick:()=>n(Wb),isPressed:t===Wb}));return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,a.createElement)(jb,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,a.createElement)($b,{onBlockPatternSelect:s,onStartBlank:c}))};var qb=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Kn),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const Yb=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const s=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===Ub){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,a.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,a.createElement)("div",{className:c},(0,a.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,a.createElement)(Xb,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,a.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,a.createElement)(p.__unstableComposite,i({},s,{role:"listbox",className:c,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,a.createElement)(Qb,{key:e.name,pattern:e,onSelect:r,composite:s})))))};function Qb(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:s,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(Qb,`${r}__item-description`);return(0,a.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,a.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,a.createElement)(bd,{blocks:l,viewportWidth:c})),!!s&&(0,a.createElement)(p.VisuallyHidden,{id:u},s))}function Xb(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,s=(0,d.useInstanceId)(Xb,"block-editor-block-pattern-setup-list__item-description");return(0,a.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?s:void 0},(0,a.createElement)(bd,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,a.createElement)(p.VisuallyHidden,{id:s},i))}var Zb=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[s,c]=(0,a.useState)(Ub),[u,p]=(0,a.useState)(0),[f,h]=(0,a.useState)(!1),{replaceBlock:g}=(0,m.useDispatch)(Kn),v=qb(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));g(t,n)}),y=l?()=>{h(!0)}:void 0;return(0,a.createElement)(a.Fragment,null,b,(0,a.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`},(0,a.createElement)(Yb,{viewMode:s,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,a.createElement)(Kb,{viewMode:s,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function Jb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,a.createElement)("fieldset",{className:t},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Transform to variation")),r.map((e=>(0,a.createElement)(p.Button,{key:e.name,icon:e.icon,isPressed:o===e.name,label:o===e.name?e.title:(0,h.sprintf)((0,h.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function ek(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,a.createElement)(p.DropdownMenu,{className:t,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Xp,toggleProps:{iconPosition:"right"}},(()=>(0,a.createElement)("div",{className:`${t}__container`},(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var tk=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Kn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Kn),a=t&&l(t);return{activeBlockVariation:n(a,i(t)),variations:a&&o(a,"transform")}}),[t]),i=null==o?void 0:o.name,s=(0,a.useMemo)((()=>{const e=new Set;return l.forEach((t=>{t.icon&&e.add(t.icon)})),e.size===l.length}),[l]);if(null==l||!l.length)return null;const c=s?Jb:ek;return(0,a.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},nk=(0,d.createHigherOrderComponent)((e=>t=>{const n=Bo("color.palette"),o=!Bo("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,s=!(0,u.isEmpty)(r)||!l;return(0,a.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:s}))}),"withColorContext"),ok=nk(p.ColorPalette);function rk(e){let{onChange:t,value:n,...o}=e;return(0,a.createElement)(qf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var lk=window.wp.date;const ik=new Date(2022,0,25);function ak(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,a.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Date format")),(0,a.createElement)(p.ToggleControl,{label:(0,a.createElement)(a.Fragment,null,(0,h.__)("Default format"),(0,a.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,lk.dateI18n)(n,ik))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,a.createElement)(sk,{format:t,onChange:o}))}function sk(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,h._x)("n/j/Y","short date format"),(0,h._x)("n/j/Y g:i A","short date format with time"),(0,h._x)("M j, Y","medium date format"),(0,h._x)("M j, Y g:i A","medium date format with time"),(0,h._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,lk.dateI18n)(e,ik),format:e}))),i={key:"custom",name:(0,h.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,h.__)("Enter your own date format")},[s,c]=(0,a.useState)((()=>!!n&&!r.includes(n)));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,a.createElement)(p.CustomSelectControl,{label:(0,h.__)("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?c(!0):(c(!1),o(t.format))}})),s&&(0,a.createElement)(p.TextControl,{label:(0,h.__)("Custom format"),hideLabelFromVision:!0,help:(0,a.createInterpolateElement)((0,h.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,a.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}const ck=(0,h.__)("(%s: color %s)"),uk=(0,h.__)("(%s: gradient %s)"),dk=["colors","disableCustomColors","gradients","disableCustomGradients"],pk=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:s,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=Jf(c||t,l);r=(0,h.sprintf)(ck,s.toLowerCase(),e&&e.name||l)}else{const e=Mh(u||n,l);r=(0,h.sprintf)(uk,s.toLowerCase(),e&&e.name||i)}return(0,a.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},mk=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:s,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,a.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,a.createElement)(pk,{colors:n,gradients:o,settings:d}));return(0,a.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,a.createElement)(Yf,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v}),!!s&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.__experimentalSpacer,{marginY:4})," ",s))},fk=e=>{const t=Qf();return t.colors=Bo("color.palette"),t.gradients=Bo("color.gradients"),(0,a.createElement)(mk,i({},t,e))},hk=e=>{const t=Xf();return(0,a.createElement)(mk,i({},t,e))};var gk=e=>(0,u.every)(dk,(t=>e.hasOwnProperty(t)))?(0,a.createElement)(mk,e):e.__experimentalHasMultipleOrigins?(0,a.createElement)(hk,e):(0,a.createElement)(fk,e),vk=function(e,t){return vk=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])},vk(e,t)};var bk=function(){return bk=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},bk.apply(this,arguments)};Object.create;Object.create;var kk=n(7970),_k=n.n(kk);function yk(e,t,n,o,r,l){void 0===l&&(l=0);var i=Mk(e,t,l),a=i.width,s=i.height,c=Math.min(a,n),u=Math.min(s,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}function Ek(e,t,n,o,r){void 0===r&&(r=0);var l=Mk(t.width,t.height,r),i=l.width,a=l.height;return{x:Ck(e.x,i,n.width,o),y:Ck(e.y,a,n.height,o)}}function Ck(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function wk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Sk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Bk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i&&0===l?Ik:xk,s={x:a(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:a(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:a(100,n.width/t.width*100/r),height:a(100,n.height/t.height*100/r)},c=Math.round(a(t.naturalWidth,s.width*t.naturalWidth/100)),u=Math.round(a(t.naturalHeight,s.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:s,croppedAreaPixels:bk(bk({},d),{x:Math.round(a(t.naturalWidth-d.width,s.x*t.naturalWidth/100)),y:Math.round(a(t.naturalHeight-d.height,s.y*t.naturalHeight/100))})}}function Ik(e,t){return Math.min(e,Math.max(0,t))}function xk(e,t){return t}function Tk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function Nk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Pk(e,t,n,o,r){var l=Math.cos,i=Math.sin,a=r*Math.PI/180;return[(e-n)*l(a)-(t-o)*i(a)+n,(e-n)*i(a)+(t-o)*l(a)+o]}function Mk(e,t,n){var o=e/2,r=t/2,l=[Pk(0,0,o,r,n),Pk(e,0,o,r,n),Pk(e,t,o,r,n),Pk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),a=Math.max.apply(Math,l.map((function(e){return e[0]}))),s=Math.min.apply(Math,l.map((function(e){return e[1]}))),c=Math.max.apply(Math,l.map((function(e){return e[1]})));return{width:a-i,height:c-s}}function Rk(){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 Lk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=Tk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef||n.videoRef;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:a.offsetWidth,height:a.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var s=n.props.cropSize?n.props.cropSize:yk(a.offsetWidth,a.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===s.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===s.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(s),n.setState({cropSize:s},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=bk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?Ek(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=_k()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},a=n.props.restrictPosition?Ek(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(a),n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?Bk(n.props.restrictPosition?Ek(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?Ek(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}vk(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n 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",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,a,s,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===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.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)||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=wk(n,o),this.lastPinchRotation=Sk(n,o),this.onDragStart(Nk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Nk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=wk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Sk(o,r),a=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),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,a=i.x,s=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,h=m.cropAreaStyle,g=m.mediaStyle,v=t.classes,b=v.containerClassName,k=v.cropAreaClassName,_=v.mediaClassName,y=t.objectFit;return Ol().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:Rk("reactEasyCrop_Container",b)},n?Ol().createElement("img",bk({alt:"",className:Rk("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{src:n,ref:function(t){return e.imageRef=t},style:bk(bk({},g),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):o&&Ol().createElement("video",bk({autoPlay:!0,loop:!0,muted:!0,className:Rk("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",_)},r,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:bk(bk({},g),{transform:l||"translate("+a+"px, "+s+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Ol().createElement("source",bk({key:e.src},e))}))),this.state.cropSize&&Ol().createElement("div",{style:bk(bk({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Rk("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",k)}))},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}(Ol().Component),Ak=Lk;const Dk={position:"bottom right",isAlternate:!0};function Ok(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,a.useState)(),[s,c]=(0,a.useState)(),[u,d]=(0,a.useState)({x:0,y:0}),[p,m]=(0,a.useState)(),[f,h]=(0,a.useState)(),[g,v]=(0,a.useState)(),[b,k]=(0,a.useState)(),_=(0,a.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,a.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const a=new window.Image;a.src=t,a.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const a=n.getContext("2d");a.translate(o,l),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const s=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof s&&(a.crossOrigin=s)}),[f,n,o,i,h,v,d]);return(0,a.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:s,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,s,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,a.useEffect)((()=>{t&&o()}),[t,o]),n}const Fk=(0,a.createContext)({}),zk=()=>(0,a.useContext)(Fk);function Vk(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:l,onFinishEditing:i,onSaveImage:s,children:c}=e;const u=Ok({url:n,naturalWidth:o,naturalHeight:r},l),d=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:s,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Od.store),[p,f]=(0,a.useState)(!1),g=(0,a.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,a.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Qv()({path:`/wp/v2/media/${s}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)((0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,a.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:s,onFinishEditing:i,...u}),p=(0,a.useMemo)((()=>({...u,...d})),[u,d]);return(0,a.createElement)(Fk.Provider,{value:p},c)}function Hk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:s,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=zk();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,a.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":s}),style:{width:n||r,height:k}},(0,a.createElement)(Ak,{image:u||t,disabled:s,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),s&&(0,a.createElement)(p.Spinner,null))}var Gk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Uk(){const{isInProgress:e,zoom:t,setZoom:n}=zk();return(0,a.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Dk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,a.createElement)(p.ToolbarButton,{icon:Gk,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,a.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Wk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 $k(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,a.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,a.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?fm:void 0},t)})))}function jk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=zk();return(0,a.createElement)(p.DropdownMenu,{icon:Wk,label:(0,h.__)("Aspect Ratio"),popoverProps:Dk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)($k,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,a.createElement)($k,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,a.createElement)($k,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var Kk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 qk(){const{isInProgress:e,rotateClockwise:t}=zk();return(0,a.createElement)(p.ToolbarButton,{icon:Kk,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function Yk(){const{isInProgress:e,apply:t,cancel:n}=zk();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,a.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function Qk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Hk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,a.createElement)(oo,null,(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(Uk,null),(0,a.createElement)(p.ToolbarItem,null,(e=>(0,a.createElement)(jk,{toggleProps:e}))),(0,a.createElement)(qk,null)),(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(Yk,null))))}const Xk=[25,50,75,100];function Zk(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:s,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[s,c]=(0,a.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,a.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,a.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,a.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(s)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:s,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(s,i,n,t,c);return(0,a.createElement)(a.Fragment,null,!(0,u.isEmpty)(o)&&(0,a.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,a.createElement)("div",{className:"block-editor-image-size-control"},(0,a.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,a.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,a.createElement)("div",{className:"block-editor-image-size-control__row"},(0,a.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},Xk.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,a.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,a.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Jk=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(O.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"}));var e_=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,a.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,a.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,a.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)},t_=n(5425),n_=n.n(t_);class o_ extends a.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,a.createRef)(),this.inputRef=(0,a.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,n_()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,dp.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)((0,h._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,h.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.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 xc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case xc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case xc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case xc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case xc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case xc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,h.__)("Link selected.")));break;case xc.ENTER: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,a=i;const s=n&&n.length;return l||s||(a=!1),!0===r&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,a.createElement)(a.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,h.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:s,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,g={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,h.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(g,v,s):(0,a.createElement)(p.BaseControl,g,(0,a.createElement)("input",v),s&&(0,a.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:s,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,h={id:d,ref:this.autocompleteRef,role:"listbox"},g=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===s});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:s,suggestionsListProps:h,buildSuggestionItemProps:g,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,a.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,a.createElement)("div",i({},h,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,a.createElement)(p.Button,i({},g(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===s}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var r_=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Kn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(o_);var l_=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:s}=e;return n?(t=s?(0,u.isFunction)(s)?s(n):s:(0,a.createInterpolateElement)((0,h.sprintf)((0,h.__)("Create: <mark>%s</mark>"),n),{mark:(0,a.createElement)("mark",null)}),(0,a.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,a.createElement)(Cr,{className:"block-editor-link-control__search-item-icon",icon:zc}),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null};var i_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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"}));var a_=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:s="",shouldShowType:u=!1}=e;return(0,a.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,a.createElement)(Cr,{className:"block-editor-link-control__search-item-icon",icon:i_}),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,a.createElement)(p.TextHighlight,{text:n.title,highlight:s})),(0,a.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,dp.filterURLForDisplay)((0,dp.safeDecodeURI)(n.url))||""),l&&(0,h.__)("Press ENTER to add this link"))),u&&n.type&&(0,a.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 s_="__CREATE__",c_=[{id:"opensInNewTab",title:(0,h.__)("Open in new tab")}];function u_(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:s,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:g,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,w=f?(0,h.__)("Recently updated"):(0,h.sprintf)((0,h.__)('Search results for "%s"'),o),S=(0,a.createElement)(f?a.Fragment:p.VisuallyHidden,{},(0,a.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},w));return(0,a.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},S,(0,a.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&s_===e.type?(0,a.createElement)(l_,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:s(e,t),isSelected:t===d}):s_===e.type?null:(0,a.createElement)(a_,{key:`${e.id}-${e.type}`,itemProps:s(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function d_(e){const t=(0,u.startsWith)(e,"#");return(0,dp.isURL)(e)||e&&e.includes("www.")||t}const p_=()=>Promise.resolve([]),m_=e=>{let t="URL";const n=(0,dp.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,dp.prependHTTP)(e):e,type:t}])};function f_(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?m_:p_;return(0,a.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return d_(t)?i(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&l&&!a?c[0].concat(c[1]):c[0],a||d_(e)||!r?c:c.concat({title:e,url:e,type:s_})})(t,{...e,isInitialSuggestions:s},r,i,n,o,l)}),[i,r,n])}const h_=()=>Promise.resolve([]),g_=(0,a.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:s=!1,onCreateSuggestion:p=u.noop,onChange:m=u.noop,onSelect:f=u.noop,showSuggestions:g=!0,renderSuggestions:v=(e=>(0,a.createElement)(u_,e)),fetchSuggestions:b=null,allowDirectEntry:k=!0,showInitialSuggestions:_=!1,suggestionsQuery:y={},withURLSuggestion:E=!0,createSuggestionButtonText:C,useLabel:w=!1}=e;const S=f_(y,k,s,E),B=g?b||S:h_,I=(0,d.useInstanceId)(g_),[x,T]=(0,a.useState)(),N=async e=>{let t=e;if(s_!==e.type)(k||t&&Object.keys(t).length>=1)&&f({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&f(t)}catch(e){}},P=c()(l,{"has-no-label":!w});return(0,a.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,a.createElement)(r_,{label:w?"URL":void 0,className:P,value:n,onChange:(e,t)=>{m(e),T(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:g?e=>v({...e,instanceId:I,withCreateSuggestion:s,currentInputValue:n,createSuggestionButtonText:C,suggestionsQuery:y,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),N(t)}}):null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:_,onSubmit:(e,t)=>{var o;const r=e||x;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?N(r||{url:n}):t.preventDefault()},ref:t}),o)}));var v_=g_;var b_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 k_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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:__,Fill:y_}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function E_(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 C_=function(e){const[t,n]=(0,a.useReducer)(E_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,a.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 w_(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:u,isFetching:d}=C_(s),m=u&&Object.keys(u).length,f=n&&(0,dp.filterURLForDisplay)((0,dp.safeDecodeURI)(n.url),16)||"",g=(null==u?void 0:u.title)||(null==n?void 0:n.title)||f,v=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let b;return b=null!=u&&u.icon?(0,a.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):v?(0,a.createElement)(Cr,{icon:b_,size:32}):(0,a.createElement)(Cr,{icon:i_}),(0,a.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":m,"is-fetching":!!d,"is-preview":!0,"is-error":v})},(0,a.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,a.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,a.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},b),(0,a.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,a.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,h.__)("Link is empty")):(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Zr.__unstableStripHTML)(g)),(null==n?void 0:n.url)&&(0,a.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,a.createElement)(p.Button,{icon:k_,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,a.createElement)(p.Button,{icon:mh,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,a.createElement)(__,{fillProps:n})),(m&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,a.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,a.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,a.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,a.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,a.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}const S_=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 B_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=c_,onChange:s=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:g,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:w=!1,hasTextControl:S=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,a.useRef)(!0),x=(0,a.useRef)(),T=(0,a.useRef)(),[N,P]=(0,a.useState)((null==l?void 0:l.url)||""),[M,R]=(0,a.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,a.useState)(void 0!==v?v:!l||!l.url),O=(0,a.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,a.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,a.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(Zr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A]),(0,a.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage:G}=function(e){const t=(0,a.useRef)(),[n,o]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null);return(0,a.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=S_(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,h.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||s({url:L,title:M}),z()},W=d&&l&&!A&&!H,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&S;return(0,a.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},H&&(0,a.createElement)("div",{className:"block-editor-link-control__loading"},(0,a.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(A||!l)&&!H&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,a.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==xc.ENTER||F||(e.preventDefault(),U())}}),(0,a.createElement)(v_,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:V,onChange:P,onSelect:e=>{s({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:g,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,a.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,a.createElement)(p.Button,{onClick:U,label:(0,h.__)("Submit"),icon:Jk,className:"block-editor-link-control__search-submit",disabled:F})))),G&&(0,a.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),l&&!A&&!H&&(0,a.createElement)(w_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:w,hasUnlinkControl:W,onRemove:d}),$&&(0,a.createElement)("div",{className:"block-editor-link-control__tools"},(0,a.createElement)(e_,{value:l,settings:i,onChange:s})),B&&B())}B_.ViewerFill=y_;var I_=B_;var x_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 T_=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 N_=(0,p.withFilters)("editor.MediaUpload")((()=>null));var P_=function(e){let{fallback:t=null,children:n}=e;const o=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return!!t().mediaUpload}),[]);return o?n:t};var M_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Od.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:s,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:g=(0,h.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,w]=(0,a.useState)(t),S=(0,m.useSelect)((e=>e(Kn).getSettings().mediaUpload),[]),B=(0,a.useRef)(),I=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),x=e=>{const t=(0,Zr.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:I,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),w(null==e?void 0:e.url),s(e),(0,At.speak)((0,h.__)("The media file has been replaced")),b(I)},N=e=>{e.keyCode===xc.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,a.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,a.createElement)(p.ToolbarButton,{ref:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:N},g)},renderContent:e=>{let{onClose:t}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,a.createElement)(N_,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,a.createElement)(p.MenuItem,{icon:x_,onClick:t},(0,h.__)("Open Media Library"))}}),(0,a.createElement)(P_,null,(0,a.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),s(n);d(n),S({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:x})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,a.createElement)(p.MenuItem,{icon:T_,onClick:()=>{t()}},(0,h.__)("Upload"))}})),k),c&&(0,a.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,a.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,h.__)("Current media URL:")),(0,a.createElement)(I_,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;w(t),c(t),B.current.focus()}})))}})}));function R_(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,a.createElement)(p.ExternalLink,{className:r,href:t},n||(0,dp.filterURLForDisplay)((0,dp.safeDecodeURI)(t))):(0,a.createElement)("span",{className:r})}function L_(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...s}=e;const[c,u]=(0,a.useState)(!1),d=!!o&&c;return(0,a.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},s),(0,a.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,a.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,a.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Xp,label:(0,h.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,a.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,a.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}L_.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,a.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,a.createElement)(r_,{value:r,onChange:o,autocompleteRef:t}),(0,a.createElement)(p.Button,{icon:Jk,label:(0,h.__)("Apply"),type:"submit"}))},L_.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...s}=e;return(0,a.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},s),(0,a.createElement)(R_,{url:r,urlLabel:l,className:n}),o&&(0,a.createElement)(p.Button,{icon:k_,label:(0,h.__)("Edit"),onClick:o}))};var A_=L_;const D_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,a.createElement)(A_,{onClose:r},(0,a.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,a.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Jk,label:(0,h.__)("Apply"),type:"submit"})))};var O_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:s,isAppender:d,accept:f,addToGallery:g,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:w,onDoubleClick:S,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,onClose:x=u.noop,children:T,mediaLibraryButton:N,placeholder:P,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Kn);return t().mediaUpload}),[]),[L,A]=(0,a.useState)(""),[D,O]=(0,a.useState)(!1);(0,a.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&w&&(w(L),V())},G=e=>{if(!b)return E(e);let o;if(B(e),v)if(g){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)}))));E(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=E;else o=e=>{let[t]=e;return E(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},U=e=>{G(e.target.files)},W=null!=P?P:e=>{let{instructions:t,title:u}=l;if(R||w||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,a=r&&"video"===o;void 0===t&&R&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,h.__)("Media"),l?u=(0,h.__)("Audio"):i?u=(0,h.__)("Image"):a&&(u=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,a.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:s,onDoubleClick:S,preview:i,style:M},e,T)},$=()=>k?null:(0,a.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:I}),j=()=>C&&(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:C},(0,h.__)("Cancel")),K=()=>w&&(0,a.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,a.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:D,variant:"tertiary"},(0,h.__)("Insert from URL")),D&&(0,a.createElement)(D_,{src:L,onChange:F,onSubmit:H,onClose:V}));return _?(0,a.createElement)(P_,null,$()):(0,a.createElement)(P_,{fallback:W(K())},(()=>{const e=null!=N?N:e=>{let{open:t}=e;return(0,a.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,a.createElement)(N_,{addToGallery:g,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,onClose:x,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(R&&d)return(0,a.createElement)(a.Fragment,null,$(),(0,a.createElement)(p.FormFileUpload,{onChange:U,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,K(),j());return W(n)}}));if(R){const e=(0,a.createElement)(a.Fragment,null,$(),(0,a.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:f,multiple:v},(0,h.__)("Upload")),o,K(),j());return W(e)}return W(o)})())}));var F_=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,a.createElement)(gk,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const z_={position:"bottom right",isAlternate:!0};var V_=()=>(0,a.createElement)(a.Fragment,null,["bold","italic","link"].map((e=>(0,a.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,a.createElement)(p.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,a.createElement)(p.ToolbarItem,null,(n=>(0,a.createElement)(p.DropdownMenu,{icon:Xp,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:z_})))})));var H_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,a.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,a.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,a.createElement)(p.ToolbarGroup,null,(0,a.createElement)(V_,null)))):(0,a.createElement)(oo,{group:"inline"},(0,a.createElement)(V_,null))};function G_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Kn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==xc.DELETE&&o!==xc.BACKSPACE&&o!==xc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function U_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Am.createBlobURL)(e)}">`)).join("")}var W_=window.wp.shortcode;function $_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function j_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function K_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?K_.EMPTY_ARRAY:t||n?t||(Ft()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}K_.EMPTY_ARRAY=[];function q_(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=(0,Dt.split)(c),m=n.length>0;let f=-1;const h=(0,Dt.isEmpty)(d)&&!(0,Dt.isEmpty)(p);m&&(0,Dt.isEmpty)(d)||(u.push(r((0,Dt.toHTMLString)({value:d,multilineTag:i}),!h)),f+=1),m?(u.push(...n),f+=n.length):l&&u.push(l()),(m||l)&&(0,Dt.isEmpty)(p)||u.push(r((0,Dt.toHTMLString)({value:p,multilineTag:i}),h));o(u,m?f:1,m?-1:0)}function Y_(e,t){return t?(0,Dt.replace)(e,/\n+/g,Dt.__UNSTABLE_LINE_SEPARATOR):(0,Dt.replace)(e,new RegExp(Dt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Q_(e){const t=(0,a.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:a,tagName:s,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:h}=t.current;if(!n)return;const{clipboardData:g}=e;let v="",b="";try{v=g.getData("text/plain"),b=g.getData("text/html")}catch(e){try{b=g.getData("Text")}catch(e){return}}if(b=function(e){const t=/.*<!--StartFragment-->/s,n=/<!--EndFragment-->.*/s;return e.replace(t,"").replace(n,"")}(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 l((0,Dt.insert)(i,v));const k=a.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,Zr.getFilesFromDataTransfer)(g)];if("true"===g.getData("rich-text")){const e=g.getData("rich-text-multi-line-tag")||void 0;let t=(0,Dt.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=Y_(t,!!m),$_(t,i.activeFormats),void l((0,Dt.insert)(i,t))}if(h)return void l((0,Dt.insert)(i,(0,Dt.create)({text:v})));if(null!=_&&_.length&&!Dm(_,b)){const e=(0,r.pasteHandler)({HTML:U_(_),mode:"BLOCKS",tagName:s,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Dt.isEmpty)(i)?c(e):q_({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Dt.isEmpty)(i)&&(E=v,(0,W_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Dt.isEmpty)(i)&&(0,dp.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:s,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Dt.create)({html:C});e=Y_(e,!!m),$_(e,i.activeFormats),l((0,Dt.insert)(i,e))}else C.length>0&&(c&&(0,Dt.isEmpty)(i)?c(C,C.length-1,-1):q_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function X_(e){let t=e.length;for(;t--;){const n=(0,u.findKey)(e[t].attributes,(e=>"string"==typeof e&&-1!==e.indexOf("†")));if(n)return e[t].attributes[n]=e[t].attributes[n].replace("†",""),e[t].clientId;const o=X_(e[t].innerBlocks);if(o)return o}}function Z_(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Kn),o=(0,a.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:a}=e;if(" "!==a.slice(i-1,i))return;const s=a.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return s===t}));if(!u)return;const d=(0,Dt.toHTMLString)({value:(0,Dt.insert)(e,"†",0,i)}),p=u.transform(d);l(X_([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();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,Dt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮")}(a));d!==a&&(t(),s({...d,activeFormats:a.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function J_(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Kn),n=(0,a.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==xc.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&a;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Dt.insert)(m,"\n")):f&&(0,Dt.__unstableIsEmptyLine)(m)?q_({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c}):u((0,Dt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Dt.insert)(m,"\n")):!f&&r?p():f&&q_({value:m,onReplace:i,onSplit:a,onSplitMiddle:s,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function ey(e){return e(Dt.store).getFormatTypes()}const ty=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function ny(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function oy(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function ry(){const{isMultiSelecting:e}=(0,m.useSelect)(Kn);return(0,d.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 ly(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,Dt.getActiveFormat)(r,t);let c=void 0!==s;const d=(0,Dt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Dt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,a.createElement)(i,{key:t,isActive:c,activeAttributes:c&&s.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const iy=(0,a.createContext)(),ay=(0,a.createContext)();const sy=(0,a.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:s="",onChange:f,isSelected:h,multiline:g,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:w,onRemove:S,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,a.useRef)(),{clientId:H}=Xn(),{selectionStart:G,selectionEnd:U,isSelected:W}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(Kn),o=t(),r=n();let l;return void 0===h?l=o.clientId===H&&r.clientId===H&&o.attributeKey===N:h&&(l=o.clientId===H),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:$}=(0,m.useDispatch)(Kn),j=j_(g),K=K_({allowedFormats:E,formattingControls:C,disableFormats:L}),q=!K||K.length>0;let Y=s,Q=f;Array.isArray(s)&&(Y=r.children.toHTML(s),Q=e=>f(r.children.fromDOM((0,Dt.__unstableCreateElement)(document,e).childNodes)));const X=(0,a.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:H,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:H,attributeKey:N,offset:t}),$(n)}),[H,N]),{formatTypes:Z,prepareHandlers:J,valueHandlers:ee,changeHandlers:te,dependencies:ne}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(ey,[]),i=(0,a.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&ty.has(n))}))),[l,r,ty]),s=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=s[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...s[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:w,allowedFormats:K});function oe(e){return Z.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Dt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:re,onChange:le,ref:ie}=(0,Dt.__unstableUseRichText)({value:Y,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Q(e),Object.values(te).forEach((e=>{e(n,o)}))},selectionStart:G,selectionEnd:U,onSelectionChange:X,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:j,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...ne,l],__unstableAfterParse:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:oe,__unstableAddInvisibleFormats:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:tb(e)})}({onReplace:_,completers:k,record:re,onChange:le});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(Kn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(Kn);(0,a.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:re}),function(e){let{html:t,value:n}=e;const o=(0,a.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(Kn);(0,a.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:Y,value:re});const se=(0,a.useRef)(new Set),ce=(0,a.useRef)(new Set);function ue(){V.current.focus()}const de=l,pe=(0,a.createElement)(a.Fragment,null,W&&(0,a.createElement)(iy.Provider,{value:se},(0,a.createElement)(ay.Provider,{value:ce},(0,a.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:re,onChange:le,onFocus:ue}),(0,a.createElement)(ly,{value:re,onChange:le,onFocus:ue,formatTypes:Z,forwardedRef:V})))),W&&q&&(0,a.createElement)(H_,{inline:v,anchorRef:V.current}),(0,a.createElement)(de,i({role:"textbox","aria-multiline":!A,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([n,ae.ref,F.ref,ie,Z_({value:re,onChange:le,__unstableAllowPrefixTransformations:O,formatTypes:Z,onReplace:_,selectionChange:$}),(0,d.useRefEffect)((e=>{function t(e){(xc.isKeyboardEvent.primary(e,"z")||xc.isKeyboardEvent.primary(e,"y")||xc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),ny(se),oy(ce),G_(),Q_({isSelected:W,disableFormats:L,onChange:le,value:re,formatTypes:Z,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:j,preserveWhiteSpace:P,pastePlainText:M}),J_({removeEditorOnlyFormats:oe,value:re,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:j,onChange:le,disableLineBreaks:A,onSplitAtEnd:x}),ry(),V]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===xc.DELETE||t===xc.BACKSPACE)){const{start:n,end:o,text:r}=re,l=t===xc.BACKSPACE,i=re.activeFormats&&!!re.activeFormats.length;if(!(0,Dt.isCollapsed)(re)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),S&&(0,Dt.isEmpty)(re)&&l&&S(!l),e.preventDefault()}}})));if(!b)return pe;Ft()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const me=c()("block-editor-rich-text",b);return(0,a.createElement)("div",{className:me},pe)}));sy.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=j_(o);!t&&i&&(t=`<${i}></${i}>`);const s=(0,a.createElement)(a.RawHTML,null,t);return n?(0,a.createElement)(n,(0,u.omit)(l,["format"]),s):s},sy.isEmpty=e=>!e||0===e.length;var cy=sy;const uy=(0,a.forwardRef)(((e,t)=>(0,a.createElement)(cy,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));uy.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,a.createElement)(n,o,t)};var dy=uy;var py=(0,a.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,a.createElement)(dy,i({ref:t},o));const{className:r,onChange:l,...s}=o;return(0,a.createElement)(gl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},s))}));function my(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(my),l=o||(0,h.sprintf)((0,h._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,a.createElement)(a.Fragment,null,(0,a.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,a.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var fy=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:s=!1,defaultLabel:u={id:"all",label:(0,h.__)("All")},viewports:d=[{id:"small",label:(0,h.__)("Small screens")},{id:"medium",label:(0,h.__)("Medium screens")},{id:"large",label:(0,h.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,h.sprintf)((0,h.__)("Use the same %s on all screensizes."),n),f=(0,h.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,a.createElement)(my,{property:n,viewport:u}),u);return(0,a.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,a.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,a.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,a.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!s,onChange:r,help:f}),(0,a.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":s})},!s&&g,s&&(i?i(d):d.map((e=>(0,a.createElement)(a.Fragment,{key:e.id},l((0,a.createElement)(my,{property:n,viewport:e}),e))))))))};function hy(e){let{character:t,type:n,onUse:o}=e;const r=(0,a.useContext)(iy),l=(0,a.useRef)();return l.current=o,(0,a.useEffect)((()=>{function e(e){xc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function gy(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,s="RichText.ToolbarControls";return n&&(s+=`.${n}`),o&&r&&(t=xc.displayShortcut[o](r)),(0,a.createElement)(p.Fill,{name:s},(0,a.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function vy(e){let{inputType:t,onInput:n}=e;const o=(0,a.useContext)(ay),r=(0,a.useRef)();return r.current=n,(0,a.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const by=(0,a.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,a.createElement)(p.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 ky=(0,a.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Kn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Kn),r=e=>{o("edit"!==e)};return(0,a.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,a.createElement)(p.Button,i({},e,{ref:t,icon:n?by:k_,"aria-expanded":r,"aria-haspopup":"true",onClick:l,label:(0,h.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,h.__)("Tools")},(0,a.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Cr,{icon:k_}),(0,h.__)("Edit"))},{value:"select",label:(0,a.createElement)(a.Fragment,null,by,(0,h.__)("Select"))}]})),(0,a.createElement)("div",{className:"block-editor-tool-selector__help"},(0,h.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function _y(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:Bo("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,a.createElement)(p.__experimentalUnitControl,i({units:o},n))}var yy=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class Ey extends a.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,h.__)("Edit link"):(0,h.__)("Insert link");return(0,a.createElement)("div",{className:"block-editor-url-input__button"},(0,a.createElement)(p.Button,{icon:ph,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,a.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,a.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,a.createElement)(p.Button,{className:"block-editor-url-input__back",icon:yy,label:(0,h.__)("Close"),onClick:this.toggle}),(0,a.createElement)(r_,{value:e||"",onChange:t}),(0,a.createElement)(p.Button,{icon:Jk,label:(0,h.__)("Submit"),type:"submit"}))))}}var Cy=Ey;var wy=(0,a.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(O.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 Sy="none",By="custom",Iy="media",xy="attachment",Ty=["noreferrer","noopener"],Ny=(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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,a.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),Py=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:s,linkClass:c,rel:d}=e;const[m,f]=(0,a.useState)(!1),g=(0,a.useCallback)((()=>{f(!0)})),[v,b]=(0,a.useState)(!1),[k,_]=(0,a.useState)(null),y=(0,a.useRef)(null),E=(0,a.useCallback)((()=>{t!==Iy&&t!==xy||_(""),b(!0)})),C=(0,a.useCallback)((()=>{b(!1)})),w=(0,a.useCallback)((()=>{_(null),C(),f(!1)})),S=(0,a.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),B=(0,a.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||By;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,a.useCallback)((()=>{n({linkDestination:Sy,href:""})})),x=()=>{const e=[{linkDestination:Iy,title:(0,h.__)("Media File"),url:"image"===r?l:void 0,icon:Ny}];return"image"===r&&i&&e.push({linkDestination:xy,title:(0,h.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,a.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,a.createElement)(p.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},T=(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToggleControl,{label:(0,h.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");Ty.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===Ty.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===s}),(0,a.createElement)(p.TextControl,{label:(0,h.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,a.createElement)(p.TextControl,{label:(0,h.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.ToolbarButton,{icon:ph,className:"components-toolbar__control",label:o?(0,h.__)("Edit link"):(0,h.__)("Insert link"),"aria-expanded":m,onClick:g}),m&&(0,a.createElement)(A_,{onFocusOutside:S(),onClose:w,renderSettings:()=>T,additionalControls:!N&&(0,a.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,a.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:By}).linkDestination:Sy,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,a.createElement)(A_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(A_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,a.createElement)(p.Button,{icon:wy,label:(0,h.__)("Remove link"),onClick:I}))))};function My(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},s={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,children:(0,h.__)("Preview")};return(0,a.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:s,icon:null},(()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(p.MenuGroup,null,(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&fm},(0,h.__)("Desktop")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&fm},(0,h.__)("Tablet")),(0,a.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&fm},(0,h.__)("Mobile"))),t)))}function Ry(e){const[t,n]=(0,a.useState)(window.innerWidth);(0,a.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 Ly=(0,m.withSelect)((e=>({selectedBlockClientId:e(Kn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=yo(t);return t?(0,a.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,h.__)("Skip to the selected block")):null})),Ay=window.wp.wordcount;var Dy=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Kn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,Ay.count)((0,r.serialize)(t),"words");return(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,a.createElement)(Uc,{icon:dm,showColors:!0}),(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,h.sprintf)((0,h._n)("%d block","%d blocks",t.length),t.length)),(0,a.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,h.sprintf)((0,h._n)("%d word","%d words",n),n))))}));function Oy(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(Kn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,a.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),s=(0,a.useMemo)((()=>{var e;return null===(e=bm(l))||void 0===e?void 0:e.name}),[l]),c=(0,a.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==s?o&&(0,a.createElement)("div",{className:"default-style-picker__default-switcher"},(0,a.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const Fy=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Vp(t);return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Wc,l),(0,a.createElement)(tk,{blockClientId:t}),o&&(0,a.createElement)("div",null,(0,a.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,a.createElement)(zb,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,a.createElement)(Oy,{blockName:n}))),(0,a.createElement)(Fo.Slot,null),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,a.createElement)("div",null,(0,a.createElement)(zy,null)),(0,a.createElement)(Ly,{key:"back"}))},zy=()=>{const e=(0,p.__experimentalUseSlot)(Oo.slotName);return Boolean(e.fills&&e.fills.length)?(0,a.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,a.createElement)(Fo.Slot,{__experimentalGroup:"advanced"})):null};var Vy=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:s}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Kn),{getBlockStyles:l}=e(r.store),i=t(),a=i&&o(i),s=a&&(0,r.getBlockType)(a),c=a&&l(a);return{count:n(),selectedBlockClientId:i,selectedBlockName:a,blockType:s,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,a.createElement)("div",{className:"block-editor-block-inspector"},(0,a.createElement)(Dy,null),(0,a.createElement)(Fo.Slot,null),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"color",label:(0,h.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,a.createElement)(Fo.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return s&&i&&!c?(0,a.createElement)(Fy,{clientId:i,blockName:s.name,hasBlockStyles:o}):t?(0,a.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function Hy(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(Kn).getSettings().hasFixedToolbar),[]),s=(0,eu.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(Kn),{duplicateBlocks:h,removeBlocks:g,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(Kn);return(0,a.createElement)("div",i({},o,{onKeyDown:function(e){if(s("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(s("core/block-editor/unselect",e)){c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}}),(0,a.createElement)(Dp,{__unstableContentRef:n},(l||!r)&&(0,a.createElement)(gf,{isFixed:!0}),(0,a.createElement)(_f,{__unstableContentRef:n}),(0,a.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Rp(n)}),t,(0,a.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Rp(n)})))}var Gy=(0,a.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:s,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(Kn);return n||t(o)||void 0}),[o,n]);return(0,a.createElement)(Cp,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:s,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function Uy(){return null}Uy.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(eu.store);return(0,a.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("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,h.__)("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,h.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("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,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var Wy=Uy;function $y(){return Ft()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const jy=new Set([xc.UP,xc.RIGHT,xc.DOWN,xc.LEFT,xc.ENTER,xc.BACKSPACE]);function Ky(){const e=(0,m.useSelect)((e=>e(Kn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Kn);return(0,d.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 qy(){const e=(0,m.useSelect)((e=>e(Kn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Kn),o=Ky(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let a;function s(e){const{target:t}=e;a=l.setTimeout((()=>{(0,Zr.isTextField)(t)||n()}))}function c(e){const{keyCode:t}=e;t!==xc.ESCAPE&&t!==xc.TAB||n()}function u(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",s),o.addEventListener("keydown",c),r.addEventListener("selectionchange",u),()=>{l.clearTimeout(a),o.removeEventListener("focus",s),o.removeEventListener("keydown",c),r.removeEventListener("selectionchange",u)}}function i(e){const{type:n,target:r}=e;(0,Zr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&jy.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var Yy=function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:qy()},t)};const Qy=-1!==window.navigator.userAgent.indexOf("Trident"),Xy=new Set([xc.UP,xc.DOWN,xc.LEFT,xc.RIGHT]);function Zy(){const e=(0,m.useSelect)((e=>e(Kn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function a(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function s(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,Zr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(Xy.has(r))return void(i=l);const a=l.top-i.top;if(0===a)return;const s=(0,Zr.getScrollContainer)(t);if(!s)return;const c=s===n.body,u=c?o.scrollY:s.scrollTop,d=c?0:s.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 f=c?o.innerHeight:s.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,a):s.scrollTop+=a}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,Zr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",a,!0),o.addEventListener("resize",a,!0),t.addEventListener("keydown",s),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",a,!0),o.removeEventListener("resize",a,!0),t.removeEventListener("keydown",s),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var Jy=Qy?e=>e.children:function(e){let{children:t}=e;return(0,a.createElement)("div",{ref:Zy(),className:"block-editor__typewriter"},t)};const eE=(0,a.createContext)({});function tE(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function nE(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,a.useContext)(eE),{name:r}=Xn();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,a.useMemo)((()=>tE(o,n,e)),[o,n,e]),s=(0,a.useCallback)((e=>{let{children:t}=e;return(0,a.createElement)(eE.Provider,{value:i},t)}),[i]);return[l,s]}const oE=(e,t)=>{if(!t||!e)return;const n=t.filter((t=>{let{attributes:n}=t;return!(!n||!Object.keys(n).length)&&(0,u.isMatch)(e,n)}));return 1===n.length?n[0]:void 0};function rE(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 lE(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>rE(uE(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 iE(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=lE(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return rE(e)}function aE(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function sE(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=rE(uE(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 cE(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 uE(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=rE(e);return n.unit||(n=iE(e)),aE(e)&&!n.unit?sE(e):cE(n,t)}const dE={};function pE(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 mE=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+pE(t);return dE[n]||(dE[n]=uE(e,t)),dE[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();