diff options
Diffstat (limited to 'wp-includes/js/dist/block-editor.min.js')
-rw-r--r-- | wp-includes/js/dist/block-editor.min.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wp-includes/js/dist/block-editor.min.js b/wp-includes/js/dist/block-editor.min.js index d31b0a1..e3800c0 100644 --- a/wp-includes/js/dist/block-editor.min.js +++ b/wp-includes/js/dist/block-editor.min.js @@ -1,15 +1,15 @@ /*! This file is auto-generated */ -!function(){var e={6411:function(e,t){var n,o,r; +(()=>{var e={4306: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; +*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&p()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:p}),a()}function a(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},5755:(e,t)=>{var n; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)o.call(n,a)&&n[a]&&e.push(a)}}}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}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]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var l=this;function i(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,s=e.length,c=1,u=a+s,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=a&&p+1>=s)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*c;n<=c;n+=2){var r=void 0,u=d[n-1],p=d[n+1],m=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var f=u&&u.newPos+1<a,g=p&&0<=m&&m<s;if(f||g){if(!f||g&&u.newPos<p.newPos?(r={newPos:(h=p).newPos,components:h.components.slice(0)},l.pushComponent(r.components,void 0,!0)):((r=u).newPos++,l.pushComponent(r.components,!0,void 0)),m=l.extractCommon(r,t,e,n),r.newPos+1>=a&&m+1>=s)return i(o(l,r.components,t,e,l.useLongestToken));d[n]=r}else d[n]=void 0}var h;c++}if(r)!function e(){setTimeout((function(){if(c>u)return r();m()||e()}),0)}();else for(;c<=u;){var f=m();if(f)return f}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,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),g=o.outerWidth(e),h=void 0,b=void 0,v=void 0,_=void 0,k=void 0,y=void 0,E=void 0,w=void 0,S=void 0,C=void 0;p?(E=t,C=o.height(E),S=o.width(E),w={left:o.scrollLeft(E),top:o.scrollTop(E)},k={left:m.left-w.left-c,top:m.top-w.top-s},y={left:m.left+g-(w.left+S)+d,top:m.top+f-(w.top+C)+u},_=w):(h=o.offset(t),b=t.clientHeight,v=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},k={left:m.left-(h.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(h.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-s},y={left:m.left+g-(h.left+v+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+f-(h.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),k.top<0||y.top>0?!0===i?o.scrollTop(t,_.top+k.top):!1===i?o.scrollTop(t,_.top+y.top):k.top<0?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+k.top):o.scrollTop(t,_.top+y.top)),r&&(k.left<0||y.left>0?!0===a?o.scrollLeft(t,_.left+k.left):!1===a?o.scrollLeft(t,_.left+y.left):k.left<0?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left):l||((a=void 0===a||!!a)?o.scrollLeft(t,_.left+k.left):o.scrollLeft(t,_.left+y.left)))}},5425:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var a=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),s=/^(top|right|bottom|left)$/,c="currentStyle",u="runtimeStyle",d="left";var p=void 0;function m(e,t){for(var n=0;n<e.length;n++)t(e[n])}function f(e){return"border-box"===p(e,"boxSizing")}"undefined"!=typeof window&&(p=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[c]&&e[c][t];if(a.test(n)&&!s.test(t)){var o=e.style,r=o[d],l=e[u][d];e[u][d]=e[c][d],o[d]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[d]=r,e[u][d]=l}return""===n?"auto":n});var g=["margin","border","padding"],h=-1,b=2,v=1;function _(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(p(e,a))||0}return o}function k(e){return null!=e&&e==e.window}var y={};function E(e,t,n){if(k(e))return"width"===t?y.viewportWidth(e):y.viewportHeight(e);if(9===e.nodeType)return"width"===t?y.docWidth(e):y.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(p(e),f(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=p(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?v:h);var a=void 0!==r||l,s=r||i;if(n===h)return a?s-_(e,["border","padding"],o):i;if(a){var c=n===b?-_(e,["border"],o):_(e,["margin"],o);return s+(n===v?0:c)}return i+_(e,g.slice(n),o)}m(["Width","Height"],(function(e){y["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],y["viewport"+e](n))},y["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 w={position:"absolute",visibility:"hidden",display:"block"};function S(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=E.apply(void 0,n):function(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])}(e,w,(function(){t=E.apply(void 0,n)})),t}function C(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)):p(e,t);for(var l in t)t.hasOwnProperty(l)&&C(e,l,t[l])}m(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);y["outer"+t]=function(t,n){return t&&S(t,e,n?0:v)};var n="width"===e?["Left","Right"]:["Top","Bottom"];y[e]=function(t,o){if(void 0===o)return t&&S(t,e,h);if(t){p(t);return f(t)&&(o+=_(t,["padding","border"],n)),C(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"===C(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(C(e,l))||0,o[l]=r+t[l]-n[l]);C(e,o)}(e,t)},isWindow:k,each:m,css:C,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(k(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(k(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},y)},5619:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,l;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,l[r]))return!1;for(r=o;0!=r--;){var i=l[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},9894:function(e,t,n){var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","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,g,h=!1;function b(){if(!h){h=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),v=/(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),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(e);i=_?parseFloat(_[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,o=b[3]?parseFloat(b[3]):NaN,(r=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=b&&b[1]?parseFloat(b[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(v){if(v[1]){var k=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!k||parseFloat(k[1].replace("_","."))}else a=!1;s=!!v[2],c=!!v[3]}else a=s=c=!1}}var v={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||i>t},ie64:function(){return v.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return v.webkit()},chrome:function(){return b()||l},windows:function(){return b()||s},osx:function(){return b()||a},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||m||u||g},nativeApp:function(){return b()||f},android:function(){return b()||u},ipad:function(){return b()||m}};e.exports=v},7939:function(e,t,n){"use strict";var o,r=n(3110);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) +*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},6109: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()}))]}},5417:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}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]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var l=this;function i(e){return r?(setTimeout((function(){r(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,a=e.length,c=1,u=s+a,d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=s&&p+1>=a)return i([{value:this.join(t),count:t.length}]);function m(){for(var n=-1*c;n<=c;n+=2){var r=void 0,u=d[n-1],p=d[n+1],m=(p?p.newPos:0)-n;u&&(d[n-1]=void 0);var h=u&&u.newPos+1<s,g=p&&0<=m&&m<a;if(h||g){if(!h||g&&u.newPos<p.newPos?(r={newPos:(f=p).newPos,components:f.components.slice(0)},l.pushComponent(r.components,void 0,!0)):((r=u).newPos++,l.pushComponent(r.components,!0,void 0)),m=l.extractCommon(r,t,e,n),r.newPos+1>=s&&m+1>=a)return i(o(l,r.components,t,e,l.useLongestToken));d[n]=r}else d[n]=void 0}var f;c++}if(r)!function e(){setTimeout((function(){if(c>u)return r();m()||e()}),0)}();else for(;c<=u;){var h=m();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},8021:(e,t,n)=>{"use strict";var o;t.JJ=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(5417))&&o.__esModule?o:{default:o}).default)},1637:(e,t,n)=>{"use strict";var o=n(3062);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=o.offset(e),h=o.outerHeight(e),g=o.outerWidth(e),f=void 0,b=void 0,v=void 0,k=void 0,_=void 0,y=void 0,E=void 0,w=void 0,S=void 0,C=void 0;p?(E=t,C=o.height(E),S=o.width(E),w={left:o.scrollLeft(E),top:o.scrollTop(E)},_={left:m.left-w.left-c,top:m.top-w.top-a},y={left:m.left+g-(w.left+S)+d,top:m.top+h-(w.top+C)+u},k=w):(f=o.offset(t),b=t.clientHeight,v=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},_={left:m.left-(f.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(f.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},y={left:m.left+g-(f.left+v+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+h-(f.top+b+(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===s?o.scrollLeft(t,k.left+_.left):!1===s?o.scrollLeft(t,k.left+y.left):_.left<0?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.left+y.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+_.left):o.scrollLeft(t,k.left+y.left)))}},5428:(e,t,n)=>{"use strict";e.exports=n(1637)},3062:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c="currentStyle",u="runtimeStyle",d="left";var p=void 0;function m(e,t){for(var n=0;n<e.length;n++)t(e[n])}function h(e){return"border-box"===p(e,"boxSizing")}"undefined"!=typeof window&&(p=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[c]&&e[c][t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o[d],l=e[u][d];e[u][d]=e[c][d],o[d]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[d]=r,e[u][d]=l}return""===n?"auto":n});var g=["margin","border","padding"],f=-1,b=2,v=1;function k(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s=void 0;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(p(e,s))||0}return o}function _(e){return null!=e&&e==e.window}var y={};function E(e,t,n){if(_(e))return"width"===t?y.viewportWidth(e):y.viewportHeight(e);if(9===e.nodeType)return"width"===t?y.docWidth(e):y.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(p(e),h(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=p(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?v:f);var s=void 0!==r||l,a=r||i;if(n===f)return s?a-k(e,["border","padding"],o):i;if(s){var c=n===b?-k(e,["border"],o):k(e,["margin"],o);return a+(n===v?0:c)}return i+k(e,g.slice(n),o)}m(["Width","Height"],(function(e){y["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],y["viewport"+e](n))},y["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 w={position:"absolute",visibility:"hidden",display:"block"};function S(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=E.apply(void 0,n):function(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])}(e,w,(function(){t=E.apply(void 0,n)})),t}function C(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)):p(e,t);for(var l in t)t.hasOwnProperty(l)&&C(e,l,t[l])}m(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);y["outer"+t]=function(t,n){return t&&S(t,e,n?0:v)};var n="width"===e?["Left","Right"]:["Top","Bottom"];y[e]=function(t,o){if(void 0===o)return t&&S(t,e,f);if(t){p(t);return h(t)&&(o+=k(t,["padding","border"],n)),C(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"===C(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(C(e,l))||0,o[l]=r+t[l]-n[l]);C(e,o)}(e,t)},isWindow:_,each:m,css:C,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(_(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(_(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},y)},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,l;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,l[r]))return!1;for(r=o;0!=r--;){var i=l[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},5215:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var o,r,l;if(Array.isArray(t)){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((o=(l=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,l[r]))return!1;for(r=o;0!=r--;){var i=l[r];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},461:(e,t,n)=>{var o=n(6109);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7520:(e,t,n)=>{e.exports=n(7191)},8202: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},2213:e=>{var t,n,o,r,l,i,s,a,c,u,d,p,m,h,g,f=!1;function b(){if(!f){f=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),v=/(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),h=/FBAN\/\w+;/i.exec(e),g=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(e);i=k?parseFloat(k[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,o=b[3]?parseFloat(b[3]):NaN,(r=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=b&&b[1]?parseFloat(b[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(v){if(v[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!_||parseFloat(_[1].replace("_","."))}else s=!1;a=!!v[2],c=!!v[3]}else s=a=c=!1}}var v={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||i>t},ie64:function(){return v.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||o},webkit:function(){return b()||r},safari:function(){return v.webkit()},chrome:function(){return b()||l},windows:function(){return b()||a},osx:function(){return b()||s},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||m||u||g},nativeApp:function(){return b()||h},android:function(){return b()||u},ipad:function(){return b()||m}};e.exports=v},1087:(e,t,n)=>{"use strict";var o,r=n(8202);r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")) /** * Checks if an event is supported in the current execution environment. * @@ -23,7 +23,7 @@ * @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},4793:function(e){var t={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ả":"A","Ạ":"A","Ẩ":"A","Ẫ":"A","Ậ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ẻ":"E","Ẽ":"E","Ẹ":"E","Ể":"E","Ễ":"E","Ệ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ỉ":"I","Ị":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ỏ":"O","Ọ":"O","Ổ":"O","Ỗ":"O","Ộ":"O","Ờ":"O","Ở":"O","Ỡ":"O","Ớ":"O","Ợ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ủ":"U","Ụ":"U","Ử":"U","Ữ":"U","Ự":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ả":"a","ạ":"a","ẩ":"a","ẫ":"a","ậ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ẻ":"e","ẽ":"e","ẹ":"e","ể":"e","ễ":"e","ệ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ỉ":"i","ị":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ỏ":"o","ọ":"o","ổ":"o","ỗ":"o","ộ":"o","ờ":"o","ở":"o","ỡ":"o","ớ":"o","ợ":"o","ù":"u","ú":"u","û":"u","ü":"u","ủ":"u","ụ":"u","ử":"u","ữ":"u","ự":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z","й":"и","Й":"И","ё":"е","Ё":"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function l(e){return t[e]}var i=function(e){return e.replace(o,l)};e.exports=i,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=i},3124:function(e){"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)}var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},l=Object.prototype.hasOwnProperty||function(e,t){return t in e};function i(e){if("object"==typeof e&&null!==e){var l;if(n(e))l=[];else if("[object Date]"===t(e))l=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===t(e)}(e))l=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))l={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))l=Object(e);else if(Object.create&&Object.getPrototypeOf)l=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)l={};else{var i=e.constructor&&e.constructor.prototype||e.__proto__||{},a=function(){};a.prototype=i,l=new a}return o(r(e),(function(t){l[t]=e[t]})),l}return e}function a(e,t,a){var s=[],c=[],u=!0;return function e(d){var p=a?i(d):d,m={},f=!0,g={node:p,node_:d,path:[].concat(s),parent:c[c.length-1],parents:c,key:s[s.length-1],isRoot:0===s.length,level:s.length,circular:null,update:function(e,t){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){n(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=r(g.node)),g.isLeaf=0===g.keys.length;for(var e=0;e<c.length;e++)if(c[e].node_===d){g.circular=c[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var b=t.call(g,g.node);return void 0!==b&&g.update&&g.update(b),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(c.push(g),h(),o(g.keys,(function(t,n){s.push(t),m.pre&&m.pre.call(g,g.node[t],t);var o=e(g.node[t]);a&&l.call(g.node,t)&&(g.node[t]=o.node),o.isLast=n===g.keys.length-1,o.isFirst=0===n,m.post&&m.post.call(g,o),s.pop()})),c.pop()),m.after&&m.after.call(g,g.node),g):g}(e).node}function s(e){this.value=e}function c(e){return new s(e)}s.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return;t=t[o]}return t},s.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!l.call(t,o))return!1;t=t[o]}return!0},s.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];l.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},s.prototype.map=function(e){return a(this.value,e,!0)},s.prototype.forEach=function(e){return this.value=a(this.value,e,!1),this.value},s.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},s.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},s.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},s.prototype.clone=function(){var e=[],t=[];return function n(l){for(var a=0;a<e.length;a++)if(e[a]===l)return t[a];if("object"==typeof l&&null!==l){var s=i(l);return e.push(l),t.push(s),o(r(l),(function(e){s[e]=n(l[e])})),e.pop(),t.pop(),s}return l}(this.value)},o(r(s.prototype),(function(e){c[e]=function(t){var n=[].slice.call(arguments,1),o=new s(t);return o[e].apply(o,n)}})),e.exports=c},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return qE},AlignmentToolbar:function(){return ZE},Autocomplete:function(){return rw},BlockAlignmentControl:function(){return Ni},BlockAlignmentToolbar:function(){return Li},BlockBreadcrumb:function(){return dw},BlockCanvas:function(){return bw},BlockColorsStyleSelector:function(){return yw},BlockContextProvider:function(){return ma},BlockControls:function(){return dr},BlockEdit:function(){return va},BlockEditorKeyboardShortcuts:function(){return ap},BlockEditorProvider:function(){return cp},BlockFormatControls:function(){return ur},BlockIcon:function(){return ep},BlockInspector:function(){return fI},BlockList:function(){return vh},BlockMover:function(){return gI},BlockNavigationDropdown:function(){return OS},BlockPreview:function(){return Am},BlockSelectionClearer:function(){return dp},BlockSettingsMenu:function(){return hI},BlockSettingsMenuControls:function(){return fE},BlockStyles:function(){return $S},BlockTitle:function(){return uw},BlockToolbar:function(){return $I},BlockTools:function(){return aT},BlockVerticalAlignmentControl:function(){return Yr},BlockVerticalAlignmentToolbar:function(){return Xr},ButtonBlockAppender:function(){return Ng},ButtonBlockerAppender:function(){return Pg},ColorPalette:function(){return mC},ColorPaletteControl:function(){return fC},ContrastChecker:function(){return $v},CopyHandler:function(){return gw},DefaultBlockAppender:function(){return Tg},FontSizePicker:function(){return zE},HeadingLevelDropdown:function(){return ZS},HeightControl:function(){return kk},InnerBlocks:function(){return ch},Inserter:function(){return Ig},InspectorAdvancedControls:function(){return ra},InspectorControls:function(){return la},JustifyContentControl:function(){return el},JustifyToolbar:function(){return tl},LineHeightControl:function(){return p_},MediaPlaceholder:function(){return fx},MediaReplaceFlow:function(){return Bb},MediaUpload:function(){return ug},MediaUploadCheck:function(){return cg},MultiSelectScrollIntoView:function(){return uT},NavigableToolbar:function(){return kx},ObserveTyping:function(){return mh},PanelColorSettings:function(){return gx},PlainText:function(){return iB},ReusableBlocksRenameHint:function(){return MT},RichText:function(){return oB},RichTextShortcut:function(){return cB},RichTextToolbarButton:function(){return uB},SETTINGS_DEFAULTS:function(){return k},SkipToSelectedBlock:function(){return AB},ToolSelector:function(){return mB},Typewriter:function(){return gT},URLInput:function(){return Rh},URLInputButton:function(){return bB},URLPopover:function(){return ux},Warning:function(){return ka},WritingFlow:function(){return Sp},__experimentalBlockAlignmentMatrixControl:function(){return sw},__experimentalBlockFullHeightAligmentControl:function(){return iw},__experimentalBlockPatternSetup:function(){return sC},__experimentalBlockPatternsList:function(){return rf},__experimentalBlockVariationPicker:function(){return XS},__experimentalBlockVariationTransforms:function(){return dC},__experimentalBorderRadiusControl:function(){return Xb},__experimentalColorGradientControl:function(){return Tv},__experimentalColorGradientSettingsDropdown:function(){return EC},__experimentalDateFormatPicker:function(){return bC},__experimentalDuotoneControl:function(){return iy},__experimentalFontAppearanceControl:function(){return u_},__experimentalFontFamilyControl:function(){return i_},__experimentalGetBorderClassesAndStyles:function(){return SE},__experimentalGetColorClassesAndStyles:function(){return xE},__experimentalGetElementClassName:function(){return NT},__experimentalGetGapCSSValue:function(){return Hr},__experimentalGetGradientClass:function(){return vv},__experimentalGetGradientObjectByGradientValue:function(){return kv},__experimentalGetMatchingVariation:function(){return RT},__experimentalGetSpacingClassesAndStyles:function(){return TE},__experimentalImageEditor:function(){return ox},__experimentalImageSizeControl:function(){return ix},__experimentalImageURLInputUI:function(){return CB},__experimentalInspectorPopoverHeader:function(){return kT},__experimentalLetterSpacingControl:function(){return m_},__experimentalLibrary:function(){return cT},__experimentalLinkControl:function(){return Sb},__experimentalLinkControlSearchInput:function(){return sb},__experimentalLinkControlSearchItem:function(){return Kh},__experimentalLinkControlSearchResults:function(){return eb},__experimentalListView:function(){return AS},__experimentalPanelColorGradientSettings:function(){return xC},__experimentalPreviewOptions:function(){return LB},__experimentalPublishDateTimePicker:function(){return yT},__experimentalRecursionProvider:function(){return bT},__experimentalResponsiveBlockControl:function(){return sB},__experimentalSpacingSizesControl:function(){return vk},__experimentalTextDecorationControl:function(){return w_},__experimentalTextTransformControl:function(){return __},__experimentalUnitControl:function(){return fB},__experimentalUseBlockOverlayActive:function(){return Fd},__experimentalUseBlockPreview:function(){return Dm},__experimentalUseBorderProps:function(){return CE},__experimentalUseColorProps:function(){return IE},__experimentalUseCustomSides:function(){return Wk},__experimentalUseGradient:function(){return Ev},__experimentalUseHasRecursion:function(){return vT},__experimentalUseMultipleOriginColorsAndGradients:function(){return Ob},__experimentalUseResizeCanvas:function(){return RB},__experimentalWritingModeControl:function(){return B_},__unstableBlockNameContext:function(){return TB},__unstableBlockSettingsMenuFirstItem:function(){return wS},__unstableBlockToolbarLastItem:function(){return IB},__unstableEditorStyles:function(){return Mm},__unstableIframe:function(){return Ip},__unstableInserterMenuExtension:function(){return gg},__unstableRichTextInputEvent:function(){return dB},__unstableUseBlockSelectionClearer:function(){return up},__unstableUseClipboardHandler:function(){return fw},__unstableUseMouseMoveTypingReset:function(){return dh},__unstableUseTypewriter:function(){return fT},__unstableUseTypingObserver:function(){return ph},createCustomColorsHOC:function(){return DE},getColorClassName:function(){return Db},getColorObjectByAttributeValues:function(){return Rb},getColorObjectByColorValue:function(){return Ab},getComputedFluidTypographyValue:function(){return Sl},getCustomValueFromPreset:function(){return Dr},getFontSize:function(){return q_},getFontSizeClass:function(){return Y_},getFontSizeObjectByValue:function(){return Z_},getGradientSlugByValue:function(){return yv},getGradientValueBySlug:function(){return _v},getPxFromCssUnit:function(){return GT},getSpacingPresetCssVar:function(){return zr},getTypographyClassesAndStyles:function(){return ME},isValueSpacingPreset:function(){return Ar},privateApis:function(){return lN},store:function(){return Jo},storeConfig:function(){return Qo},transformStyles:function(){return Im},useBlockCommands:function(){return IT},useBlockDisplayInformation:function(){return Iy},useBlockEditContext:function(){return rr},useBlockEditingMode:function(){return Ai},useBlockProps:function(){return Gd},useCachedTruthy:function(){return PE},useInnerBlocksProps:function(){return sh},useSetting:function(){return bl},withColorContext:function(){return pC},withColors:function(){return OE},withFontSizes:function(){return HE}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Jt},__experimentalGetAllowedBlocks:function(){return It},__experimentalGetAllowedPatterns:function(){return At},__experimentalGetBlockListSettingsForBlocks:function(){return Gt},__experimentalGetDirectInsertBlock:function(){return Mt},__experimentalGetGlobalBlocksByName:function(){return ae},__experimentalGetLastBlockAttributeChanges:function(){return jt},__experimentalGetParsedPattern:function(){return Lt},__experimentalGetPatternTransformItems:function(){return zt},__experimentalGetPatternsByBlockTypes:function(){return Ot},__experimentalGetReusableBlockTitle:function(){return Ut},__experimentalUserPatternCategories:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return ee},__unstableGetClientIdWithClientIdsTree:function(){return ne},__unstableGetClientIdsTree:function(){return oe},__unstableGetContentLockingParent:function(){return on},__unstableGetEditorMode:function(){return qt},__unstableGetSelectedBlocksWithPartialSelection:function(){return Ge},__unstableGetTemporarilyEditingAsBlocks:function(){return rn},__unstableGetVisibleBlocks:function(){return nn},__unstableHasActiveBlockOverlayActive:function(){return ln},__unstableIsFullySelected:function(){return ze},__unstableIsLastBlockChangeIgnored:function(){return $t},__unstableIsSelectionCollapsed:function(){return Ve},__unstableIsSelectionMergeable:function(){return He},__unstableIsWithinBlockOverlay:function(){return an},__unstableSelectionHasUnmergeableBlock:function(){return Fe},areInnerBlocksControlled:function(){return Qt},canEditBlock:function(){return vt},canInsertBlockType:function(){return pt},canInsertBlocks:function(){return mt},canLockBlockType:function(){return _t},canMoveBlock:function(){return ht},canMoveBlocks:function(){return bt},canRemoveBlock:function(){return ft},canRemoveBlocks:function(){return gt},didAutomaticChange:function(){return Yt},getAdjacentBlockClientId:function(){return Se},getAllowedBlocks:function(){return Bt},getBlock:function(){return J},getBlockAttributes:function(){return Q},getBlockCount:function(){return ue},getBlockEditingMode:function(){return sn},getBlockHierarchyRootClientId:function(){return Ee},getBlockIndex:function(){return $e},getBlockInsertionPoint:function(){return lt},getBlockListSettings:function(){return Vt},getBlockMode:function(){return Qe},getBlockName:function(){return Y},getBlockNamesByClientId:function(){return ce},getBlockOrder:function(){return Ue},getBlockParents:function(){return ke},getBlockParentsByBlockName:function(){return ye},getBlockRootClientId:function(){return _e},getBlockSelectionEnd:function(){return fe},getBlockSelectionStart:function(){return me},getBlockTransformItems:function(){return Ct},getBlocks:function(){return te},getBlocksByClientId:function(){return se},getClientIdsOfDescendants:function(){return re},getClientIdsWithDescendants:function(){return le},getDirectInsertBlock:function(){return Tt},getDraggedBlockClientIds:function(){return tt},getFirstMultiSelectedBlockClientId:function(){return Pe},getGlobalBlockCount:function(){return ie},getInserterItems:function(){return St},getLastMultiSelectedBlockClientId:function(){return Ne},getLowestCommonAncestorWithSelectedBlock:function(){return we},getMultiSelectedBlockClientIds:function(){return Te},getMultiSelectedBlocks:function(){return Me},getMultiSelectedBlocksEndClientId:function(){return Oe},getMultiSelectedBlocksStartClientId:function(){return De},getNextBlockClientId:function(){return xe},getPatternsByBlockTypes:function(){return Dt},getPreviousBlockClientId:function(){return Ce},getSelectedBlock:function(){return ve},getSelectedBlockClientId:function(){return be},getSelectedBlockClientIds:function(){return Ie},getSelectedBlockCount:function(){return ge},getSelectedBlocksInitialCaretPosition:function(){return Be},getSelectionEnd:function(){return pe},getSelectionStart:function(){return de},getSettings:function(){return Ft},getTemplate:function(){return st},getTemplateLock:function(){return ct},hasBlockMovingClientId:function(){return Zt},hasDraggedInnerBlock:function(){return Ke},hasInserterItems:function(){return xt},hasMultiSelection:function(){return Ze},hasSelectedBlock:function(){return he},hasSelectedInnerBlock:function(){return We},isAncestorBeingDragged:function(){return ot},isAncestorMultiSelected:function(){return Ae},isBlockBeingDragged:function(){return nt},isBlockHighlighted:function(){return Xt},isBlockInsertionPointVisible:function(){return it},isBlockMultiSelected:function(){return Re},isBlockSelected:function(){return je},isBlockValid:function(){return X},isBlockVisible:function(){return tn},isBlockWithinSelection:function(){return qe},isCaretWithinFormattedText:function(){return rt},isDraggingBlocks:function(){return et},isFirstMultiSelectedBlock:function(){return Le},isGroupable:function(){return un},isLastBlockChangePersistent:function(){return Ht},isMultiSelecting:function(){return Ye},isNavigationMode:function(){return Kt},isSelectionEnabled:function(){return Xe},isTyping:function(){return Je},isUngroupable:function(){return cn},isValidTemplate:function(){return at},wasBlockJustInserted:function(){return en}});var t={};n.r(t),n.d(t,{__experimentalUpdateSettings:function(){return pn},clearBlockRemovalPrompt:function(){return bn},deleteStyleOverride:function(){return yn},ensureDefaultBlock:function(){return hn},hideBlockInterface:function(){return mn},privateRemoveBlocks:function(){return gn},setBlockRemovalRules:function(){return vn},setOpenedBlockSettingsMenu:function(){return _n},setStyleOverride:function(){return kn},showBlockInterface:function(){return fn}});var r={};n.r(r),n.d(r,{getBlockRemovalRules:function(){return In},getEnabledBlockParents:function(){return xn},getEnabledClientIdsTree:function(){return Cn},getInserterMediaCategories:function(){return Nn},getLastInsertedBlocksClientIds:function(){return wn},getOpenedBlockSettingsMenu:function(){return Tn},getRegisteredInserterMediaCategories:function(){return Pn},getRemovalPromptData:function(){return Bn},getStyleOverrides:function(){return Mn},isBlockInterfaceHidden:function(){return En},isBlockSubtreeDisabled:function(){return Sn}});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:function(){return po},__unstableExpandSelection:function(){return fo},__unstableMarkAutomaticChange:function(){return Lo},__unstableMarkLastChangeAsPersistent:function(){return Po},__unstableMarkNextChangeAsNotPersistent:function(){return No},__unstableSaveReusableBlock:function(){return Mo},__unstableSetEditorMode:function(){return Ao},__unstableSetTemporarilyEditingAsBlocks:function(){return $o},__unstableSplitSelection:function(){return mo},clearSelectedBlock:function(){return Zn},duplicateBlocks:function(){return Oo},enterFormattedText:function(){return So},exitFormattedText:function(){return Co},flashBlock:function(){return Ho},hideInsertionPoint:function(){return so},insertAfterBlock:function(){return Vo},insertBeforeBlock:function(){return zo},insertBlock:function(){return lo},insertBlocks:function(){return io},insertDefaultBlock:function(){return Bo},mergeBlocks:function(){return go},moveBlockToPosition:function(){return ro},moveBlocksDown:function(){return to},moveBlocksToPosition:function(){return oo},moveBlocksUp:function(){return no},multiSelect:function(){return qn},receiveBlocks:function(){return Fn},registerInserterMediaCategory:function(){return jo},removeBlock:function(){return bo},removeBlocks:function(){return ho},replaceBlock:function(){return Jn},replaceBlocks:function(){return Qn},replaceInnerBlocks:function(){return vo},resetBlocks:function(){return On},resetSelection:function(){return Vn},selectBlock:function(){return Un},selectNextBlock:function(){return jn},selectPreviousBlock:function(){return $n},selectionChange:function(){return xo},setBlockEditingMode:function(){return Wo},setBlockMovingClientId:function(){return Do},setBlockVisibility:function(){return Uo},setHasControlledInnerBlocks:function(){return Go},setNavigationMode:function(){return Ro},setTemplateValidity:function(){return co},showInsertionPoint:function(){return ao},startDraggingBlocks:function(){return Eo},startMultiSelect:function(){return Wn},startTyping:function(){return ko},stopDraggingBlocks:function(){return wo},stopMultiSelect:function(){return Kn},stopTyping:function(){return yo},synchronizeTemplate:function(){return uo},toggleBlockHighlight:function(){return Fo},toggleBlockMode:function(){return _o},toggleSelection:function(){return Yn},unsetBlockEditingMode:function(){return Ko},updateBlock:function(){return Gn},updateBlockAttributes:function(){return Hn},updateBlockListSettings:function(){return Io},updateSettings:function(){return To},validateBlocksToTemplate:function(){return zn}});var i={};n.r(i),n.d(i,{AdvancedPanel:function(){return bM},BorderPanel:function(){return lv},ColorPanel:function(){return Uv},DimensionsPanel:function(){return Ok},EffectsPanel:function(){return uM},FiltersPanel:function(){return _y},GlobalStylesContext:function(){return Ol},ImageSettingsPanel:function(){return hM},TypographyPanel:function(){return G_},areGlobalStyleConfigsEqual:function(){return Dl},getBlockCSSSelector:function(){return uy},getLayoutStyles:function(){return qT},useGlobalSetting:function(){return Hl},useGlobalStyle:function(){return Gl},useGlobalStylesOutput:function(){return rM},useGlobalStylesOutputWithConfig:function(){return oM},useGlobalStylesReset:function(){return Fl},useHasBorderPanel:function(){return Qb},useHasColorPanel:function(){return Mv},useHasDimensionsPanel:function(){return Ck},useHasEffectsPanel:function(){return iM},useHasFiltersPanel:function(){return my},useHasImageSettingsPanel:function(){return gM},useHasTypographyPanel:function(){return M_},useSettingsForBlockElement:function(){return Ul}});var a=window.wp.blocks,s=window.wp.hooks;(0,s.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,a.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var c=window.wp.element,u=n(4403),d=n.n(u),p=window.wp.compose,m=window.wp.components,f=window.wp.data;var g={default:(0,m.createSlotFill)("BlockControls"),block:(0,m.createSlotFill)("BlockControlsBlock"),inline:(0,m.createSlotFill)("BlockFormatControls"),other:(0,m.createSlotFill)("BlockControlsOther"),parent:(0,m.createSlotFill)("BlockControlsParent")},h=n(5619),b=n.n(h),v=window.wp.i18n;const _={insertUsage:{}},k={alignWide:!1,supportsLayout:!0,colors:[{name:(0,v.__)("Black"),slug:"black",color:"#000000"},{name:(0,v.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,v.__)("White"),slug:"white",color:"#ffffff"},{name:(0,v.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,v.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,v.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,v.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,v.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,v.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,v.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,v.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,v.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,v._x)("Small","font size name"),size:13,slug:"small"},{name:(0,v._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,v._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,v._x)("Large","font size name"),size:36,slug:"large"},{name:(0,v._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,v.__)("Thumbnail")},{slug:"medium",name:(0,v.__)("Medium")},{slug:"large",name:(0,v.__)("Large")},{slug:"full",name:(0,v.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,v.__)("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,v.__)("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,v.__)("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,v.__)("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,v.__)("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,v.__)("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,v.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,v.__)("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,v.__)("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,v.__)("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,v.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,v.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function y(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function E(e,t,n,o=1){const r=[...e];return r.splice(t,o),y(r,e.slice(t,t+o),n)}const w=e=>e;function S(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),S(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function C(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&o.push([r.clientId,t])}))}return n}function x(e,t=w){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function B(e){return x(e,(e=>{const{attributes:t,...n}=e;return n}))}function I(e){return x(e,(e=>e.attributes))}function T(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&b()(e.clientIds,t.clientIds)&&function(e,t){return b()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function M(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function P(e,t,n=!1){const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const N=(0,p.pipe)(f.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),M(o,n.blocks),P(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),P(o,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),P(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),M(o,n.blocks),P(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));P(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),P(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),P(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),P(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),P(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order.get(o[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[r])));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(B(n.blocks)),attributes:new Map(I(n.blocks)),order:S(n.blocks),parents:new Map(C(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),M(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(a=o?.isPersistentChange)||void 0===a||a;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!T(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(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return B(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),B(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return I(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let a=!1;const s=e.get(l),c={};i.forEach((([e,t])=>{s[e]!==t&&(a=!0,c[e]=t)})),o=o||a,a&&r.set(l,{...s,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),I(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=S(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=S(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,y(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:l}=t,{index:i=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(l[0]),n=new Map(e);return n.set(r,E(e.get(r),t,i,l.length)),n}const a=new Map(e);return a.set(n,null!==(o=e.get(n)?.filter((e=>!l.includes(e))))&&void 0!==o?o:[]),a.set(r,y(e.get(r),l,i)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),a=new Map(e);return a.set(o,E(l,i,i-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const a=i.indexOf(r),s=new Map(e);return s.set(o,E(i,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=S(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return C(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return C(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),C(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(e={},{type:t,clientId:n,hasControlledInnerBlocks:o}){return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e}});function L(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const R=(0,f.combineReducers)({blocks:N,isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:o}=t;return{selectionStart:n,selectionEnd:o};case"MULTI_SELECT":const{start:r,end:l}=t;return r===e.selectionStart?.clientId&&l===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:l}};case"RESET_BLOCKS":const i=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!i&&!a)return e;if(!t.blocks.some((e=>e.clientId===i)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=L(e.selectionStart,t),o=L(e.selectionEnd,t);return n===e.selectionStart&&o===e.selectionEnd?e:{selectionStart:n,selectionEnd:o}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){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(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return b()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l}=t,i={rootClientId:n,index:o,__unstableWithInserter:r,operation:l};return b()(e,i)?e:i}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=k,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...k,...t.settings}:{...e,...t.settings}:e},preferences:function(e=_,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let l=r;const i=(0,f.select)(a.store).getActiveBlockVariation(r,o);return i?.name&&(l+="/"+i.name),"core/block"===r&&(l+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,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 e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null: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(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),o=t.meta?.source;return{clientIds:n,source:o};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:o}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:o};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}});var A=function(e){return(t,n)=>{const o=e(t,n);return t?(o.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...o,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...o,automaticChangeStatus:"final"}:o.blocks===t.blocks&&o.selection===t.selection||"final"!==o.automaticChangeStatus&&o.selection!==t.selection?o:{...o,automaticChangeStatus:void 0}):o}}(R),D={};function O(e){return[e]}function z(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 V(e,t){var n,o=t||O;function r(){n=new WeakMap}function l(){var t,r,l,i,a,s=arguments.length;for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];for(t=function(e){var t,o,r,l,i,a=n,s=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"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(D)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,a.set(D,l)),a.get(D)}(a=o.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!z(a,t.lastDependants,0)&&t.clear(),t.lastDependants=a),r=t.head;r;){if(z(r.args,i,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return l.getDependants=o,l.clear=r,r(),l}var F=window.wp.primitives;var H=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"})),G=window.wp.richText,U=window.wp.deprecated,$=n.n(U);function j(e){const{__unstablePreserveWhiteSpace:t}=e;return{preserveWhiteSpace:t}}const W=(e,t,n)=>(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const a=t.findIndex((e=>e===o)),s=t.findIndex((e=>e===r));return a>s?1:s>a?-1:0};function K(e,t,n="asc"){return e.concat().sort(W(t,e,n))}const q=[],Z=new Set;function Y(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==c.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`${o}-${r}`:o}return n?n.name:null}function X(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Q(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function J(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const ee=V(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:Q(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function te(e,t){const n=t&&Qt(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||q}const ne=V(((e,t)=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:oe(e,t)})),(e=>[e.blocks.order])),oe=V(((e,t="")=>($()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Ue(e,t).map((t=>ne(e,t))))),(e=>[e.blocks.order])),re=V(((e,t)=>{const n=Array.isArray(t)?t:[t],o=[];for(const t of n)for(const n of Ue(e,t))o.push(n,...re(e,n));return o}),(e=>[e.blocks.order])),le=V((e=>{const t=[];for(const n of Ue(e))t.push(n,...re(e,n));return t}),(e=>[e.blocks.order])),ie=V(((e,t)=>{const n=le(e);return t?n.reduce(((n,o)=>e.blocks.byClientId.get(o).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ae=V(((e,t)=>{if(!t)return q;const n=Array.isArray(t)?t:[t],o=le(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:q}),(e=>[e.blocks.order,e.blocks.byClientId])),se=V(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>J(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),ce=V(((e,t)=>se(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>se(e,t)));function ue(e,t){return Ue(e,t).length}function de(e){return e.selection.selectionStart}function pe(e){return e.selection.selectionEnd}function me(e){return e.selection.selectionStart.clientId}function fe(e){return e.selection.selectionEnd.clientId}function ge(e){const t=Te(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function he(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function be(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ve(e){const t=be(e);return t?J(e,t):null}function _e(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const ke=V(((e,t,n=!1)=>{const o=[];let r=t;for(;e.blocks.parents.get(r);)r=e.blocks.parents.get(r),o.push(r);return o.length?n?o:o.reverse():q}),(e=>[e.blocks.parents])),ye=V(((e,t,n,o=!1)=>{const r=ke(e,t,o),l=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>l(Y(e,t))))}),(e=>[e.blocks.parents]));function Ee(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function we(e,t){const n=be(e),o=[...ke(e,t),t],r=[...ke(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 Se(e,t,n=1){if(void 0===t&&(t=be(e)),void 0===t&&(t=n<0?Pe(e):Ne(e)),!t)return null;const o=_e(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t)+1*n;return i<0||i===l.length?null:l[i]}function Ce(e,t){return Se(e,t,-1)}function xe(e,t){return Se(e,t,1)}function Be(e){return e.initialPosition}const Ie=V((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return q;if(t.clientId===n.clientId)return[t.clientId];const o=_e(e,t.clientId);if(null===o)return q;const r=Ue(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 Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?q:Ie(e)}const Me=V((e=>{const t=Te(e);return t.length?t.map((t=>J(e,t))):q}),(e=>[...Ie.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Pe(e){return Te(e)[0]||null}function Ne(e){const t=Te(e);return t[t.length-1]||null}function Le(e,t){return Pe(e)===t}function Re(e,t){return-1!==Te(e).indexOf(t)}const Ae=V(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=_e(e,n),o=Re(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function De(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Oe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function ze(e){const t=de(e),n=pe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ve(e){const t=de(e),n=pe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Fe(e){return Ie(e).some((t=>{const n=Y(e,t);return!(0,a.getBlockType)(n).merge}))}function He(e,t){const n=de(e),o=pe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=_e(e,n.clientId);if(r!==_e(e,o.clientId))return!1;const l=Ue(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=Y(e,c);if(!(0,a.getBlockType)(d).merge)return!1;const p=J(e,u);if(p.name===d)return!0;const m=(0,a.switchToBlockType)(p,d);return m&&m.length}const Ge=e=>{const t=de(e),n=pe(e);if(t.clientId===n.clientId)return q;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return q;const o=_e(e,t.clientId);if(o!==_e(e,n.clientId))return q;const r=Ue(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,c]=l>i?[n,t]:[t,n],u=J(e,s.clientId),d=(0,a.getBlockType)(u.name),p=J(e,c.clientId),m=(0,a.getBlockType)(p.name),f=u.attributes[s.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[s.attributeKey],b=m.attributes[c.attributeKey];let v=(0,G.create)({html:f,...j(h)}),_=(0,G.create)({html:g,...j(b)});return v=(0,G.remove)(v,0,s.offset),_=(0,G.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[s.attributeKey]:(0,G.toHTMLString)({value:v,...j(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}}]};function Ue(e,t){return e.blocks.order.get(t||"")||q}function $e(e,t){return Ue(e,_e(e,t)).indexOf(t)}function je(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function We(e,t,n=!1){return Ue(e,t).some((t=>je(e,t)||Re(e,t)||n&&We(e,t,n)))}function Ke(e,t,n=!1){return Ue(e,t).some((t=>nt(e,t)||n&&Ke(e,t,n)))}function qe(e,t){if(!t)return!1;const n=Te(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ye(e){return e.isMultiSelecting}function Xe(e){return e.isSelectionEnabled}function Qe(e,t){return e.blocksMode[t]||"visual"}function Je(e){return e.isTyping}function et(e){return!!e.draggedBlocks.length}function tt(e){return e.draggedBlocks}function nt(e,t){return e.draggedBlocks.includes(t)}function ot(e,t){if(!et(e))return!1;return ke(e,t).some((t=>nt(e,t)))}function rt(){return $()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const lt=V((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=_e(e,l)||void 0,n=$e(e,r.clientId)+1):n=Ue(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function it(e){return null!==e.insertionPoint}function at(e){return e.template.isValid}function st(e){return e.settings.template}function ct(e,t){var n,o;return t?null!==(n=Vt(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const ut=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,dt=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,a.getBlockType)(t),!o)return!1;const{allowedBlockTypes:r}=Ft(e);if(!ut(r,t,!0))return!1;if(!!ct(e,n))return!1;if("disabled"===sn(e,null!=n?n:""))return!1;const l=Vt(e,n);if(n&&void 0===l)return!1;const i=l?.allowedBlocks,c=ut(i,t),u=o.parent,d=Y(e,n),p=ut(u,d);let m=!0;const f=o.ancestor;if(f){m=[n,...ke(e,n)].some((t=>ut(f,Y(e,t))))}const g=m&&(null===c&&null===p||!0===c||!0===p);return g?(0,s.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,o,n,{getBlock:J.bind(null,e),getBlockParentsByBlockName:ye.bind(null,e)}):g},pt=V(dt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function mt(e,t,n=null){return t.every((t=>pt(e,Y(e,t),n)))}function ft(e,t,n=null){const o=Q(e,t);return null===o||(void 0!==o.lock?.remove?!o.lock.remove:!ct(e,n)&&"disabled"!==sn(e,n))}function gt(e,t,n=null){return t.every((t=>ft(e,t,n)))}function ht(e,t,n=null){const o=Q(e,t);return null===o||(void 0!==o.lock?.move?!o.lock.move:"all"!==ct(e,n)&&"disabled"!==sn(e,n))}function bt(e,t,n=null){return t.every((t=>ht(e,t,n)))}function vt(e,t){const n=Q(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function _t(e,t){return!!(0,a.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function kt(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const yt=(e,t,n)=>!!(0,a.hasBlockSupport)(t,"inserter",!0)&&dt(e,t.name,n),Et=(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}},wt=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,a.hasBlockSupport)(n.name,"multiple",!0)||(r=se(e,le(e)).some((({name:e})=>e===n.name)));const{time:l,count:i=0}=kt(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:Et(l,i)};if("transform"===t)return s;const c=(0,a.getBlockVariations)(n.name,"inserter");return{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:c,example:n.example,utility:1}},St=V(((e,t=null)=>{const n=dt(e,"core/block",t)?Wt(e).map((t=>{const n=t.wp_pattern_sync_status?H:{src:H,foreground:"var(--wp-block-synced-color)"},o=`core/block/${t.id}`,{time:r,count:l=0}=kt(e,o)||{},i=Et(r,l);return{id:o,name:"core/block",initialAttributes:{ref:t.id},title:t.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:i,content:t.content.raw,syncStatus:t.wp_pattern_sync_status}})):[],o=wt(e,{buildScope:"inserter"}),r=(0,a.getBlockTypes)().filter((n=>yt(e,n,t))).map(o).reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||t.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=kt(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Et(r,l)}})(e,n);t.push(...o.map(r))}return t}),[]),{core:l,noncore:i}=r.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...l,...i],...n]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Wt(e),(0,a.getBlockTypes)()])),Ct=V(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=wt(e,{buildScope:"transform"}),l=(0,a.getBlockTypes)().filter((t=>yt(e,t,n))).map(r),i=Object.fromEntries(Object.entries(l).map((([,e])=>[e.name,e]))),s=(0,a.getPossibleBlockTransformations)(o).reduce(((e,t)=>(i[t?.name]&&e.push(i[t.name]),e)),[]);return K(s,(e=>i[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,a.getBlockTypes)()])),xt=V(((e,t=null)=>{if((0,a.getBlockTypes)().some((n=>yt(e,n,t))))return!0;return dt(e,"core/block",t)&&Wt(e).length>0}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Wt(e),(0,a.getBlockTypes)()])),Bt=V(((e,t=null)=>{if(!t)return;return[...(0,a.getBlockTypes)().filter((n=>yt(e,n,t))),...dt(e,"core/block",t)&&Wt(e).length>0?["core/block"]:[]]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Wt(e),(0,a.getBlockTypes)()])),It=V(((e,t=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Bt(e,t))),((e,t)=>[...Bt.getDependants(e,t)])),Tt=V(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.defaultBlock,o=e.blockListSettings[t]?.directInsert;return n&&o?"function"==typeof o?o(J(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Mt=V(((e,t=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Tt(e,t))),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)]));function Pt(e){var t,n;const o=null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:q,r=null!==(n=e?.settings?.__experimentalUserPatternCategories)&&void 0!==n?n:[],l=new Map;return r.forEach((e=>l.set(e.id,e))),o.map((e=>({name:`core/block/${e.id}`,id:e.id,type:"user",title:e.title.raw,categories:e.wp_pattern_category.map((e=>l&&l.get(e)?l.get(e).slug:e)),content:e.content.raw,syncStatus:e.wp_pattern_sync_status})))}const Nt=V((e=>e?.settings?.__experimentalUserPatternCategories),(e=>[e.settings.__experimentalUserPatternCategories])),Lt=V(((e,t)=>{const n=[...e.settings.__experimentalBlockPatterns,...Pt(e)].find((({name:e})=>e===t));return n?{...n,blocks:(0,a.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e?.settings?.__experimentalUserPatternCategories])),Rt=V((e=>{const t=e.settings.__experimentalBlockPatterns,n=Pt(e),{allowedBlockTypes:o}=Ft(e),r=[...n,...t].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Lt(e,t))),l=r.filter((({blocks:e})=>((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!ut(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0})(e,o)));return l}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e?.settings?.__experimentalUserPatternCategories])),At=V(((e,t=null)=>{const n=Rt(e).filter((({blocks:n})=>n.every((({name:n})=>pt(e,n,t)))));return n}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Dt=V(((e,t,n=null)=>{if(!t)return q;const o=At(e,n),r=Array.isArray(t)?t:[t],l=o.filter((e=>e?.blockTypes?.some?.((e=>r.includes(e)))));return 0===l.length?q:l}),((e,t,n)=>[...At.getDependants(e,n)])),Ot=V(((e,t,n=null)=>($()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Dt(e,t,n))),((e,t,n)=>[...At.getDependants(e,n)])),zt=V(((e,t,n=null)=>{if(!t)return q;if(t.some((({clientId:t,innerBlocks:n})=>n.length||Qt(e,t))))return q;const o=Array.from(new Set(t.map((({name:e})=>e))));return Dt(e,o,n)}),((e,t,n)=>[...Dt.getDependants(e,n)]));function Vt(e,t){return e.blockListSettings[t]}function Ft(e){return e.settings}function Ht(e){return e.blocks.isPersistentChange}const Gt=V(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Ut=V(((e,t)=>{const n=Wt(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[Wt(e)]));function $t(e){return e.blocks.isIgnoredChange}function jt(e){return e.lastBlockAttributesChange}function Wt(e){var t;return null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:q}function Kt(e){return"navigation"===e.editorMode}function qt(e){return e.editorMode}function Zt(e){return e.hasBlockMovingClientId}function Yt(e){return!!e.automaticChangeStatus}function Xt(e,t){return e.highlightedBlock===t}function Qt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Jt=V(((e,t)=>{if(!t.length)return null;const n=be(e);if(t.includes(Y(e,n)))return n;const o=Te(e),r=ye(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function en(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function tn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const nn=V((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Z:t}),(e=>[e.blockVisibility])),on=V(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),o&&"contentOnly"===ct(e,o)&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function rn(e){return e.temporarilyEditingAsBlocks}function ln(e,t){if("default"!==sn(e,t))return!1;if(!vt(e,t))return!0;const n=qt(e);if("zoom-out"===n&&t&&!_e(e,t))return!0;const o=(0,a.hasBlockSupport)(Y(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&Qt(e,t))&&!je(e,t)&&!We(e,t,!0)}function an(e,t){let n=e.blocks.parents.get(t);for(;n;){if(ln(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const sn=(0,f.createRegistrySelector)((e=>(t,n="")=>{if(t.blockEditingModes.has(n))return t.blockEditingModes.get(n);if(!n)return"default";const o=_e(t,n);if("contentOnly"===ct(t,o)){const o=Y(t,n);return e(a.store).__experimentalHasContentRoleAttribute(o)?"contentOnly":"disabled"}const r=sn(t,o);return"contentOnly"===r?"default":r})),cn=(0,f.createRegistrySelector)((e=>(t,n="")=>{const o=n||be(t);if(!o)return!1;const{getGroupingBlockName:r}=e(a.store),l=J(t,o),i=r();return l&&(l.name===i||(0,a.getBlockType)(l.name)?.transforms?.ungroup)&&!!l.innerBlocks.length&&ft(t,o)})),un=(0,f.createRegistrySelector)((e=>(t,n=q)=>{const{getGroupingBlockName:o}=e(a.store),r=o(),l=n?.length?n:Ie(t),i=l?.length?_e(t,l[0]):void 0;return pt(t,r,i)&&l.length&>(t,l,i)})),dn=["inserterMediaCategories","blockInspectorAnimation"];function pn(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;if(t&&"web"===c.Platform.OS){o={};for(const t in e)dn.includes(t)||(o[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:o,reset:n}}function mn(){return{type:"HIDE_BLOCK_INTERFACE"}}function fn(){return{type:"SHOW_BLOCK_INTERFACE"}}const gn=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:l})=>{if(!e||!e.length)return;var i;i=e,e=Array.isArray(i)?i:[i];const a=o.getBlockRootClientId(e[0]);if(!o.canRemoveBlocks(e,a))return;const s=!n&&o.getBlockRemovalRules();if(s){const n=new Set,l=[...e];for(;l.length;){const e=l.shift(),t=o.getBlockName(e);s[t]&&n.add(t);const r=o.getBlockOrder(e);l.push(...r)}if(n.size)return void r(function(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n}}(e,t,Array.from(n)))}t&&r.selectPreviousBlock(e[0],t),l.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(hn())}))},hn=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function bn(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function vn(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function _n(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function kn(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function yn(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function En(e){return e.isBlockInterfaceHidden}function wn(e){return e?.lastBlockInserted?.clientIds}const Sn=V(((e,t)=>{const n=t=>"disabled"===sn(e,t)&&Ue(e,t).every(n);return"disabled"===sn(e,t)&&Ue(e,t).every(n)}),(e=>[e.blocks.parents,e.blocks.order,e.blockEditingModes,e.blockListSettings])),Cn=V(((e,t="")=>Ue(e,t).flatMap((t=>"disabled"!==sn(e,t)?[{clientId:t,innerBlocks:Cn(e,t)}]:Cn(e,t)))),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),xn=V(((e,t,n=!1)=>ke(e,t,n).filter((t=>"disabled"!==sn(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Bn(e){return e.removalPromptData}function In(e){return e.blockRemovalRules}function Tn(e){return e.openedBlockSettingsMenu}function Mn(e){return e.styleOverrides}function Pn(e){return e.registeredInserterMediaCategories}const Nn=V((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const l=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!l.includes(e)))].filter((e=>!(!o&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories]));var Ln=window.wp.a11y;const Rn="";function An(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Rn)}))}const Dn=e=>Array.isArray(e)?e:[e],On=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(zn(e))},zn=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),l=!o||"all"!==r||(0,a.doBlocksMatchTemplate)(e,o);if(l!==t.isValidTemplate())return n.setTemplateValidity(l),l};function Vn(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Fn(e){return $()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Hn(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Dn(e),attributes:t,uniqueByBlock:n}}function Gn(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Un(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const $n=(e,t=!1)=>({select:n,dispatch:o})=>{const r=n.getPreviousBlockClientId(e);if(r)o.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},jn=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function Wn(){return{type:"START_MULTI_SELECT"}}function Kn(){return{type:"STOP_MULTI_SELECT"}}const qn=(e,t,n=0)=>({select:o,dispatch:r})=>{if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,Ln.speak)((0,v.sprintf)((0,v._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function Zn(){return{type:"CLEAR_SELECTED_BLOCK"}}function Yn(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Xn(e,t){var n;const o=null!==(n=t?.__experimentalPreferredStyleVariations?.value)&&void 0!==n?n:{};return e.map((e=>{const t=e.name;if(!(0,a.hasBlockSupport)(t,"defaultStylePicker",!0))return e;if(!o[t])return e;const n=e.attributes?.className;if(n?.includes("is-style-"))return e;const{attributes:r={}}=e,l=o[t];return{...e,attributes:{...r,className:`${n||""} is-style-${l}`.trim()}}}))}const Qn=(e,t,n,o=0,r)=>({select:l,dispatch:i,registry:a})=>{e=Dn(e),t=Xn(Dn(t),l.getSettings());const s=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,s))return}a.batch((()=>{i({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),i.ensureDefaultBlock()}))};function Jn(e,t){return Qn(e,t)}const eo=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t,n)&&r({type:e,clientIds:Dn(t),rootClientId:n})},to=eo("MOVE_BLOCKS_DOWN"),no=eo("MOVE_BLOCKS_UP"),oo=(e,t="",n="",o)=>({select:r,dispatch:l})=>{if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function ro(e,t="",n="",o){return oo([e],t,n,o)}function lo(e,t,n,o,r){return io([e],t,n,o,0,r)}const io=(e,t,n,o=!0,r=0,l)=>({select:i,dispatch:a})=>{null!==r&&"object"==typeof r&&(l=r,r=0,$()("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=Xn(Dn(e),i.getSettings());const s=[];for(const t of e){i.canInsertBlockType(t.name,n)&&s.push(t)}s.length&&a({type:"INSERT_BLOCKS",blocks:s,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})};function ao(e,t,n={}){const{__unstableWithInserter:o,operation:r}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r}}const so=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function co(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const uo=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,a.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},po=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),l=n.getSelectionEnd();if(r.clientId===l.clientId)return;if(!r.attributeKey||!l.attributeKey||void 0===r.offset||void 0===l.offset)return!1;const i=n.getBlockRootClientId(r.clientId);if(i!==n.getBlockRootClientId(l.clientId))return;const s=n.getBlockOrder(i);let c,u;s.indexOf(r.clientId)>s.indexOf(l.clientId)?(c=l,u=r):(c=r,u=l);const d=e?u:c,p=n.getBlock(d.clientId),m=(0,a.getBlockType)(p.name);if(!m.merge)return;const f=c,g=u,h=n.getBlock(f.clientId),b=(0,a.getBlockType)(h.name),v=n.getBlock(g.clientId),_=(0,a.getBlockType)(v.name),k=h.attributes[f.attributeKey],y=v.attributes[g.attributeKey],E=b.attributes[f.attributeKey],w=_.attributes[g.attributeKey];let S=(0,G.create)({html:k,...j(E)}),C=(0,G.create)({html:y,...j(w)});S=(0,G.remove)(S,f.offset,S.text.length),C=(0,G.insert)(C,Rn,0,g.offset);const x=(0,a.cloneBlock)(h,{[f.attributeKey]:(0,G.toHTMLString)({value:S,...j(E)})}),B=(0,a.cloneBlock)(v,{[g.attributeKey]:(0,G.toHTMLString)({value:C,...j(w)})}),I=e?x:B,T=h.name===v.name?[I]:(0,a.switchToBlockType)(I,m.name);if(!T||!T.length)return;let M;if(e){const e=T.pop();M=m.merge(e.attributes,B.attributes)}else{const e=T.shift();M=m.merge(x.attributes,e.attributes)}const P=An(M),N=M[P],L=(0,G.create)({html:N,...j(m.attributes[P])}),R=L.text.indexOf(Rn),A=(0,G.remove)(L,R,R+1),D=(0,G.toHTMLString)({value:A,...j(m.attributes[P])});M[P]=D;const O=n.getSelectedBlockClientIds(),z=[...e?T:[],{...p,attributes:{...p.attributes,...M}},...e?[]:T];t.batch((()=>{o.selectionChange(p.clientId,P,R,R),o.replaceBlocks(O,z,0,n.getSelectedBlocksInitialCaretPosition())}))},mo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();if(n.clientId===o.clientId)return;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return;const r=e.getBlockRootClientId(n.clientId);if(r!==e.getBlockRootClientId(o.clientId))return;const l=e.getBlockOrder(r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const c=i,u=s,d=e.getBlock(c.clientId),p=(0,a.getBlockType)(d.name),m=e.getBlock(u.clientId),f=(0,a.getBlockType)(m.name),g=d.attributes[c.attributeKey],h=m.attributes[u.attributeKey],b=p.attributes[c.attributeKey],v=f.attributes[u.attributeKey];let _=(0,G.create)({html:g,...j(b)}),k=(0,G.create)({html:h,...j(v)});_=(0,G.remove)(_,c.offset,_.text.length),k=(0,G.remove)(k,0,u.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,G.toHTMLString)({value:_,...j(b)})}},{...m,attributes:{...m.attributes,[u.attributeKey]:(0,G.toHTMLString)({value:k,...j(v)})}}])},fo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},go=(e,t)=>({registry:n,select:o,dispatch:r})=>{const l=[e,t];r({type:"MERGE_BLOCKS",blocks:l});const[i,s]=l,c=o.getBlock(i),u=(0,a.getBlockType)(c.name);if(!u)return;if(!u.merge&&!(0,a.getBlockSupport)(c.name,"__experimentalOnMerge"))return void r.selectBlock(c.clientId);const d=o.getBlock(s);if(!u.merge){const e=(0,a.switchToBlockType)(d,u.name);if(1!==e?.length)return void r.selectBlock(c.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(c.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(i);if(e&&o.getBlockName(i)===o.getBlockName(e)){const t=o.getBlockAttributes(i),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,i),r.removeBlock(e,!1))}}))}const p=(0,a.getBlockType)(d.name),{clientId:m,attributeKey:f,offset:g}=o.getSelectionStart(),h=(m===i?u:p).attributes[f],b=(m===i||m===s)&&void 0!==f&&void 0!==g&&!!h;h||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const v=(0,a.cloneBlock)(c),_=(0,a.cloneBlock)(d);if(b){const e=m===i?v:_,t=e.attributes[f],n=(0,G.insert)((0,G.create)({html:t,...j(h)}),Rn,g,g);e.attributes[f]=(0,G.toHTMLString)({value:n,...j(h)})}const k=c.name===d.name?[_]:(0,a.switchToBlockType)(_,c.name);if(!k||!k.length)return;const y=u.merge(v.attributes,k[0].attributes);if(b){const e=An(y),t=y[e],n=(0,G.create)({html:t,...j(u.attributes[e])}),o=n.text.indexOf(Rn),l=(0,G.remove)(n,o,o+1),i=(0,G.toHTMLString)({value:l,...j(u.attributes[e])});y[e]=i,r.selectionChange(c.clientId,e,o,o)}r.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},...k.slice(1)],0)},ho=(e,t=!0)=>gn(e,t);function bo(e,t){return ho([e],t)}function vo(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function _o(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function ko(){return{type:"START_TYPING"}}function yo(){return{type:"STOP_TYPING"}}function Eo(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function wo(){return{type:"STOP_DRAGGING_BLOCKS"}}function So(){return $()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Co(){return $()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function xo(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Bo=(e,t,n)=>({dispatch:o})=>{const r=(0,a.getDefaultBlockName)();if(!r)return;const l=(0,a.createBlock)(r,e);return o.insertBlock(l,n,t)};function Io(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function To(e){return pn(e,{stripExperimentalSettings:!0})}function Mo(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Po(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function No(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Lo=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Ro=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Ao=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart();e&&t.selectBlock(n.getBlockHierarchyRootClientId(e))}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Ln.speak)((0,v.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Ln.speak)((0,v.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Ln.speak)((0,v.__)("You are currently in zoom-out mode."))},Do=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Ln.speak)((0,v.__)("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."))},Oo=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const l=r.map((e=>e.name));if(l.some((e=>!(0,a.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),s=Dn(e),c=n.getBlockIndex(s[s.length-1]),u=r.map((e=>(0,a.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,c+1,i,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},zo=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r)},Vo=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e);return n.insertDefaultBlock({},o,r+1)};function Fo(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Ho=e=>async({dispatch:t})=>{t(Fo(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Fo(e,!1))};function Go(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Uo(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function $o(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const jo=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");const o=t.getRegisteredInserterMediaCategories();o.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):o.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function Wo(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Ko(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const qo="core/block-editor";var Zo=window.wp.privateApis;const{lock:Yo,unlock:Xo}=(0,Zo.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),Qo={reducer:A,selectors:e,actions:l},Jo=(0,f.createReduxStore)(qo,{...Qo,persist:["preferences"]}),er=(0,f.registerStore)(qo,{...Qo,persist:["preferences"]});Xo(er).registerPrivateActions(t),Xo(er).registerPrivateSelectors(r),Xo(Jo).registerPrivateActions(t),Xo(Jo).registerPrivateSelectors(r);const tr={name:"",isSelected:!1},nr=(0,c.createContext)(tr),{Provider:or}=nr;function rr(){return(0,c.useContext)(nr)}function lr(){const{isSelected:e,clientId:t,name:n}=rr();return(0,f.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Jo);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function ir({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=lr(),{clientId:o}=rr(),r=(0,f.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:r}=e(Jo),{hasBlockSupport:l}=e(a.store);return t&&l(n(o),"__experimentalExposeControlsToChildren",!1)&&r(o)}),[t,o]);return n?g[e]?.Fill:r?g.parent.Fill:null}(e,o);if(!r)return null;const l=(0,c.createElement)(c.Fragment,null,"default"===e&&(0,c.createElement)(m.ToolbarGroup,{controls:t}),n);return(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(r,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,c.createElement)(t,{...n},e)),l)})))}window.wp.warning;const{ComponentsContext:ar}=Xo(m.privateApis);function sr({group:e="default",...t}){const n=(0,c.useContext)(m.__experimentalToolbarContext),o=(0,c.useContext)(ar),r=(0,c.useMemo)((()=>({forwardedContext:[[m.__experimentalToolbarContext.Provider,{value:n}],[ar.Provider,{value:o}]]})),[n,o]),l=g[e]?.Slot,i=(0,m.__experimentalUseSlotFills)(l?.__unstableName);if(!l)return null;if(!i?.length)return null;const a=(0,c.createElement)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,c.createElement)(m.ToolbarGroup,null,a)}const cr=ir;cr.Slot=sr;const ur=e=>(0,c.createElement)(ir,{group:"inline",...e});ur.Slot=e=>(0,c.createElement)(sr,{group:"inline",...e});var dr=cr;var pr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"}));var mr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"}));var fr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));var gr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));var hr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"}));var br=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"}));var vr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"}));const _r={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function kr(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function yr(e,t=_r,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${kr(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function Er(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},l=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return l.test(t)&&"constrained"===o&&(r.none=(0,v.sprintf)((0,v.__)("Max %s wide"),t)),l.test(n)&&(r.wide=(0,v.sprintf)((0,v.__)("Max %s wide"),n)),r}var wr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"}));var Sr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,c.createElement)(F.Path,{d:"m18 7.5v9h1.5v-9z"}));var Cr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,c.createElement)(F.Path,{d:"m7.5 19.5h9v-1.5h-9z"}));var xr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m16.5 6h-9v-1.5h9z"}));var Br=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m18 16.5v-9h1.5v9z"}));var Ir=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m16.5 19.5h-9v-1.5h9z",style:{fill:"#1e1e1e"}}));const Tr=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,c.createElement)(F.Path,{d:"m4.5 16.5v-9h1.5v9z"}));const Mr=["top","right","bottom","left"],Pr={top:void 0,right:void 0,bottom:void 0,left:void 0},Nr={custom:wr,axial:wr,horizontal:Sr,vertical:Cr,top:xr,right:Br,bottom:Ir,left:Tr},Lr={default:(0,v.__)("Spacing control"),top:(0,v.__)("Top"),bottom:(0,v.__)("Bottom"),left:(0,v.__)("Left"),right:(0,v.__)("Right"),mixed:(0,v.__)("Mixed"),vertical:(0,v.__)("Vertical"),horizontal:(0,v.__)("Horizontal"),axial:(0,v.__)("Horizontal & vertical"),custom:(0,v.__)("Custom")},Rr={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Ar(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function Dr(e,t){if(!Ar(e))return e;const n=Vr(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Or(e,t){if(!e||Ar(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function zr(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Vr(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function Fr(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),o=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?o:n||o}function Hr(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=zr(n?.top)||t,r=zr(n?.left)||t;return o===r?o:`${o} ${r}`}const Gr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ur=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),$r=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),jr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Wr=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(m.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Kr={top:{icon:$r,title:(0,v._x)("Align top","Block vertical alignment setting")},center:{icon:Ur,title:(0,v._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Gr,title:(0,v._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:jr,title:(0,v._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Wr,title:(0,v._x)("Space between","Block vertical alignment setting")}},qr=["top","center","bottom"];var Zr=function({value:e,onChange:t,controls:n=qr,isCollapsed:o=!0,isToolbar:r}){const l=Kr[e],i=Kr.top,a=r?m.ToolbarGroup:m.ToolbarDropdownMenu,s=r?{isCollapsed:o}:{};return(0,c.createElement)(a,{icon:l?l.icon:i.icon,label:(0,v._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((n=>{return{...Kr[n],isActive:e===n,role:o?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r})),...s})};const Yr=e=>(0,c.createElement)(Zr,{...e,isToolbar:!1}),Xr=e=>(0,c.createElement)(Zr,{...e,isToolbar:!0}),Qr={left:pr,center:mr,right:fr,"space-between":gr,stretch:hr};var Jr=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const i=e=>{n(e===o?void 0:e)},a=o?Qr[o]:Qr.left,s=[{name:"left",icon:pr,title:(0,v.__)("Justify items left"),isActive:"left"===o,onClick:()=>i("left")},{name:"center",icon:mr,title:(0,v.__)("Justify items center"),isActive:"center"===o,onClick:()=>i("center")},{name:"right",icon:fr,title:(0,v.__)("Justify items right"),isActive:"right"===o,onClick:()=>i("right")},{name:"space-between",icon:gr,title:(0,v.__)("Space between items"),isActive:"space-between"===o,onClick:()=>i("space-between")},{name:"stretch",icon:hr,title:(0,v.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>i("stretch")}],u=l?m.ToolbarGroup:m.ToolbarDropdownMenu,d=l?{isCollapsed:t}:{};return(0,c.createElement)(u,{icon:a,popoverProps:r,label:(0,v.__)("Change items justification"),controls:s.filter((t=>e.includes(t.name))),...d})};const el=e=>(0,c.createElement)(Jr,{...e,isToolbar:!1}),tl=e=>(0,c.createElement)(Jr,{...e,isToolbar:!0});var nl=function(){return nl=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},nl.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function ol(e){return e.toLowerCase()}var rl=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],ll=/[^A-Z0-9]+/gi;function il(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?rl:n,r=t.stripRegexp,l=void 0===r?ll:r,i=t.transform,a=void 0===i?ol:i,s=t.delimiter,c=void 0===s?" ":s,u=al(al(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(c)}function al(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function sl(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),il(e,nl({delimiter:"."},t))}(e,nl({delimiter:"-"},t))}function cl(e){let t=e;var n;"string"!=typeof e&&(t=null!==(n=e?.toString?.())&&void 0!==n?n:"");return t=t.replace(/['\u2019]/,""),sl(t,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function ul(e){return Array.isArray(e)?e.map(ul):e&&"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,ul(t)])))}:e}function dl(e,t,n){const o=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),r=e?ul(e):{};return o.reduce(((e,r,l)=>(void 0===e[r]&&(Number.isInteger(t[l+1])?e[r]=[]:e[r]={}),l===o.length-1&&(e[r]=n),e[r])),r),r}const pl=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let l=e;return r.forEach((e=>{l=l?.[e]})),null!==(o=l)&&void 0!==o?o:n},ml=["color","border","dimensions","typography","spacing"],fl={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},gl={"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"},hl=e=>gl[e]||e;function bl(e){const{name:t,clientId:n}=rr();return(0,f.useSelect)((o=>{if(ml.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let r=(0,s.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==r)return r;const l=hl(e),i=[n,...o(Jo).getBlockParents(n,!0)];for(const e of i){const n=o(Jo).getBlockName(e);if((0,a.hasBlockSupport)(n,"__experimentalSettings",!1)){var c;const n=o(Jo).getBlockAttributes(e);if(r=null!==(c=pl(n,`settings.blocks.${t}.${l}`))&&void 0!==c?c:pl(n,`settings.${l}`),void 0!==r)break}}const u=o(Jo).getSettings();if(void 0===r){var d;const e=`__experimentalFeatures.${l}`;r=null!==(d=pl(u,`__experimentalFeatures.blocks.${t}.${l}`))&&void 0!==d?d:pl(u,e)}var p,m;if(void 0!==r)return a.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?null!==(p=null!==(m=r.custom)&&void 0!==m?m:r.theme)&&void 0!==p?p:r.default:r;const f=fl[l]?fl[l](u):void 0;return void 0!==f?f:"typography.dropCap"===l||void 0}),[t,n,e])}const vl="1600px",_l="320px",kl=1,yl=.25,El=.75,wl="14px";function Sl({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=_l,maximumViewportWidth:r=vl,scaleFactor:l=kl,minimumFontSizeLimit:i}){if(i=Cl(i)?i:wl,n){const o=Cl(n);if(!o?.unit)return null;const r=Cl(i,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),yl),El),l=xl(o.value*n,3);e=r?.value&&l<r?.value?`${r.value}${r.unit}`:`${l}${o.unit}`}}const a=Cl(e),s=a?.unit||"rem",c=Cl(t,{coerceTo:s});if(!a||!c)return null;const u=Cl(e,{coerceTo:"rem"}),d=Cl(r,{coerceTo:s}),p=Cl(o,{coerceTo:s});if(!d||!p||!u)return null;const m=xl(p.value/100,3),f=xl(m,3)+s,g=xl(((c.value-a.value)/(d.value-p.value)*100||1)*l,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${f}) * ${g})`}, ${t})`}function Cl(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),a=e.match(i);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:xl(u,3),unit:c}}function xl(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Bl(e,t){const{size:n}=e;if(!Il(t))return n;if(!n||"0"===n||!1===e?.fluid)return n;const o="object"==typeof t?.fluid?t?.fluid:{},r=Sl({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function Il(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function Tl(e){const t=e?.typography,n=e?.layout,o=Cl(n?.wideSize)?n?.wideSize:null;return Il(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}const Ml="body",Pl=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>Bl(e,Tl(t)),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],Nl={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Ll(e,t,n,o,r){const l=[pl(e,["blocks",t,...n]),pl(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const a of l){const l=i[a];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return Ll(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function Rl(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=pl(e,t))||n?.ref)return n}}const o="var:",r="var(--wp--";let l;if(n.startsWith(o))l=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;l=n.slice(10,-1).split("--")}const[i,...a]=l;return"preset"===i?function(e,t,n,[o,r]){const l=Pl.find((e=>e.cssVarInfix===o));if(!l)return n;const i=Ll(e.settings,t,l.path,"slug",r);if(i){const{valueKey:n}=l;return Rl(e,t,i[n])}return n}(e,t,n,a):"custom"===i?function(e,t,n,o){var r;const l=null!==(r=pl(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:pl(e.settings,["custom",...o]);return l?Rl(e,t,l):n}(e,t,n,a):n}function Al(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(", ")}function Dl(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:b()(e?.styles,t?.styles)&&b()(e?.settings,t?.settings)}const Ol=(0,c.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),zl={settings:{},styles:{}},Vl=["appearanceTools","useRootPaddingAwareAlignments","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],Fl=()=>{const{user:e,setUserConfig:t}=(0,c.useContext)(Ol);return[!!e&&!b()(e,zl),(0,c.useCallback)((()=>t((()=>zl))),[t])]};function Hl(e,t,n="all"){const{setUserConfig:o,...r}=(0,c.useContext)(Ol),l=t?".blocks."+t:"",i=e?"."+e:"",a=`settings${l}${i}`,s=`settings${i}`,u="all"===n?"merged":n;return[(0,c.useMemo)((()=>{const t=r[u];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=pl(t,a))&&void 0!==n?n:pl(t,s);let o={};return Vl.forEach((e=>{var n;const r=null!==(n=pl(t,`settings${l}.${e}`))&&void 0!==n?n:pl(t,`settings.${e}`);void 0!==r&&(o=dl(o,e.split("."),r))})),o}),[r,u,e,a,s,l]),e=>{o((t=>dl(t,a.split("."),e)))}]}function Gl(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:l,user:i,setUserConfig:a}=(0,c.useContext)(Ol),s=e?"."+e:"",u=t?`styles.blocks.${t}${s}`:`styles${s}`;let d,p;switch(n){case"all":d=pl(r,u),p=o?Rl(r,t,d):d;break;case"user":d=pl(i,u),p=o?Rl(r,t,d):d;break;case"base":d=pl(l,u),p=o?Rl(l,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{a((l=>dl(l,u.split("."),o?function(e,t,n,o){if(!o)return o;const r=Nl[n],l=Pl.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:a}=l,s=Ll(e,t,a,i,o);return s?`var:preset|${r}|${s.slug}`:o}(r.settings,t,e,n):n)))}]}function Ul(e,t,n){const{supportedStyles:o,supports:r}=(0,f.useSelect)((e=>({supportedStyles:Xo(e(a.store)).getSupportedStyles(t,n),supports:e(a.store).getBlockType(t)?.supports})),[t,n]);return(0,c.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),o.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&o.includes("color"),background:t.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:t.color?.button&&o.includes("buttonColor"),heading:t.color?.heading&&o.includes("headingColor"),link:t.color?.link&&o.includes("linkColor"),caption:t.color?.caption&&o.includes("captionColor")},o.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),o.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),o.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,t}),[e,o,r])}function $l(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function jl(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}const Wl=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Wl(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function Kl(e,t,n,o,r,l){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;i=o[r]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=pl(i,e);t&&(a={...a,attributes:dl(a.attributes,e,t)})}))})),a}function ql(e,t,n){const o=(0,a.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function Zl(e,t){const n=bl("typography.fontFamilies"),o=bl("typography.fontSizes"),r=bl("typography.customFontSize"),l=bl("typography.fontStyle"),i=bl("typography.fontWeight"),a=bl("typography.lineHeight"),s=bl("typography.textColumns"),u=bl("typography.textDecoration"),d=bl("typography.writingMode"),p=bl("typography.textTransform"),m=bl("typography.letterSpacing"),f=bl("spacing.padding"),g=bl("spacing.margin"),h=bl("spacing.blockGap"),b=bl("spacing.spacingSizes"),v=bl("spacing.units"),_=bl("dimensions.minHeight"),k=bl("layout"),y=bl("border.color"),E=bl("border.radius"),w=bl("border.style"),S=bl("border.width"),C=bl("color.custom"),x=bl("color.palette.custom"),B=bl("color.customDuotone"),I=bl("color.palette.theme"),T=bl("color.palette.default"),M=bl("color.defaultPalette"),P=bl("color.defaultDuotone"),N=bl("color.duotone.custom"),L=bl("color.duotone.theme"),R=bl("color.duotone.default"),A=bl("color.gradients.custom"),D=bl("color.gradients.theme"),O=bl("color.gradients.default"),z=bl("color.defaultGradients"),V=bl("color.customGradient"),F=bl("color.background"),H=bl("color.link"),G=bl("color.text"),U=bl("color.heading"),$=bl("color.button");return Ul((0,c.useMemo)((()=>({color:{palette:{custom:x,theme:I,default:T},gradients:{custom:A,theme:D,default:O},duotone:{custom:N,theme:L,default:R},defaultGradients:z,defaultPalette:M,defaultDuotone:P,custom:C,customGradient:V,customDuotone:B,background:F,link:H,heading:U,button:$,text:G},typography:{fontFamilies:{custom:n},fontSizes:{custom:o},customFontSize:r,fontStyle:l,fontWeight:i,lineHeight:a,textColumns:s,textDecoration:u,textTransform:p,letterSpacing:m,writingMode:d},spacing:{spacingSizes:{custom:b},padding:f,margin:g,blockGap:h,units:v},border:{color:y,radius:E,style:w,width:S},dimensions:{minHeight:_},layout:k,parentLayout:t})),[n,o,r,l,i,a,s,u,p,m,d,f,g,h,b,v,_,k,t,y,E,w,S,C,x,B,I,T,M,P,N,L,R,A,D,O,z,V,F,H,G,U,$]),e)}const Yl={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Xl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Ql={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Jl=["wrap","nowrap"];var ei={name:"flex",label:(0,v.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Flex,null,(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(oi,{layout:e,onChange:t})),(0,c.createElement)(m.FlexItem,null,o&&(0,c.createElement)(li,{layout:e,onChange:t}))),(0,c.createElement)(ri,{layout:e,onChange:t}))},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,c.createElement)(dr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(oi,{layout:e,onChange:t,isToolbar:!0}),o&&(0,c.createElement)(ti,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=_r}){const{orientation:i="horizontal"}=t,a=n?.spacing?.blockGap&&!ql(o,"spacing","blockGap")?Hr(n?.spacing?.blockGap,"0.5em"):void 0,s=Yl[t.justifyContent],c=Jl.includes(t.flexWrap)?t.flexWrap:"wrap",u=Ql[t.verticalAlignment],d=Xl[t.justifyContent]||Xl.left;let p="";const m=[];return c&&"wrap"!==c&&m.push(`flex-wrap: ${c}`),"horizontal"===i?(u&&m.push(`align-items: ${u}`),s&&m.push(`justify-content: ${s}`)):(u&&m.push(`justify-content: ${u}`),m.push("flex-direction: column"),m.push(`align-items: ${d}`)),m.length&&(p=`${kr(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&a&&(p+=yr(e,l,"flex",a)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ti({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?Ql.center:Ql.top,{verticalAlignment:l=r}=e,i=n=>{t({...e,verticalAlignment:n})};if(n)return(0,c.createElement)(Yr,{onChange:i,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,v.__)("Align items top")},{value:"center",label:(0,v.__)("Align items center")},{value:"flex-end",label:(0,v.__)("Align items bottom")}];return(0,c.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,c.createElement)("legend",null,(0,v.__)("Vertical alignment")),(0,c.createElement)("div",null,a.map(((e,t,n)=>(0,c.createElement)(m.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>i(e)})))))}const ni={placement:"bottom-start"};function oi({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,l=n=>{t({...e,justifyContent:n})},i=["left","center","right"];if("horizontal"===r?i.push("space-between"):i.push("stretch"),n)return(0,c.createElement)(el,{allowedControls:i,value:o,onChange:l,popoverProps:ni});const a=[{value:"left",icon:pr,label:(0,v.__)("Justify items left")},{value:"center",icon:mr,label:(0,v.__)("Justify items center")},{value:"right",icon:fr,label:(0,v.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:gr,label:(0,v.__)("Space between items")}):a.push({value:"stretch",icon:hr,label:(0,v.__)("Stretch items")}),(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n}))))}function ri({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function li({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,v.__)("Orientation"),value:n,onChange:n=>{let l=o,i=r;return"horizontal"===n?("space-between"===o&&(l="center"),"stretch"===r&&(i="left")):("stretch"===o&&(l="top"),"space-between"===r&&(i="left")),t({...e,orientation:n,verticalAlignment:l,justifyContent:i})}},(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:br,value:"horizontal",label:(0,v.__)("Horizontal")}),(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{icon:vr,value:"vertical",label:(0,v.__)("Vertical")}))}var ii={name:"default",label:(0,v.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=_r}){const l=Hr(t?.spacing?.blockGap);let i="";ql(n,"spacing","blockGap")||(l?.top?i=Hr(l?.top):"string"==typeof l&&(i=Hr(l)));let a="";return o&&i&&(a+=yr(e,r,"default",i)),a},getOrientation(){return"vertical"},getAlignments(e,t){const n=Er(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};var ai=(0,c.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,c.cloneElement)(e,{width:t,height:t,...n,ref:o})}));var si=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"}));var ci=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})),ui=window.wp.styleEngine,di={name:"constrained",label:(0,v.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:l="center"}=e,{allowJustification:i=!0}=n,a=[{value:"left",icon:pr,label:(0,v.__)("Justify items left")},{value:"center",icon:mr,label:(0,v.__)("Justify items center")},{value:"right",icon:fr,label:(0,v.__)("Justify items right")}],s=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["%","px","em","rem","vw"]});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:s}),(0,c.createElement)(ai,{icon:si})),(0,c.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,c.createElement)(m.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,v.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:s}),(0,c.createElement)(ai,{icon:ci}))),(0,c.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,v.__)("Customize the width for all elements that are assigned to the center or wide columns.")),i&&(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Justification"),value:l,onChange:n=>{t({...e,justifyContent:n})}},a.map((({value:e,icon:t,label:n})=>(0,c.createElement)(m.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n})))))},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=_r}){const{contentSize:i,wideSize:a,justifyContent:s}=t,c=Hr(n?.spacing?.blockGap);let u="";ql(o,"spacing","blockGap")||(c?.top?u=Hr(c?.top):"string"==typeof c&&(u=Hr(c)));const d="left"===s?"0 !important":"auto !important",p="right"===s?"0 !important":"auto !important";let m=i||a?`\n\t\t\t\t\t${kr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${kr(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${kr(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===s?m+=`${kr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===s&&(m+=`${kr(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,ui.getCSSRules)(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${kr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(m+=`\n\t\t\t\t\t${kr(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return r&&u&&(m+=yr(e,l,"constrained",u)),m},getOrientation(){return"vertical"},getAlignments(e){const t=Er(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 pi={px:600,"%":100,vw:100,vh:100,em:38,rem:38};var mi={name:"grid",label:(0,v.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,c.createElement)(gi,{layout:e,onChange:t}):(0,c.createElement)(fi,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=_r}){const{minimumColumnWidth:i="12rem",columnCount:a=null}=t,s=n?.spacing?.blockGap&&!ql(o,"spacing","blockGap")?Hr(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return a?u.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`):i&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${i}, 100%), 1fr))`),u.length&&(c=`${kr(e)} { ${u.join("; ")}; }`),r&&s&&(c+=yr(e,l,"grid",s)),c},getOrientation(){return"horizontal"},getAlignments(){return[]}};function fi({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,c.createElement)("fieldset",null,(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Minimum column width")),(0,c.createElement)(m.Flex,{gap:4},(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let l;["em","rem"].includes(n)&&"px"===r?l=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n?l=Math.round(16*o)+n:["vh","vw","%"].includes(n)&&o>100&&(l=100+n),t({...e,minimumColumnWidth:l})},value:n,min:0})),(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:pi[r]||600,withInputField:!1}))))}function gi({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,c.createElement)(m.RangeControl,{label:(0,v.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const hi=[ii,ei,di,mi];function bi(e="default"){return hi.find((t=>t.name===e))}const vi={type:"default"},_i=(0,c.createContext)(vi),ki=_i.Provider;function yi(){return(0,c.useContext)(_i)}const Ei=[],wi=["none","left","center","right","wide","full"],Si=["wide","full"];function Ci(e=wi){e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:o}=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),r=yi(),l=bi(r?.type),i=l.getAlignments(r,o);if(n){const t=i.filter((({name:t})=>e.includes(t)));return 1===t.length&&"none"===t[0].name?Ei:t}if("default"!==l.name&&"constrained"!==l.name)return Ei;const{alignments:a=wi}=r,s=e.filter((e=>(r.alignments||t||!Si.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Ei:s}var xi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"}));var Bi=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"}));var Ii=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"}));var Ti=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"}));const Mi={none:{icon:xi,title:(0,v._x)("None","Alignment option")},left:{icon:Bi,title:(0,v.__)("Align left")},center:{icon:si,title:(0,v.__)("Align center")},right:{icon:Ii,title:(0,v.__)("Align right")},wide:{icon:ci,title:(0,v.__)("Wide width")},full:{icon:Ti,title:(0,v.__)("Full width")}};var Pi=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const l=Ci(n);if(!!!l.length)return null;function i(n){t([e,"none"].includes(n)?void 0:n)}const a=Mi[e],s=Mi.none,u=o?m.ToolbarGroup:m.ToolbarDropdownMenu,p={icon:a?a.icon:s.icon,label:(0,v.__)("Align")},f=o?{isCollapsed:r,controls:l.map((({name:t})=>({...Mi[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>i(t)})))}:{toggleProps:{describedBy:(0,v.__)("Change alignment")},children:({onClose:t})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},l.map((({name:n,info:o})=>{const{icon:r,title:l}=Mi[n],a=n===e||!e&&"none"===n;return(0,c.createElement)(m.MenuItem,{key:n,icon:r,iconPosition:"left",className:d()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{i(n),t()},role:"menuitemradio",info:o},l)}))))};return(0,c.createElement)(u,{...p,...f})};const Ni=e=>(0,c.createElement)(Pi,{...e,isToolbar:!1}),Li=e=>(0,c.createElement)(Pi,{...e,isToolbar:!0}),Ri=(0,c.createContext)(null);function Ai(e){var t;const{clientId:n=""}=null!==(t=(0,c.useContext)(Ri))&&void 0!==t?t:{},o=(0,f.useSelect)((e=>e(Jo).getBlockEditingMode(n)),[n]),{setBlockEditingMode:r,unsetBlockEditingMode:l}=(0,f.useDispatch)(Jo);return(0,c.useEffect)((()=>(e&&r(n,e),()=>{e&&l(n)})),[n,e,r,l]),o}const Di=["left","center","right","wide","full"],Oi=["wide","full"];function zi(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Di.filter((t=>e.includes(t))):!0===e?[...Di]:[],!n||!0===e&&!t?o.filter((e=>!Oi.includes(e))):o}const Vi=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,c.createElement)(e,{key:"edit",...t}),{name:o}=t,r=Ci(zi((0,a.getBlockSupport)(o,"align"),(0,a.hasBlockSupport)(o,"alignWide",!0))).map((({name:e})=>e)),l=Ai();if(!r.length||"default"!==l)return n;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(dr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(Ni,{value:t.attributes.align,onChange:e=>{if(!e){const n=(0,a.getBlockType)(t.name),o=n?.attributes?.align?.default;o&&(e="")}t.setAttributes({align:e})},controls:r})),n)}),"withToolbarControls"),Fi=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:r}=o,l=Ci(zi((0,a.getBlockSupport)(n,"align"),(0,a.hasBlockSupport)(n,"alignWide",!0)));if(void 0===r)return(0,c.createElement)(e,{...t});let i=t.wrapperProps;return l.some((e=>e.name===r))&&(i={...i,"data-align":r}),(0,c.createElement)(e,{...t,wrapperProps:i})}),"withDataAlign");(0,s.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Di,""]}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Fi),(0,s.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Vi),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return zi((0,a.getBlockSupport)(t,"align"),(0,a.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=d()(`align${o}`,e.className)),e})),(0,s.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Hi=(0,m.createSlotFill)("InspectorControls"),Gi=(0,m.createSlotFill)("InspectorAdvancedControls"),Ui=(0,m.createSlotFill)("InspectorControlsBackground"),$i=(0,m.createSlotFill)("InspectorControlsBorder"),ji=(0,m.createSlotFill)("InspectorControlsColor"),Wi=(0,m.createSlotFill)("InspectorControlsFilter"),Ki=(0,m.createSlotFill)("InspectorControlsDimensions"),qi=(0,m.createSlotFill)("InspectorControlsPosition"),Zi=(0,m.createSlotFill)("InspectorControlsTypography");var Yi={default:Hi,advanced:Gi,background:Ui,border:$i,color:ji,dimensions:Ki,filter:Wi,list:(0,m.createSlotFill)("InspectorControlsListView"),position:qi,settings:Hi,styles:(0,m.createSlotFill)("InspectorControlsStyles"),typography:Zi};function Xi({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&($()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=lr(),l=Yi[t]?.Fill;return l&&r?(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(l,null,(t=>(0,c.createElement)(Ji,{fillProps:t,children:e,resetAllFilter:o})))):null}function Qi({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,c.useContext)(m.__experimentalToolsPanelContext);return(0,c.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function Ji({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,c.createElement)(Qi,{resetAllFilter:t},e);return o.reduce(((e,[t,n])=>(0,c.createElement)(t,{...n},e)),r)}function ea({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,f.useDispatch)(Jo),{getBlockAttributes:r,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:i,hasMultiSelection:a}=(0,f.useSelect)(Jo),s=i(),u=(0,c.useCallback)(((e=[])=>{const t={},n=a()?l():[s];n.forEach((n=>{const{style:o}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:Wl(l.style)},t[n]=l})),o(n,t,!0)}),[r,l,a,s,o]);return(0,c.createElement)(m.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:u,key:s,panelId:s,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},e)}function ta({Slot:e,fillProps:t,...n}){const o=(0,c.useContext)(m.__experimentalToolsPanelContext),r=(0,c.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[m.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,c.createElement)(e,{...n,fillProps:r,bubblesVirtually:!0})}function na({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&($()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const l=Yi[t]?.Slot,i=(0,m.__experimentalUseSlotFills)(l?.__unstableName),a=(0,c.useContext)(m.__unstableMotionContext),s=(0,c.useMemo)((()=>{var e;return{...null!=o?o:{},forwardedContext:[...null!==(e=o?.forwardedContext)&&void 0!==e?e:[],[m.__unstableMotionContext.Provider,{value:a}]]}}),[a,o]);return l&&i?.length?n?(0,c.createElement)(ea,{group:t,label:n},(0,c.createElement)(ta,{...r,fillProps:s,Slot:l})):(0,c.createElement)(l,{...r,fillProps:s,bubblesVirtually:!0}):null}const oa=Xi;oa.Slot=na;const ra=e=>(0,c.createElement)(Xi,{...e,group:"advanced"});ra.Slot=e=>(0,c.createElement)(na,{...e,group:"advanced"}),ra.slotName="InspectorAdvancedControls";var la=oa;const ia=/[\s#]/g,aa={type:"string",source:"attribute",attribute:"id",selector:"*"};const sa=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"anchor"),o=Ai();if(n&&t.isSelected){const n="web"===c.Platform.OS,r=(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,v.__)("HTML anchor"),help:(0,c.createElement)(c.Fragment,null,(0,v.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,v.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,v.__)("Add an anchor"),onChange:e=>{e=e.replace(ia,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),n&&"default"===o&&(0,c.createElement)(la,{group:"advanced"},r),!n&&"core/heading"===t.name&&(0,c.createElement)(la,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Heading settings")},r)))}return(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||(0,a.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:aa}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",sa),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const ca={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,s.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,a.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:ca}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const ua=(0,p.createHigherOrderComponent)((e=>t=>{const n=Ai();return(0,a.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),"default"===n&&(0,c.createElement)(la,{group:"advanced"},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,v.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,v.__)("Separate multiple classes with spaces.")}))):(0,c.createElement)(e,{...t})}),"withInspectorControl");(0,s.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,a.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",ua),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,a.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=d()(e.className,n.className)),e})),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,a.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]){const o=t[n]?.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,a.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,a.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,a.getBlockDefaultClassName)(t.name)),e}));var da=window.wp.dom;const pa=(0,c.createContext)({});function ma({value:e,children:t}){const n=(0,c.useContext)(pa),o=(0,c.useMemo)((()=>({...n,...e})),[n,e]);return(0,c.createElement)(pa.Provider,{value:o,children:t})}var fa=pa;const ga={},ha=(0,m.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,a.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,c.createElement)(o,{...e})}));var ba=e=>{const{attributes:t={},name:n}=e,o=(0,a.getBlockType)(n),r=(0,c.useContext)(fa),l=(0,c.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):ga),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,c.createElement)(ha,{...e,context:l});const i=(0,a.hasBlockSupport)(o,"className",!0)?(0,a.getBlockDefaultClassName)(n):null,s=d()(i,t.className,e.className);return(0,c.createElement)(ha,{...e,context:l,className:s})};function va(e){const{name:t,isSelected:n,clientId:o,attributes:r={},__unstableLayoutClassNames:l}=e,{layout:i=null}=r,s={name:t,isSelected:n,clientId:o,layout:(0,a.hasBlockSupport)(t,"layout",!1)||(0,a.hasBlockSupport)(t,"__experimentalLayout",!1)?i:null,__unstableLayoutClassNames:l};return(0,c.createElement)(or,{value:(0,c.useMemo)((()=>s),Object.values(s))},(0,c.createElement)(ba,{...e}))}var _a=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var ka=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,c.createElement)("div",{style:{display:"contents",all:"initial"}},(0,c.createElement)("div",{className:d()(e,"block-editor-warning")},(0,c.createElement)("div",{className:"block-editor-warning__contents"},(0,c.createElement)("p",{className:"block-editor-warning__message"},n),(c.Children.count(t)>0||o)&&(0,c.createElement)("div",{className:"block-editor-warning__actions"},c.Children.count(t)>0&&c.Children.map(t,((e,t)=>(0,c.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,c.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:_a,label:(0,v.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,c.createElement)(m.MenuGroup,null,o.map(((e,t)=>(0,c.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},ya=n(1973);function Ea({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:l}){return(0,c.createElement)("div",{className:l},(0,c.createElement)("div",{className:"block-editor-block-compare__content"},(0,c.createElement)("h2",{className:"block-editor-block-compare__heading"},e),(0,c.createElement)("div",{className:"block-editor-block-compare__html"},t),(0,c.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,c.createElement)(c.RawHTML,null,(0,da.safeHTML)(n)))),(0,c.createElement)("div",{className:"block-editor-block-compare__action"},(0,c.createElement)(m.Button,{variant:"secondary",tabIndex:"0",onClick:o},r)))}var wa=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const l=(i=o(e),(Array.isArray(i)?i:[i]).map((e=>(0,a.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var i;const s=(u=e.originalContent,p=l,(0,ya.Kx)(u,p).map(((e,t)=>{const n=d()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,c.createElement)("span",{key:t,className:n},e.value)})));var u,p;return(0,c.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,c.createElement)(Ea,{title:(0,v.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,v.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,c.createElement)(Ea,{title:(0,v.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:s,renderedContent:l}))};const Sa=e=>(0,a.rawHandler)({HTML:e.originalContent});function Ca({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,f.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(Jo),l=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",l),canInsertClassicBlock:n("core/freeform",l)}}),[e]),{replaceBlock:r}=(0,f.useDispatch)(Jo),[l,i]=(0,c.useState)(!1),s=(0,c.useCallback)((()=>i(!1)),[]),u=(0,c.useMemo)((()=>({toClassic(){const e=(0,a.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,a.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=Sa(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,a.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),d=(0,c.useMemo)((()=>[{title:(0,v._x)("Resolve","imperative verb"),onClick:()=>i(!0)},n&&{title:(0,v.__)("Convert to HTML"),onClick:u.toHTML},o&&{title:(0,v.__)("Convert to Classic Block"),onClick:u.toClassic}].filter(Boolean)),[n,o,u]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ka,{actions:[(0,c.createElement)(m.Button,{key:"recover",onClick:u.toRecoveredBlock,variant:"primary"},(0,v.__)("Attempt Block Recovery"))],secondaryActions:d},(0,v.__)("This block contains unexpected or invalid content.")),l&&(0,c.createElement)(m.Modal,{title:(0,v.__)("Resolve Block"),onRequestClose:s,className:"block-editor-block-compare"},(0,c.createElement)(wa,{block:t,onKeep:u.toHTML,onConvert:u.toBlocks,convertor:Sa,convertButtonText:(0,v.__)("Convert to Blocks")})))}const xa=(0,c.createElement)(ka,{className:"block-editor-block-list__block-crash-warning"},(0,v.__)("This block has encountered an error and cannot be previewed."));var Ba=()=>xa;class Ia extends c.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 Ta=Ia,Ma=n(773);var Pa=function({clientId:e}){const[t,n]=(0,c.useState)(""),o=(0,f.useSelect)((t=>t(Jo).getBlock(e)),[e]),{updateBlock:r}=(0,f.useDispatch)(Jo);return(0,c.useEffect)((()=>{n((0,a.getBlockContent)(o))}),[o]),(0,c.createElement)(Ma.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const l=(0,a.getBlockType)(o.name);if(!l)return;const i=(0,a.getBlockAttributes)(l,t,o.attributes),s=t||(0,a.getSaveContent)(l,i),[c]=t?(0,a.validateBlock)({...o,attributes:i,originalContent:s}):[!0];r(e,{attributes:i,originalContent:s,isValid:c}),t||n(s)},onChange:e=>n(e.target.value)})},Na=qa(),La=e=>$a(e,Na),Ra=qa();La.write=e=>$a(e,Ra);var Aa=qa();La.onStart=e=>$a(e,Aa);var Da=qa();La.onFrame=e=>$a(e,Da);var Oa=qa();La.onFinish=e=>$a(e,Oa);var za=[];La.setTimeout=(e,t)=>{let n=La.now()+t,o=()=>{let e=za.findIndex((e=>e.cancel==o));~e&&za.splice(e,1),Ga-=~e?1:0},r={time:n,handler:e,cancel:o};return za.splice(Va(n),0,r),Ga+=1,ja(),r};var Va=e=>~(~za.findIndex((t=>t.time>e))||~za.length);La.cancel=e=>{Aa.delete(e),Da.delete(e),Oa.delete(e),Na.delete(e),Ra.delete(e)},La.sync=e=>{Ua=!0,La.batchedUpdates(e),Ua=!1},La.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,La.onStart(n)}return o.handler=e,o.cancel=()=>{Aa.delete(n),t=null},o};var Fa=typeof window<"u"?window.requestAnimationFrame:()=>{};La.use=e=>Fa=e,La.now=typeof performance<"u"?()=>performance.now():Date.now,La.batchedUpdates=e=>e(),La.catch=console.error,La.frameLoop="always",La.advance=()=>{"demand"!==La.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ka()};var Ha=-1,Ga=0,Ua=!1;function $a(e,t){Ua?(t.delete(e),e(0)):(t.add(e),ja())}function ja(){Ha<0&&(Ha=0,"demand"!==La.frameLoop&&Fa(Wa))}function Wa(){~Ha&&(Fa(Wa),La.batchedUpdates(Ka))}function Ka(){let e=Ha;Ha=La.now();let t=Va(Ha);t&&(Za(za.splice(0,t),(e=>e.handler())),Ga-=t),Ga?(Aa.flush(),Na.flush(e?Math.min(64,Ha-e):16.667),Da.flush(),Ra.flush(),Oa.flush()):Ha=-1}function qa(){let e=new Set,t=e;return{add(n){Ga+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return Ga-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Ga-=t.size,Za(t,(t=>t(n)&&e.add(t))),Ga+=e.size,t=e)}}}function Za(e,t){e.forEach((e=>{try{t(e)}catch(e){La.catch(e)}}))}var Ya=n(9196),Xa=n.n(Ya),Qa=Object.defineProperty,Ja={};function es(){}((e,t)=>{for(var n in t)Qa(e,n,{get:t[n],enumerable:!0})})(Ja,{assign:()=>fs,colors:()=>ds,createStringInterpolator:()=>as,skipAnimation:()=>ps,to:()=>ss,willAdvance:()=>ms});var ts={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 ns(e,t){if(ts.arr(e)){if(!ts.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}var os=(e,t)=>e.forEach(t);function rs(e,t,n){if(ts.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(let o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}var ls=e=>ts.und(e)?[]:ts.arr(e)?e:[e];function is(e,t){if(e.size){let n=Array.from(e);e.clear(),os(n,t)}}var as,ss,cs=(e,...t)=>is(e,(e=>e(...t))),us=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ds=null,ps=!1,ms=es,fs=e=>{e.to&&(ss=e.to),e.now&&(La.now=e.now),void 0!==e.colors&&(ds=e.colors),null!=e.skipAnimation&&(ps=e.skipAnimation),e.createStringInterpolator&&(as=e.createStringInterpolator),e.requestAnimationFrame&&La.use(e.requestAnimationFrame),e.batchedUpdates&&(La.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ms=e.willAdvance),e.frameLoop&&(La.frameLoop=e.frameLoop)},gs=new Set,hs=[],bs=[],vs=0,_s={get idle(){return!gs.size&&!hs.length},start(e){vs>e.priority?(gs.add(e),La.onStart(ks)):(ys(e),La(ws))},advance:ws,sort(e){if(vs)La.onFrame((()=>_s.sort(e)));else{let t=hs.indexOf(e);~t&&(hs.splice(t,1),Es(e))}},clear(){hs=[],gs.clear()}};function ks(){gs.forEach(ys),gs.clear(),La(ws)}function ys(e){hs.includes(e)||Es(e)}function Es(e){hs.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(hs,(t=>t.priority>e.priority)),0,e)}function ws(e){let t=bs;for(let n=0;n<hs.length;n++){let o=hs[n];vs=o.priority,o.idle||(ms(o),o.advance(e),o.idle||t.push(o))}return vs=0,(bs=hs).length=0,(hs=t).length>0}var Ss="[-+]?\\d*\\.?\\d+",Cs=Ss+"%";function xs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Bs=new RegExp("rgb"+xs(Ss,Ss,Ss)),Is=new RegExp("rgba"+xs(Ss,Ss,Ss,Ss)),Ts=new RegExp("hsl"+xs(Ss,Cs,Cs)),Ms=new RegExp("hsla"+xs(Ss,Cs,Cs,Ss)),Ps=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ns=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ls=/^#([0-9a-fA-F]{6})$/,Rs=/^#([0-9a-fA-F]{8})$/;function As(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 Ds(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=As(r,o,e+1/3),i=As(r,o,e),a=As(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function Os(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function zs(e){return(parseFloat(e)%360+360)%360/360}function Vs(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Fs(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Hs(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ls.exec(e))?parseInt(t[1]+"ff",16)>>>0:ds&&void 0!==ds[e]?ds[e]:(t=Bs.exec(e))?(Os(t[1])<<24|Os(t[2])<<16|Os(t[3])<<8|255)>>>0:(t=Is.exec(e))?(Os(t[1])<<24|Os(t[2])<<16|Os(t[3])<<8|Vs(t[4]))>>>0:(t=Ps.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Rs.exec(e))?parseInt(t[1],16)>>>0:(t=Ns.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Ts.exec(e))?(255|Ds(zs(t[1]),Fs(t[2]),Fs(t[3])))>>>0:(t=Ms.exec(e))?(Ds(zs(t[1]),Fs(t[2]),Fs(t[3]))|Vs(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})`)}var Gs=(e,t,n)=>{if(ts.fun(e))return e;if(ts.arr(e))return Gs({range:e,output:t,extrapolate:n});if(ts.str(e.output[0]))return as(e);let 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=>{let 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)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],s,i,a,o.map)}};var Us=1.70158,$s=1.525*Us,js=Us+1,Ws=2*Math.PI/3,Ks=2*Math.PI/4.5,qs=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Zs={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=>js*e*e*e-Us*e*e,easeOutBack:e=>1+js*Math.pow(e-1,3)+Us*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*($s+1)*e-$s)/2:(Math.pow(2*e-2,2)*(($s+1)*(2*e-2)+$s)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Ws),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Ws)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Ks)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Ks)/2+1,easeInBounce:e=>1-qs(1-e),easeOutBounce:qs,easeInOutBounce:e=>e<.5?(1-qs(1-2*e))/2:(1+qs(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},Ys=Symbol.for("FluidValue.get"),Xs=Symbol.for("FluidValue.observers"),Qs=e=>Boolean(e&&e[Ys]),Js=e=>e&&e[Ys]?e[Ys]():e,ec=e=>e[Xs]||null;function tc(e,t){let n=e[Xs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var nc=class{[Ys];[Xs];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");oc(this,e)}},oc=(e,t)=>ac(e,Ys,t);function rc(e,t){if(e[Ys]){let n=e[Xs];n||ac(e,Xs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function lc(e,t){let n=e[Xs];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[Xs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var ic,ac=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),sc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,cc=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,uc=new RegExp(`(${sc.source})(%|[a-z]+)`,"i"),dc=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,pc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,mc=e=>{let[t,n]=fc(e);if(!t||us())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&pc.test(n)?mc(n):n||e},fc=e=>{let t=pc.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},gc=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,hc=e=>{ic||(ic=ds?new RegExp(`(${Object.keys(ds).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>Js(e).replace(pc,mc).replace(cc,Hs).replace(ic,Hs))),n=t.map((e=>e.match(sc).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Gs({...e,output:t})));return e=>{let n=!uc.test(t[0])&&t.find((e=>uc.test(e)))?.replace(sc,""),r=0;return t[0].replace(sc,(()=>`${o[r++](e)}${n||""}`)).replace(dc,gc)}},bc="react-spring: ",vc=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${bc}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},_c=vc(console.warn);var kc=vc(console.warn);function yc(e){return ts.str(e)&&("#"==e[0]||/\d/.test(e)||!us()&&pc.test(e)||e in(ds||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var Ec=us()?Ya.useEffect:Ya.useLayoutEffect,wc=()=>{let e=(0,Ya.useRef)(!1);return Ec((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function Sc(){let e=(0,Ya.useState)()[1],t=wc();return()=>{t.current&&e(Math.random())}}var Cc=e=>(0,Ya.useEffect)(e,xc),xc=[];function Bc(e){let t=(0,Ya.useRef)();return(0,Ya.useEffect)((()=>{t.current=e})),t.current}var Ic=Symbol.for("Animated:node"),Tc=e=>e&&e[Ic],Mc=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Ic,t),Pc=e=>e&&e[Ic]&&e[Ic].getPayload(),Nc=class{payload;constructor(){Mc(this,this)}getPayload(){return this.payload||[]}},Lc=class extends Nc{constructor(e){super(),this._value=e,ts.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Lc(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ts.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(){let{done:e}=this;this.done=!1,ts.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Rc=class extends Lc{_string=null;_toString;constructor(e){super(0),this._toString=Gs({output:[e,e]})}static create(e){return new Rc(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ts.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=Gs({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ac={dependencies:null},Dc=class extends Nc{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return rs(this.source,((n,o)=>{(e=>!!e&&e[Ic]===e)(n)?t[o]=n.getValue(e):Qs(n)?t[o]=Js(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&os(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return rs(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ac.dependencies&&Qs(e)&&Ac.dependencies.add(e);let t=Pc(e);t&&os(t,(e=>this.add(e)))}},Oc=class extends Dc{constructor(e){super(e)}static create(e){return new Oc(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(zc)),!0)}};function zc(e){return(yc(e)?Rc:Lc).create(e)}function Vc(e){let t=Tc(e);return t?t.constructor:ts.arr(e)?Oc:yc(e)?Rc:Lc}var Fc=(e,t)=>{let n=!ts.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ya.forwardRef)(((o,r)=>{let l=(0,Ya.useRef)(null),i=n&&(0,Ya.useCallback)((e=>{l.current=function(e,t){return e&&(ts.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,s]=function(e,t){let n=new Set;return Ac.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Dc(e),Ac.dependencies=null,[e,n]}(o,t),c=Sc(),u=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Hc(u,s),p=(0,Ya.useRef)();Ec((()=>(p.current=d,os(s,(e=>rc(e,d))),()=>{p.current&&(os(p.current.deps,(e=>lc(e,p.current))),La.cancel(p.current.update))}))),(0,Ya.useEffect)(u,[]),Cc((()=>()=>{let e=p.current;os(e.deps,(t=>lc(t,e)))}));let m=t.getComponentProps(a.getValue());return Ya.createElement(e,{...m,ref:i})}))},Hc=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&La.write(this.update)}};var Gc=Symbol.for("AnimatedComponent"),Uc=e=>ts.str(e)?e:e&&ts.str(e.displayName)?e.displayName:ts.fun(e)&&e.name||null;function $c(e,...t){return ts.fun(e)?e(...t):e}var jc=(e,t)=>!0===e||!!(t&&e&&(ts.fun(e)?e(t):ls(e).includes(t))),Wc=(e,t)=>ts.obj(e)?t&&e[t]:e,Kc=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,qc=e=>e,Zc=(e,t=qc)=>{let n=Yc;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);ts.und(n)||(o[r]=n)}return o},Yc=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Xc={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 Qc(e){let t=function(e){let t={},n=0;if(rs(e,((e,o)=>{Xc[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return rs(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Jc(e){return e=Js(e),ts.arr(e)?e.map(Jc):yc(e)?Ja.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function eu(e){for(let t in e)return!0;return!1}function tu(e){return ts.fun(e)||ts.arr(e)&&ts.obj(e[0])}function nu(e,t){e.ref?.delete(e),t?.delete(e)}function ou(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var ru={tension:170,friction:26,mass:1,damping:1,easing:Zs.linear,clamp:!1};function lu(e,t){if(ts.und(t.decay)){let n=!ts.und(t.tension)||!ts.und(t.friction);(n||!ts.und(t.frequency)||!ts.und(t.damping)||!ts.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var iu=[];function au(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,a)=>{let s,c,u=jc(n.cancel??o?.cancel,t);if(u)m();else{ts.und(n.pause)||(r.paused=jc(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||jc(e,t)),s=$c(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),s=c.time-La.now()}function p(){s>0&&!Ja.skipAnimation?(r.delayed=!0,c=La.setTimeout(m,s),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){a(e)}}}))}var su=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?du(e.get()):t.every((e=>e.noop))?cu(e.get()):uu(e.get(),t.every((e=>e.finished))),cu=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),uu=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),du=e=>({value:e,cancelled:!0,finished:!1});function pu(e,t,n,o){let{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;let c,u,d,p=Zc(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=r<=(n.cancelId||0)&&du(o)||r!==n.asyncId&&uu(o,!1);if(t)throw e.result=t,u(e),e},g=(e,t)=>{let l=new fu,i=new gu;return(async()=>{if(Ja.skipAnimation)throw mu(n),i.result=uu(o,!1),u(i),i;f(l);let a=ts.obj(e)?{...e}:{...t,to:e};a.parentId=r,rs(p,((e,t)=>{ts.und(a[t])&&(a[t]=e)}));let s=await o.start(a);return f(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(Ja.skipAnimation)return mu(n),uu(o,!1);try{let t;t=ts.arr(e)?(async e=>{for(let t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=uu(o.get(),!0,!1)}catch(e){if(e instanceof fu)d=e.result;else{if(!(e instanceof gu))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?a:void 0,n.promise=l?s:void 0)}return ts.fun(i)&&La.batchedUpdates((()=>{i(d,o,o.item)})),d})():s}function mu(e,t){is(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var fu=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},gu=class extends Error{result;constructor(){super("SkipAnimationSignal")}},hu=e=>e instanceof vu,bu=1,vu=class extends nc{id=bu++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Tc(this);return e&&e.getValue()}to(...e){return Ja.to(this,e)}interpolate(...e){return _c(`${bc}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ja.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){tc(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||_s.sort(this),tc(this,{type:"priority",parent:this,priority:e})}},_u=Symbol.for("SpringPhase"),ku=e=>(1&e[_u])>0,yu=e=>(2&e[_u])>0,Eu=e=>(4&e[_u])>0,wu=(e,t)=>t?e[_u]|=3:e[_u]&=-3,Su=(e,t)=>t?e[_u]|=4:e[_u]&=-5,Cu=class extends vu{key;animation=new class{changed=!1;values=iu;toValues=null;fromValues=iu;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,ru)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!ts.und(e)||!ts.und(t)){let n=ts.obj(e)?{...e}:{...t,from:e};ts.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(yu(this)||this._state.asyncTo)||Eu(this)}get goal(){return Js(this.animation.to)}get velocity(){let e=Tc(this);return e instanceof Lc?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ku(this)}get isAnimating(){return yu(this)}get isPaused(){return Eu(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:l}=o,i=Pc(o.to);!i&&Qs(o.to)&&(l=ls(Js(o.to))),o.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==Rc?1:i?i[s].lastPosition:l[s],u=o.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,l=o.fromValues[s],i=null!=a.v0?a.v0:a.v0=ts.arr(r.velocity)?r.velocity[s]:r.velocity,p=r.precision||(l==c?.005:Math.min(1,.001*Math.abs(c-l)));if(ts.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=l+i/(1-e)*(1-o),u=Math.abs(a.lastPosition-d)<=p,t=i*o}else{t=null==a.lastVelocity?i:a.lastVelocity;let n,o=r.restVelocity||p/10,s=r.clamp?0:r.bounce,m=!ts.und(s),f=l==c?a.v0>0:l<c,g=!1,h=1,b=Math.ceil(e/h);for(let e=0;e<b&&(n=Math.abs(t)>o,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(g=d==c||d>c==f,g&&(t=-t*s,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*h,d+=t*h}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,n=a.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,a.durationProgress=o),d=l+r.easing(o)*(c-l),t=(d-a.lastPosition)/e,u=1==o}a.lastVelocity=t,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)}));let a=Tc(this),s=a.getValue();if(t){let e=Js(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 La.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yu(this)){let{to:e,config:t}=this.animation;La.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 ts.und(e)?(n=this.queue||[],this.queue=[]):n=[ts.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>su(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),mu(this._state,e&&this._lastCallId),La.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){let t=this.key||"",{to:n,from:o}=e;n=ts.obj(n)?n[t]:n,(null==n||tu(n))&&(n=void 0),o=ts.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return ku(this)||(e.reverse&&([n,o]=[o,n]),o=Js(o),ts.und(o)?Tc(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Zc(e,((e,t)=>/^on/.test(t)?Wc(e,n):e))),Nu(this,e,"onProps"),Lu(this,"onProps",e,this);let r=this._prepareNode(e);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?");let l=this._state;return au(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{Eu(this)||(Su(this,!0),cs(l.pauseQueue),Lu(this,"onPause",uu(this,xu(this,this.animation.to)),this))},resume:()=>{Eu(this)&&(Su(this,!1),yu(this)&&this._resume(),cs(l.resumeQueue),Lu(this,"onResume",uu(this,xu(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=Bu(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(du(this));let o=!ts.und(e.to),r=!ts.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(du(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;r&&!o&&(!t.default||ts.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!ns(d,c);p&&(a.from=d),d=Js(d);let m=!ns(u,s);m&&this._focus(u);let f=tu(t.to),{config:g}=a,{decay:h,velocity:b}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(lu(n={...n},t),t={...n,...t}),lu(e,t),Object.assign(e,t);for(let t in ru)null==e[t]&&(e[t]=ru[t]);let{mass:o,frequency:r,damping:l}=e;ts.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,$c(t.config,l),t.config!==i.config?$c(i.config,l):void 0);let v=Tc(this);if(!v||ts.und(u))return n(uu(this,!0));let _=ts.und(t.reset)?r&&!t.default:!ts.und(d)&&jc(t.reset,l),k=_?d:this.get(),y=Jc(u),E=ts.num(y)||ts.arr(y)||yc(y),w=!f&&(!E||jc(i.immediate||t.immediate,l));if(m){let e=Vc(u);if(e!==v.constructor){if(!w)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(y)}}let S=v.constructor,C=Qs(u),x=!1;if(!C){let e=_||!ku(this)&&p;(m||e)&&(x=ns(Jc(k),y),C=!x),(!ns(a.immediate,w)&&!w||!ns(g.decay,h)||!ns(g.velocity,b))&&(C=!0)}if(x&&yu(this)&&(a.changed&&!_?C=!0:C||this._stop(s)),!f&&((C||Qs(s))&&(a.values=v.getPayload(),a.toValues=Qs(u)?null:S==Rc?[1]:ls(y)),a.immediate!=w&&(a.immediate=w,!w&&!_&&this._set(s)),C)){let{onRest:e}=a;os(Pu,(e=>Nu(this,t,e)));let o=uu(this,xu(this,s));cs(this._pendingCalls,o),this._pendingCalls.add(n),a.changed&&La.batchedUpdates((()=>{a.changed=!_,e?.(o,this),_?$c(i.onRest,o):a.onStart?.(o,this)}))}_&&this._set(k),f?n(pu(t.to,t,this._state,this)):C?this._start():yu(this)&&!m?this._pendingCalls.add(n):n(cu(k))}_focus(e){let t=this.animation;e!==t.to&&(ec(this)&&this._detach(),t.to=e,ec(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Qs(t)&&(rc(t,this),hu(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Qs(e)&&lc(e,this)}_set(e,t=!0){let n=Js(e);if(!ts.und(n)){let e=Tc(this);if(!e||!ns(n,e.getValue())){let o=Vc(n);e&&e.constructor==o?e.setValue(n):Mc(this,o.create(n)),e&&La.batchedUpdates((()=>{this._onChange(n,t)}))}}return Tc(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Lu(this,"onStart",uu(this,xu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),$c(this.animation.onChange,e,this)),$c(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Tc(this).reset(Js(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),yu(this)||(wu(this,!0),Eu(this)||this._resume())}_resume(){Ja.skipAnimation?this.finish():_s.start(this)}_stop(e,t){if(yu(this)){wu(this,!1);let n=this.animation;os(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),tc(this,{type:"idle",parent:this});let o=t?du(this.get()):uu(this.get(),xu(this,e??n.to));cs(this._pendingCalls,o),n.changed&&(n.changed=!1,Lu(this,"onRest",o,this))}}};function xu(e,t){let n=Jc(t);return ns(Jc(e.get()),n)}function Bu(e,t=e.loop,n=e.to){let o=$c(t);if(o){let r=!0!==o&&Qc(o),l=(r||e).reverse,i=!r||r.reset;return Iu({...e,loop:t,default:!1,pause:void 0,to:!l||tu(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Iu(e){let{to:t,from:n}=e=Qc(e),o=new Set;return ts.obj(t)&&Mu(t,o),ts.obj(n)&&Mu(n,o),e.keys=o.size?Array.from(o):null,e}function Tu(e){let t=Iu(e);return ts.und(t.default)&&(t.default=Zc(t)),t}function Mu(e,t){rs(e,((e,n)=>null!=e&&t.add(n)))}var Pu=["onStart","onRest","onChange","onPause","onResume"];function Nu(e,t,n){e.animation[n]=t[n]!==Kc(t,n)?Wc(t[n],e.key):void 0}function Lu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Ru=["onStart","onChange","onRest"],Au=1,Du=class{id=Au++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({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(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];ts.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Iu(e)),this}start(e){let{queue:t}=this;return e?t=ls(e).map(Iu):this.queue=[],this._flush?this._flush(this,t):(Uu(this,t),Ou(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;os(ls(t),(t=>n[t].stop(!!e)))}else mu(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ts.und(e))this.start({pause:!0});else{let t=this.springs;os(ls(e),(e=>t[e].pause()))}return this}resume(e){if(ts.und(e))this.start({pause:!1});else{let t=this.springs;os(ls(e),(e=>t[e].resume()))}return this}each(e){rs(this.springs,e)}_onFrame(){let{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,is(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&is(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,is(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)}La.onFrame(this._onFrame)}};function Ou(e,t){return Promise.all(t.map((t=>zu(e,t)))).then((t=>su(e,t)))}async function zu(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:a,onResolve:s}=t,c=ts.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=ts.arr(r)||ts.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):os(Ru,(n=>{let o=t[n];if(ts.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let 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])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,cs(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Kc(t,"cancel");(u||m&&d.asyncId)&&p.push(au(++e._lastAsyncId,{props:t,state:d,actions:{pause:es,resume:es,start(t,n){m?(mu(d,e._lastAsyncId),n(du(e))):(t.onRest=a,n(pu(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=su(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){let n=Bu(t,i,r);if(n)return Uu(e,[n]),zu(e,n,!0)}return s&&La.batchedUpdates((()=>s(f,e,e.item))),f}function Vu(e,t){let n={...e.springs};return t&&os(ls(t),(e=>{ts.und(e.keys)&&(e=Iu(e)),ts.obj(e.to)||(e={...e,to:void 0}),Gu(n,e,(e=>Hu(e)))})),Fu(e,n),n}function Fu(e,t){rs(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,rc(t,e))}))}function Hu(e,t){let n=new Cu;return n.key=e,t&&rc(n,t),n}function Gu(e,t,n){t.keys&&os(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Uu(e,t){os(t,(t=>{Gu(e.springs,t,(t=>Hu(t,e)))}))}var $u=({children:e,...t})=>{let n=(0,Ya.useContext)(ju),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,Ya.useState)((()=>({inputs:t,result:e()}))),o=(0,Ya.useRef)(),r=o.current,l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,Ya.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=ju;return Ya.createElement(l,{value:t},e)},ju=function(e,t){return Object.assign(e,Ya.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}($u,{});$u.Provider=ju.Provider,$u.Consumer=ju.Consumer;var Wu=()=>{let e=[],t=function(t){kc(`${bc}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`);let o=[];return os(e,((e,r)=>{if(ts.und(t))o.push(e.start());else{let 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){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return os(e,(e=>e.pause(...arguments))),this},t.resume=function(){return os(e,(e=>e.resume(...arguments))),this},t.set=function(t){os(e,((e,n)=>{let o=ts.fun(t)?t(n,e):t;o&&e.set(o)}))},t.start=function(t){let n=[];return os(e,((e,o)=>{if(ts.und(t))n.push(e.start());else{let r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return os(e,(e=>e.stop(...arguments))),this},t.update=function(t){return os(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return ts.fun(e)?e(n,t):e};return t._getProps=n,t};function Ku(e,t,n){let o=ts.fun(t)&&t;o&&!n&&(n=[]);let r=(0,Ya.useMemo)((()=>o||3==arguments.length?Wu():void 0),[]),l=(0,Ya.useRef)(0),i=Sc(),a=(0,Ya.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=Vu(e,t);return l.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ou(e,t):new Promise((o=>{Fu(e,n),a.queue.push((()=>{o(Ou(e,t))})),i()}))}})),[]),s=(0,Ya.useRef)([...a.ctrls]),c=[],u=Bc(e)||0;function d(e,n){for(let r=e;r<n;r++){let e=s.current[r]||(s.current[r]=new Du(null,a.flush)),n=o?o(r,e):t[r];n&&(c[r]=Tu(n))}}(0,Ya.useMemo)((()=>{os(s.current.slice(e,u),(e=>{nu(e,r),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,Ya.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>Vu(e,c[t]))),m=(0,Ya.useContext)($u),f=Bc(m),g=m!==f&&eu(m);Ec((()=>{l.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],os(e,(e=>e()))),os(s.current,((e,t)=>{r?.add(e),g&&e.start({default:m});let n=c[t];n&&(ou(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Cc((()=>()=>{os(a.ctrls,(e=>e.stop(!0)))}));let h=p.map((e=>({...e})));return r?[h,r]:h}function qu(e,t){let n=ts.fun(e),[[o],r]=Ku(1,n?e:[e],n?t||[]:t);return n||2==arguments.length?[o,r]:o}var Zu=class extends vu{constructor(e,t){super(),this.source=e,this.calc=Gs(...t);let n=this._get(),o=Vc(n);Mc(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();ns(t,this.get())||(Tc(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Xu(this._active)&&Qu(this)}_get(){let e=ts.arr(this.source)?this.source.map(Js):ls(Js(this.source));return this.calc(...e)}_start(){this.idle&&!Xu(this._active)&&(this.idle=!1,os(Pc(this),(e=>{e.done=!1})),Ja.skipAnimation?(La.batchedUpdates((()=>this.advance())),Qu(this)):_s.start(this))}_attach(){let e=1;os(ls(this.source),(t=>{Qs(t)&&rc(t,this),hu(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){os(ls(this.source),(e=>{Qs(e)&&lc(e,this)})),this._active.clear(),Qu(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=ls(this.source).reduce(((e,t)=>Math.max(e,(hu(t)?t.priority:0)+1)),0))}};function Yu(e){return!1!==e.idle}function Xu(e){return!e.size||Array.from(e).every(Yu)}function Qu(e){e.idle||(e.idle=!0,os(Pc(e),(e=>{e.done=!0})),tc(e,{type:"idle",parent:e}))}Ja.assign({createStringInterpolator:hc,to:(e,t)=>new Zu(e,t)});_s.advance;var Ju=window.ReactDOM,ed=/^--/;function td(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||ed.test(e)||od.hasOwnProperty(e)&&od[e]?(""+t).trim():t+"px"}var nd={};var od={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},rd=["Webkit","Ms","Moz","O"];od=Object.keys(od).reduce(((e,t)=>(rd.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),od);var ld=/^(matrix|translate|scale|rotate|skew)/,id=/^(translate)/,ad=/^(rotate|skew)/,sd=(e,t)=>ts.num(e)&&0!==e?e+t:e,cd=(e,t)=>ts.arr(e)?e.every((e=>cd(e,t))):ts.num(e)?e===t:parseFloat(e)===t,ud=class extends Dc{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>sd(e,"px"))).join(",")})`,cd(e,0)]))),rs(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(ld.test(t)){if(delete o[t],ts.und(e))return;let n=id.test(t)?"px":ad.test(t)?"deg":"";r.push(ls(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${sd(r,n)})`,cd(r,0)]:e=>[`${t}(${e.map((e=>sd(e,n))).join(",")})`,cd(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new dd(r,l)),super(o)}},dd=class extends nc{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return os(this.inputs,((n,o)=>{let r=Js(n[0]),[l,i]=this.transforms[o](ts.arr(r)?r:n.map(Js));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&os(this.inputs,(e=>os(e,(e=>Qs(e)&&rc(e,this)))))}observerRemoved(e){0==e&&os(this.inputs,(e=>os(e,(e=>Qs(e)&&lc(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),tc(this,e)}};Ja.assign({batchedUpdates:Ju.unstable_batchedUpdates,createStringInterpolator:hc,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}});var pd=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Dc(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=Uc(e)||"Anonymous";return(e=ts.str(e)?l[e]||(l[e]=Fc(e,r)):e[Gc]||(e[Gc]=Fc(e,r))).displayName=`Animated(${t})`,e};return rs(e,((t,n)=>{ts.arr(e)&&(n=Uc(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;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:nd[t]||(nd[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=td(t,o[t]);ed.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new ud(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),md=pd.animated;const fd=e=>e+1,gd=e=>({top:e.offsetTop,left:e.offsetLeft});var hd=function({isSelected:e,adjustScrolling:t,enableAnimation:n,triggerAnimationOnChange:o}){const r=(0,c.useRef)(),l=(0,p.useReducedMotion)()||!n,[i,a]=(0,c.useReducer)(fd,0),[s,u]=(0,c.useReducer)(fd,0),[d,m]=(0,c.useState)({x:0,y:0}),f=(0,c.useMemo)((()=>r.current?gd(r.current):null),[o]),g=(0,c.useMemo)((()=>{if(!t||!r.current)return()=>{};const e=(0,da.getScrollContainer)(r.current);if(!e)return()=>{};const n=r.current.getBoundingClientRect();return()=>{const t=r.current.getBoundingClientRect().top-n.top;t&&(e.scrollTop+=t)}}),[o,t]);return(0,c.useLayoutEffect)((()=>{i&&u()}),[i]),(0,c.useLayoutEffect)((()=>{if(!f)return;if(l)return void g();r.current.style.transform=void 0;const e=gd(r.current);a(),m({x:Math.round(f.left-e.left),y:Math.round(f.top-e.top)})}),[o]),qu({from:{x:d.x,y:d.y},to:{x:0,y:0},reset:i!==s,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:function({value:t}){if(!r.current)return;let{x:n,y:o}=t;n=Math.round(n),o=Math.round(o);const l=0===n&&0===o;r.current.style.transformOrigin="center center",r.current.style.transform=l?void 0:`translate3d(${n}px,${o}px,0)`,r.current.style.zIndex=e?"1":"",g()}}),r};const bd=".block-editor-block-list__block",vd=".block-list-appender",_d=".block-editor-button-block-appender";function kd(e,t){return e.closest(bd)===t.closest(bd)}function yd(e,t){return t.closest([bd,vd,_d].join(","))===e}function Ed(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(bd);return t?t.id.slice(6):void 0}function wd(e){const t=(0,c.useRef)(),n=function(e){return(0,f.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:o,isBlockSelected:r}=t(Jo);if(r(e)&&"edit"===o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,f.useSelect)(Jo);return(0,c.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(yd(t.current,l.activeElement))return;const i=da.focus.tabbable.find(t.current).filter((e=>(0,da.isTextField)(e))),a=-1===n,s=i[a?i.length-1:0]||t.current;if(yd(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=da.focus.tabbable.findNext(t.current);if(e&&yd(t.current,e)&&(0,da.isFormElement)(e))return void e.focus()}(0,da.placeCaretAtHorizontalEdge)(s,a)}else t.current.focus()}),[n,e]),t}function Sd(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Cd(){const e=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return t().outlineMode}),[]);return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Sd),t.addEventListener("mouseover",Sd),()=>{t.removeEventListener("mouseout",Sd),t.removeEventListener("mouseover",Sd),t.classList.remove("is-hovered")}}),[e])}function xd(e){return(0,f.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:r,isBlockMultiSelected:l,getBlockName:i,getSettings:s,hasSelectedInnerBlock:c,isTyping:u,__unstableIsFullySelected:p,__unstableSelectionHasUnmergeableBlock:m}=t(Jo),{outlineMode:f}=s(),g=n(e),h=r(e),b=i(e),v=c(e,!0),_=l(e);return d()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":_,"is-partially-selected":_&&!p()&&!m(),"is-reusable":(0,a.isReusableBlock)((0,a.getBlockType)(b)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&f&&u()})}),[e])}function Bd(e){return(0,f.useSelect)((t=>{const n=t(Jo).getBlockName(e),o=(0,a.getBlockType)(n);if(o?.apiVersion>1)return(0,a.getBlockDefaultClassName)(n)}),[e])}function Id(e){return(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Jo),r=o(e);if(!r?.className)return;const l=(0,a.getBlockType)(n(e));return l?.apiVersion>1?r.className:void 0}),[e])}function Td(e){return(0,f.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Jo);if(!i(e))return;const a=n();return a?d()("is-block-moving-mode",{"can-insert-moving-block":o(r(a),l(e))}):void 0}),[e])}function Md(e){const{isBlockSelected:t}=(0,f.useSelect)(Jo),{selectBlock:n,selectionChange:o}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):yd(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var Pd=window.wp.keycodes;function Nd(e){const t=(0,f.useSelect)((t=>t(Jo).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,f.useSelect)(Jo),{insertDefaultBlock:r,removeBlock:l}=(0,f.useDispatch)(Jo);return(0,p.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!==Pd.ENTER&&a!==Pd.BACKSPACE&&a!==Pd.DELETE||s!==i||(0,da.isTextField)(s)||(t.preventDefault(),a===Pd.ENTER?r({},n(e),o(e)+1):l(e))}function s(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Ld(e){const{isNavigationMode:t,isBlockSelected:n}=(0,f.useSelect)(Jo),{setNavigationMode:o,selectBlock:r}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.removeEventListener("mousedown",i)}}),[e,t,n,o])}const Rd=(0,c.createContext)({refs:new Map,callbacks:new Map});function Ad({children:e}){const t=(0,c.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,c.createElement)(Rd.Provider,{value:t},e)}function Dd(e){const{refs:t,callbacks:n}=(0,c.useContext)(Rd),o=(0,c.useRef)();return(0,c.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,p.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function Od(e){const{refs:t}=(0,c.useContext)(Rd),n=(0,c.useRef)();return n.current=e,(0,c.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function zd(e){const{callbacks:t}=(0,c.useContext)(Rd),n=Od(e),[o,r]=(0,c.useState)(null);return(0,c.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Vd(){const e=(0,c.useContext)(gh);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Fd(e){return(0,f.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(Jo);return n(e)}),[e])}const Hd=200;function Gd(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:l}=(0,c.useContext)(Ri),{index:i,mode:s,name:u,blockApiVersion:m,blockTitle:g,isPartOfSelection:h,adjustScrolling:b,enableAnimation:_,isSubtreeDisabled:k}=(0,f.useSelect)((e=>{const{getBlockAttributes:t,getBlockIndex:o,getBlockMode:r,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:c,isBlockMultiSelected:u,isAncestorMultiSelected:d,isFirstMultiSelectedBlock:p,isBlockSubtreeDisabled:m}=Xo(e(Jo)),{getActiveBlockVariation:f}=e(a.store),g=c(n),h=u(n)||d(n),b=l(n),v=(0,a.getBlockType)(b),_=f(b,t(n));return{index:o(n),mode:r(n),name:b,blockApiVersion:v?.apiVersion||1,blockTitle:_?.title||v?.title,isPartOfSelection:g||h,adjustScrolling:g||p(n),enableAnimation:!i()&&s()<=Hd,isSubtreeDisabled:m(n)}}),[n]),y=Fd(n),E=(0,v.sprintf)((0,v.__)("Block: %s"),g),w="html"!==s||t?"":"-visual",S=(0,p.useMergeRefs)([e.ref,wd(n),Dd(n),Md(n),Nd(n),Ld(n),Cd(),Vd(),hd({isSelected:h,adjustScrolling:b,enableAnimation:_,triggerAnimationOnChange:i}),(0,p.useDisabled)({isDisabled:!y})]),C=rr();return m<2&&C.clientId,{tabIndex:0,...r,...e,ref:S,id:`block-${n}${w}`,role:"document","aria-label":E,"data-block":n,"data-type":u,"data-title":g,inert:k?"true":void 0,className:d()(d()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":y}),o,e.className,r.className,xd(n),Bd(n),Id(n),Td(n)),style:{...r.style,...e.style}}}function Ud({children:e,isHtml:t,...n}){return(0,c.createElement)("div",{...Gd(n,{__unstableIsHtml:t})},e)}Gd.save=a.__unstableGetBlockProps;const $d=(0,f.withSelect)(((e,{clientId:t,rootClientId:n})=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:l,getTemplateLock:i,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:s,canMoveBlock:c}=e(Jo),u=a(t),d=o(t),p=i(n),m=s(t,n),f=c(t,n),{name:g,attributes:h,isValid:b}=u||{};return{mode:r(t),isSelectionEnabled:l(),isLocked:!!p,canRemove:m,canMove:f,block:u,name:g,attributes:h,isValid:b,isSelected:d}})),jd=(0,f.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d}=e(Jo);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Jo),l=r(),{clientId:i}=t,a=l.length?l:[i];o(a,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(Jo),a=i(o);r(e,a+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:c,getBlock:p,getBlockAttributes:m,getBlockName:f,getBlockOrder:g,getBlockIndex:h,getBlockRootClientId:b,canInsertBlockType:v}=n.select(Jo);function _(e,t=!0){const o=b(e),l=g(e),[i]=l;1===l.length&&(0,a.isUnmodifiedBlock)(p(i))?d(e):n.batch((()=>{if(v(f(i),o))u([i],e,o,h(e));else{const n=(0,a.switchToBlockType)(p(i),(0,a.getDefaultBlockName)());n&&n.length&&(r(n,h(e),o,t),d(i,!1))}!g(e).length&&(0,a.isUnmodifiedBlock)(p(e))&&d(e,!1)}))}if(e){if(i){const e=c(i);if(e){if(f(i)!==f(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(e),e,i),d(e,!1)}))}}}const e=c(o);if(!e)return;g(e).length?_(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&f(i)===f(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(i),i,e),d(i,!1)}))}_(i)}}},onReplace(e,n,o){e.length&&!(0,a.isUnmodifiedDefaultBlock)(e[e.length-1])&&c();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;i([t.clientId],r,n,o)},toggleSelection(e){s(e)}}}));var Wd=(0,p.compose)(p.pure,$d,jd,(0,p.ifCondition)((({block:e})=>!!e)),(0,m.withFilters)("editor.BlockListBlock"))((function({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:l,isSelectionEnabled:i,className:s,__unstableLayoutClassNames:u,name:p,isValid:m,attributes:g,wrapperProps:h,setAttributes:b,onReplace:v,onInsertBlocksAfter:_,onMerge:k,toggleSelection:y}){var E;const{themeSupportsLayout:w,isTemporarilyEditingAsBlocks:S,blockEditingMode:C}=(0,f.useSelect)((e=>{const{getSettings:t,__unstableGetTemporarilyEditingAsBlocks:n,getBlockEditingMode:o}=e(Jo);return{themeSupportsLayout:t().supportsLayout,isTemporarilyEditingAsBlocks:n()===r,blockEditingMode:o(r)}}),[r]),{removeBlock:x}=(0,f.useDispatch)(Jo),B=(0,c.useCallback)((()=>x(r)),[r]),I=yi()||{};let T=(0,c.createElement)(va,{name:p,isSelected:l,attributes:g,setAttributes:b,insertBlocksAfter:n?void 0:_,onReplace:o?v:void 0,onRemove:o?B:void 0,mergeBlocks:o?k:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:y,__unstableLayoutClassNames:u,__unstableParentLayout:Object.keys(I).length?I:void 0});const M=(0,a.getBlockType)(p);"disabled"===C&&(h={...h,tabIndex:-1}),M?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.className&&t?.className&&(n.className=d()(e.className,t.className)),e?.style&&t?.style&&(n.style={...e.style,...t.style}),n}(h,M.getEditWrapperProps(g)));const P=h&&!!h["data-align"]&&!w;let N;if(P&&(T=(0,c.createElement)("div",{className:"wp-block","data-align":h["data-align"]},T)),m)N="html"===t?(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{style:{display:"none"}},T),(0,c.createElement)(Ud,{isHtml:!0},(0,c.createElement)(Pa,{clientId:r}))):M?.apiVersion>1?T:(0,c.createElement)(Ud,{...h},T);else{const t=e?(0,a.serializeRawBlock)(e):(0,a.getSaveContent)(M,g);N=(0,c.createElement)(Ud,{className:"has-warning"},(0,c.createElement)(Ca,{clientId:r}),(0,c.createElement)(c.RawHTML,null,(0,da.safeHTML)(t)))}const{"data-align":L,...R}=null!==(E=h)&&void 0!==E?E:{},A={clientId:r,className:d()({"is-editing-disabled":"disabled"===C,"is-content-locked-temporarily-editing-as-blocks":S},L&&w&&`align${L}`,s),wrapperProps:R,isAligned:P},D=(0,c.useMemo)((()=>A),Object.values(A));return(0,c.createElement)(Ri.Provider,{value:D},(0,c.createElement)(Ta,{fallback:(0,c.createElement)(Ud,{className:"has-warning"},(0,c.createElement)(Ba,null))},N))})),Kd=window.wp.htmlEntities;var qd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Zd=[(0,c.createInterpolateElement)((0,v.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,c.createInterpolateElement)((0,v.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,c.createElement)("kbd",null)}),(0,v.__)("Drag files into the editor to automatically insert media blocks."),(0,v.__)("Change a block's type by pressing the block icon on the toolbar.")];var Yd=function(){const[e]=(0,c.useState)(Math.floor(Math.random()*Zd.length));return(0,c.createElement)(m.Tip,null,Zd[e])};var Xd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Qd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Jd=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 ep=(0,c.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Jd});const r=(0,c.createElement)(m.Icon,{icon:e&&e.src?e.src:e,context:o}),l=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,c.createElement)("span",{style:l,className:d()("block-editor-block-icon",n,{"has-colors":t})},r)}));var tp=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&($()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:l}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(Jo);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:i}=(0,f.useDispatch)(Jo);return(0,c.createElement)("div",{className:d()("block-editor-block-card",r)},l&&(0,c.createElement)(m.Button,{onClick:()=>i(l),label:(0,v.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,v.isRTL)()?Xd:Qd,isSmall:!0}),(0,c.createElement)(ep,{icon:t,showColors:!0}),(0,c.createElement)("div",{className:"block-editor-block-card__content"},(0,c.createElement)("h2",{className:"block-editor-block-card__title"},e),(0,c.createElement)("span",{className:"block-editor-block-card__description"},n)))};var np=(0,p.createHigherOrderComponent)((e=>(0,f.withRegistry)((({useSubRegistry:t=!0,registry:n,...o})=>{if(!t)return(0,c.createElement)(e,{registry:n,...o});const[r,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>{const e=(0,f.createRegistry)({},n);e.registerStore(qo,Qo),l(e)}),[n]),r?(0,c.createElement)(f.RegistryProvider,{value:r},(0,c.createElement)(e,{registry:r,...o})):null}))),"withRegistryProvider");const op=()=>{};function rp({clientId:e=null,value:t,selection:n,onChange:o=op,onInput:r=op}){const l=(0,f.useRegistry)(),{resetBlocks:i,resetSelection:s,replaceInnerBlocks:u,selectBlock:d,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=l.dispatch(Jo),{hasSelectedBlock:g,getBlockName:h,getBlocks:b,getSelectionStart:v,getSelectionEnd:_,getBlock:k}=l.select(Jo),y=(0,f.useSelect)((t=>!e||t(Jo).areInnerBlocksControlled(e)),[e]),E=(0,c.useRef)({incoming:null,outgoing:[]}),w=(0,c.useRef)(!1),S=()=>{t&&(m(),e?l.batch((()=>{p(e,!0);const n=t.map((e=>(0,a.cloneBlock)(e)));w.current&&(E.current.incoming=n),m(),u(e,n)})):(w.current&&(E.current.incoming=t),i(t)))},C=(0,c.useRef)(r),x=(0,c.useRef)(o);(0,c.useEffect)((()=>{C.current=r,x.current=o}),[r,o]),(0,c.useEffect)((()=>{if(E.current.outgoing.includes(t))E.current.outgoing[E.current.outgoing.length-1]===t&&(E.current.outgoing=[]);else if(b(e)!==t){E.current.outgoing=[];const t=g(),o=v(),r=_();if(S(),n)s(n.selectionStart,n.selectionEnd,n.initialPosition);else{const n=k(o.clientId);t&&!n?d(e):s(o,r)}}}),[t,e]),(0,c.useEffect)((()=>{y||(E.current.outgoing=[],S())}),[y]),(0,c.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=l.select(Jo);let i=b(e),a=n(),s=!1;w.current=!0;const c=l.subscribe((()=>{if(null!==e&&null===h(e))return;if(!(!e||r(e)))return;const l=n(),c=b(e),u=c!==i;if(i=c,u&&(E.current.incoming||o()))return E.current.incoming=null,void(a=l);if(u||s&&!u&&l&&!a){a=l,E.current.outgoing.push(i);(a?x.current:C.current)(i,{selection:{selectionStart:v(),selectionEnd:_(),initialPosition:t()}})}s=u}));return()=>{w.current=!1,c()}}),[l,e]),(0,c.useEffect)((()=>()=>{m(),e?(p(e,!1),m(),u(e,[])):i([])}),[])}var lp=window.wp.keyboardShortcuts;function ip(){return null}ip.Register=function(){const{registerShortcut:e}=(0,f.useDispatch)(lp.store);return(0,c.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,v.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,v.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,v.__)("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,v.__)("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,v.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,v.__)("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,v.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,v.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,v.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,v.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,v.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var ap=ip;const sp=np((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=Xo((0,f.useDispatch)(Jo));return(0,c.useEffect)((()=>{r({...n,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[n,o,r]),rp(e),(0,c.createElement)(m.SlotFillProvider,{passthrough:!0},(0,c.createElement)(ap.Register,null),(0,c.createElement)(Ad,null,t))}));var cp=e=>(0,c.createElement)(sp,{...e,stripExperimentalSettings:!0},e.children);function up(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,f.useSelect)(Jo),{clearSelectedBlock:o}=(0,f.useDispatch)(Jo),{clearBlockSelection:r}=e();return(0,p.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function dp(e){return(0,c.createElement)("div",{ref:up(),...e})}function pp(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Jo);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function mp(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,f.useSelect)(pp,[]);return(0,p.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:a}=i;if(null==e)return;if(!o||t)return;const{length:s}=n;s<2||l&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function fp(e,t,n,o){let r,l=da.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(1!==e.children.length||!kd(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!da.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 gp(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,f.useSelect)(Jo),{selectBlock:l}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((i=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:f}=s,g=c===Pd.UP,h=c===Pd.DOWN,b=c===Pd.LEFT,v=c===Pd.RIGHT,_=g||b,k=b||v,y=g||h,E=k||y,w=d||p||m||f,S=y?da.isVerticalEdge:da.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:x}=C;if(!E)return;if(o()){if(d)return;if(!r())return;return s.preventDefault(),void(_?l(e()):l(t(),-1))}if(!function(e,t,n){const o=t===Pd.UP||t===Pd.DOWN,{tagName:r}=e,l=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(l);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(l);return"TEXTAREA"!==r}(u,c,w))return;y?a||(a=(0,da.computeCaretRect)(x)):a=null;const B=(0,da.isRTL)(u)?!_:_,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=fp(e,t,i);return n&&Ed(n)})(u,_)&&S(u,_)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,da.isVerticalEdge)(u,_)||m&&!(0,da.isHorizontalEdge)(u,B)||I){if(k&&x.getSelection().isCollapsed&&(0,da.isHorizontalEdge)(u,B)&&!I){const e=fp(u,B,i);(0,da.placeCaretAtHorizontalEdge)(e,_),s.preventDefault()}}else{const e=fp(u,_,i,!0);e&&((0,da.placeCaretAtVerticalEdge)(e,m?!_:_,m?void 0:a),s.preventDefault())}}return i.addEventListener("mousedown",s),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",s),i.removeEventListener("keydown",c)}}),[])}function hp(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,f.useSelect)(Jo),{multiSelect:o,selectBlock:r}=(0,f.useDispatch)(Jo),l=(0,lp.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((i=>{function a(a){if(!l("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,da.isEntirelySelected)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",a),()=>{i.removeEventListener("keydown",a)}}),[])}function bp(e,t){e.contentEditable=t,t&&e.focus()}function vp(){const{startMultiSelect:e,stopMultiSelect:t}=(0,f.useDispatch)(Jo),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,f.useSelect)(Jo);return(0,p.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:a}=i;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(o())return;bp(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d({buttons:t,target:o}){r()||1===t&&"true"===o.getAttribute("contenteditable")&&n()&&(s=o,e(),a.addEventListener("mouseup",u),bp(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,o])}function _p(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function kp(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,f.useDispatch)(Jo),{getBlockParents:o,getBlockSelectionStart:r}=(0,f.useSelect)(Jo);return(0,p.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function a(l){const a=i.getSelection();if(!a.rangeCount)return;const s=l.shiftKey&&"mouseup"===l.type;if(a.isCollapsed&&!s)return void _p(n,!1);let c=Ed(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Ed(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=r(),t=Ed(l.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0===c&&void 0===u)return void _p(n,!1);if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){l.addEventListener("selectionchange",a),i.addEventListener("mouseup",a)}function c(){l.removeEventListener("selectionchange",a),i.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function yp(){const{selectBlock:e}=(0,f.useDispatch)(Jo),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,f.useSelect)(Jo);return(0,p.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),a=Ed(l.target);l.shiftKey?i!==a&&(r.contentEditable=!0,r.focus()):o()&&e(a)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Ep(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,f.useSelect)(Jo),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:c}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((u=>{function d(e){"true"===u.contentEditable&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===Pd.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,a.createBlock)((0,a.getDefaultBlockName)())):l()):d.keyCode===Pd.BACKSPACE||d.keyCode===Pd.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===Pd.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===Pd.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function wp(){const[e,t,n]=function(){const e=(0,c.useRef)(),t=(0,c.useRef)(),n=(0,c.useRef)(),o=(0,c.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,f.useSelect)(Jo),{setNavigationMode:a}=(0,f.useDispatch)(Jo),s=(0,f.useSelect)((e=>e(Jo).isNavigationMode()),[])?void 0:"0",u=(0,c.useRef)();function d(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=da.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const m=(0,c.createElement)("div",{ref:t,tabIndex:s,onFocus:d}),g=(0,c.createElement)("div",{ref:n,tabIndex:s,onFocus:d}),h=(0,p.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===Pd.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==Pd.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));const c=da.focus.tabbable[i](e.target),d=e.target.closest("[data-block]"),p=d&&c&&(kd(d,c)||yd(d,c));if((0,da.isFormElement)(c)&&p)return;const m=o?t:n;u.current=!0,m.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){if(o.keyCode!==Pd.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",l=da.focus.tabbable[r](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[m,(0,p.useMergeRefs)([e,h]),g]}(),o=(0,f.useSelect)((e=>e(Jo).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,Ep(),vp(),kp(),yp(),mp(),hp(),gp(),(0,p.useRefEffect)((e=>{if(e.tabIndex=0,e.contentEditable=o,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,v.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var Sp=(0,c.forwardRef)((function({children:e,...t},n){const[o,r,l]=wp();return(0,c.createElement)(c.Fragment,null,o,(0,c.createElement)("div",{...t,ref:(0,p.useMergeRefs)([r,n]),className:d()(t.className,"block-editor-writing-flow")},e),l)}));function Cp(e,t,n){const o={};for(const t in e)o[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();o.clientX+=e.left,o.clientY+=e.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault();!n.dispatchEvent(r)&&e.preventDefault()}function xp(e){return(0,p.useRefEffect)((t=>{const{defaultView:n}=e;if(!n)return;const{frameElement:o}=n,r=["dragover","mousemove"],l={};for(const e of r)l[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;Cp(e,window[t],o)},t.addEventListener(e,l[e]);return()=>{for(const e of r)t.removeEventListener(e,l[e])}}))}function Bp({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,expand:l=!1,readonly:i,forwardedRef:a,...s}){const{resolvedAssets:u,isPreviewMode:g}=(0,f.useSelect)((e=>{const t=e(Jo).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:h="",scripts:b=""}=u,[_,k]=(0,c.useState)(),[y,E]=(0,c.useState)([]),w=(0,c.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:o})=>n?e(o):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(o)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}}return e}),[])),[]),S=up(),[C,x,B]=wp(),[I,{height:T}]=(0,p.useResizeObserver)(),M=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:l}=o;t=o,S(l),E(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir;for(const e of w)o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),g||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{k(e.contentDocument)},e.addEventListener("load",o),()=>{delete e._load,e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),P=(0,p.useDisabled)({isDisabled:!i}),N=(0,p.useMergeRefs)([xp(_),e,S,x,P]),L=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${h}\n\t\t${b}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[R,A]=(0,c.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([L],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[L]);(0,c.useEffect)((()=>A),[A]);const D=T*(1-o)/2;return(0,c.createElement)(c.Fragment,null,n>=0&&C,(0,c.createElement)("iframe",{...s,style:{border:0,...s.style,height:l?T:s.style?.height,marginTop:1!==o?-D+r:s.style?.marginTop,marginBottom:1!==o?-D+r:s.style?.marginBottom,transform:1!==o?`scale( ${o} )`:s.style?.transform,transition:"all .3s"},ref:(0,p.useMergeRefs)([a,M]),tabIndex:n,src:R,title:(0,v.__)("Editor canvas"),onKeyDown:e=>{e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),Cp(e,window.KeyboardEvent,e.currentTarget))}},_&&(0,c.createPortal)((0,c.createElement)("body",{ref:N,className:d()("block-editor-iframe__body","editor-styles-wrapper",...y)},I,(0,c.createElement)(m.__experimentalStyleProvider,{document:_},t)),_.documentElement)),n>=0&&B)}var Ip=(0,c.forwardRef)((function(e,t){return(0,f.useSelect)((e=>e(Jo).getSettings().__internalIsInitialized),[])?(0,c.createElement)(Bp,{...e,forwardedRef:t}):null})),Tp={grad:.9,turn:360,rad:360/(2*Math.PI)},Mp=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Pp=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Np=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Lp=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Rp=function(e){return{r:Np(e.r,0,255),g:Np(e.g,0,255),b:Np(e.b,0,255),a:Np(e.a)}},Ap=function(e){return{r:Pp(e.r),g:Pp(e.g),b:Pp(e.b),a:Pp(e.a,3)}},Dp=/^#([0-9a-f]{3,8})$/i,Op=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},zp=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}},Vp=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}},Fp=function(e){return{h:Lp(e.h),s:Np(e.s,0,100),l:Np(e.l,0,100),a:Np(e.a)}},Hp=function(e){return{h:Pp(e.h),s:Pp(e.s),l:Pp(e.l),a:Pp(e.a,3)}},Gp=function(e){return Vp((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},Up=function(e){return{h:(t=zp(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},$p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jp=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Kp=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qp={string:[[function(e){var t=Dp.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?Pp(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?Pp(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Wp.exec(e)||Kp.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Rp({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=$p.exec(e)||jp.exec(e);if(!t)return null;var n,o,r=Fp({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Tp[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Gp(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 Mp(t)&&Mp(n)&&Mp(o)?Rp({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(!Mp(t)||!Mp(n)||!Mp(o))return null;var i=Fp({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Gp(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Mp(t)||!Mp(n)||!Mp(o))return null;var i=function(e){return{h:Lp(e.h),s:Np(e.s,0,100),v:Np(e.v,0,100),a:Np(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Vp(i)},"hsv"]]},Zp=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]},Yp=function(e){return"string"==typeof e?Zp(e.trim(),qp.string):"object"==typeof e&&null!==e?Zp(e,qp.object):[null,void 0]},Xp=function(e,t){var n=Up(e);return{h:n.h,s:Np(n.s+100*t,0,100),l:n.l,a:n.a}},Qp=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Jp=function(e,t){var n=Up(e);return{h:n.h,s:n.s,l:Np(n.l+100*t,0,100),a:n.a}},em=function(){function e(e){this.parsed=Yp(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 Pp(Qp(this.rgba),2)},e.prototype.isDark=function(){return Qp(this.rgba)<.5},e.prototype.isLight=function(){return Qp(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Ap(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Op(Pp(255*r)):"","#"+Op(t)+Op(n)+Op(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Ap(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ap(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 Hp(Up(this.rgba))},e.prototype.toHslString=function(){return t=(e=Hp(Up(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=zp(this.rgba),{h:Pp(e.h),s:Pp(e.s),v:Pp(e.v),a:Pp(e.a,3)};var e},e.prototype.invert=function(){return tm({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),tm(Xp(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),tm(Xp(this.rgba,-e))},e.prototype.grayscale=function(){return tm(Xp(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),tm(Jp(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),tm(Jp(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?tm({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Pp(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Up(this.rgba);return"number"==typeof e?tm({h:e,s:t.s,l:t.l,a:t.a}):Pp(t.h)},e.prototype.isEqual=function(e){return this.toHex()===tm(e).toHex()},e}(),tm=function(e){return e instanceof em?e:new em(e)},nm=[],om=function(e){e.forEach((function(e){nm.indexOf(e)<0&&(e(em,qp),nm.push(e))}))};function rm(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 lm=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},im=function(e){return.2126*lm(e.r)+.7152*lm(e.g)+.0722*lm(e.b)};function am(e){e.prototype.luminance=function(){return e=im(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=im(l))>(s=im(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 sm=n(3124),cm=n.n(sm);const um=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function dm(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=S()||C());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return 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 h(){const e=p(/^([^{]+)/);if(e)return pm(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 b(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=pm(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(um,""),value:n?pm(n[0]).replace(um,""):""});return p(/^[;\s]*/),o}function v(){const e=[];if(!c())return s("missing '{'");let t;for(f(e);t=b();)!1!==t&&(e.push(t),f(e));return u()?e:s("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const k=w("import"),y=w("charset"),E=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const o=t[1];if(!c())return s("@keyframes missing '{'");let r,i=f();for(;r=_();)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=pm(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(/^@container *([^{]+)/);if(!t)return;const n=pm(t[1]);if(!c())return s("@container missing '{'");const o=f().concat(d());return u()?e({type:"container",container:n,rules:o}):s("@container missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:pm(t[1]),media:pm(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=pm(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 '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=pm(t[1]),o=pm(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=h()||[];if(!c())return s("@page missing '{'");let n,o=f();for(;n=b();)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=b();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function C(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:v()})):s("selector missing")}return mm(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function pm(e){return e?e.replace(/^\s+|\s+$/g,""):""}function mm(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){mm(e,o)})):n&&"object"==typeof n&&mm(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var fm=n(8575),gm=n.n(fm),hm=bm;function bm(e){this.options=e||{}}bm.prototype.emit=function(e){return e},bm.prototype.visit=function(e){return this[e.type](e)},bm.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 vm=_m;function _m(e){hm.call(this,e)}gm()(_m,hm),_m.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},_m.prototype.comment=function(e){return this.emit("",e.position)},_m.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},_m.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},_m.prototype.container=function(e){return this.emit("@container "+e.container,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},_m.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("}")},_m.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},_m.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},_m.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},_m.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},_m.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},_m.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("}")},_m.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},_m.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},_m.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},_m.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("}"):""},_m.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var km=ym;function ym(e){e=e||{},hm.call(this,e),this.indentation=e.indent}gm()(ym,hm),ym.prototype.compile=function(e){return this.stylesheet(e)},ym.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},ym.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},ym.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},ym.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}")},ym.prototype.container=function(e){return this.emit("@container "+e.container,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},ym.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}")},ym.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},ym.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},ym.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}")},ym.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)+"}")},ym.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")},ym.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}")},ym.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}")},ym.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}")},ym.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},ym.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()+"}"):""},ym.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},ym.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Em=function(e,t){try{const n=dm(e),o=cm().map(n,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return function(e,t){return((t=t||{}).compress?new vm(t):new km(t)).compile(e)}(o)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}};function wm(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 Sm(e,t){return new URL(e,t).toString()}var Cm=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]};wm(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Sm(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 xm=/^(body|html|:root).*$/;var Bm=(e,t=[])=>n=>{const o=n=>t.includes(n.trim())||n.trim().startsWith(`${e} `)?n:n.match(xm)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(o)}:n};var Im=(e,t="")=>Object.values(null!=e?e:[]).map((({css:e,baseURL:n})=>{const o=[];return t&&o.push(Bm(t)),n&&o.push(Cm(n)),o.length?Em(e,(0,p.compose)(o)):e}));function Tm(e,t){return(0,c.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,l=t?n.querySelector(t):r;let i;if(l)i=o?.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const a=tm(i);a.luminance()>.5||0===a.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}function Mm({styles:e,scope:t}){const n=(0,f.useSelect)((e=>Xo(e(Jo)).getStyleOverrides()),[]),[o,r]=(0,c.useMemo)((()=>{const o=Object.values(null!=e?e:[]);for(const[e,t]of n){const n=o.findIndex((({id:t})=>e===t)),r={...t,id:e};-1===n?o.push(r):o[n]=r}return[Im(o.filter((e=>e?.css)),t),o.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,n,t]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("style",{ref:Tm(o,t)}),o.map(((e,t)=>(0,c.createElement)("style",{key:t},e))),(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:r}}))}let Pm;om([rm,am]);const Nm=2e3;function Lm({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=[]}){e||(e=t);const[r,{height:l}]=(0,p.useResizeObserver)(),{styles:i}=(0,f.useSelect)((e=>({styles:e(Jo).getSettings().styles})),[]),a=(0,c.useMemo)((()=>i?[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:i),[i,o]);Pm=Pm||(0,p.pure)(vh);const s=t/e,u=l?t/(l*s):0;return(0,c.createElement)(m.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${s})`,aspectRatio:u,maxHeight:l>Nm?Nm*s:void 0,minHeight:n}},(0,c.createElement)(Ip,{contentRef:(0,p.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:l,pointerEvents:"none",maxHeight:Nm,minHeight:0!==s&&s<1&&n?n/s:n}},(0,c.createElement)(Mm,{styles:a}),r,(0,c.createElement)(Pm,{renderAppender:!1})))}function Rm(e){const[t,{width:n}]=(0,p.useResizeObserver)();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,c.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,c.createElement)(Lm,{...e,containerWidth:n})))}var Am=(0,c.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=[],__experimentalMinHeight:r,__experimentalPadding:l}){r&&(n=r,$()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],$()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=(0,f.useSelect)((e=>e(Jo).getSettings()),[]),a=(0,c.useMemo)((()=>({...i,__unstableIsPreviewMode:!0})),[i]),s=(0,c.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,c.createElement)(sp,{value:s,settings:a},(0,c.createElement)(Rm,{viewportWidth:t,minHeight:n,additionalStyles:o})):null}));function Dm({blocks:e,props:t={},layout:n}){const o=(0,f.useSelect)((e=>e(Jo).getSettings()),[]),r=(0,c.useMemo)((()=>({...o,styles:void 0,__unstableIsPreviewMode:!0})),[o]),l=(0,p.useDisabled)(),i=(0,p.useMergeRefs)([t.ref,l]),a=(0,c.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),s=(0,c.createElement)(sp,{value:a,settings:r},(0,c.createElement)(Mm,null),(0,c.createElement)(kh,{renderAppender:!1,layout:n}));return{...t,ref:i,className:d()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?s:null}}var Om=function({item:e}){var t;const{name:n,title:o,icon:r,description:l,initialAttributes:i,example:s}=e,u=(0,a.isReusableBlock)(e),d=(0,c.useMemo)((()=>s?(0,a.getBlockFromExample)(n,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,a.createBlock)(n,i)),[n,s,i]);return(0,c.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,c.createElement)("div",{className:"block-editor-inserter__preview"},u||s?(0,c.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,c.createElement)(Am,{blocks:d,viewportWidth:null!==(t=s?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,c.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,v.__)("No Preview Available."))),!u&&(0,c.createElement)(tp,{title:o,icon:r,description:l}))};var zm=(0,c.createContext)();var Vm=(0,c.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){const l=(0,c.useContext)(zm);return(0,c.createElement)(m.__unstableCompositeItem,{ref:r,state:l,role:"option",focusable:!0,...o},(o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,c.createElement)(t,{...r},n):"function"==typeof n?n(r):(0,c.createElement)(m.Button,{...r},n)}))}));var Fm=(0,c.createElement)(F.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Hm({count:e,icon:t,isPattern:n}){const o=n&&(0,v.__)("Pattern");return(0,c.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,c.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,c.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,c.createElement)(m.FlexItem,null,t?(0,c.createElement)(ep,{icon:t}):o||(0,v.sprintf)((0,v._n)("%d block","%d blocks",e),e)),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(ep,{icon:Fm})))))}var Gm=({isEnabled:e,blocks:t,icon:n,children:o,isPattern:r})=>{const l={type:"inserter",blocks:t},i=(0,f.useSelect)((e=>{const{getBlockType:n}=e(a.store);return 1===t.length&&n(t[0].name)?.icon}),[t]);return(0,c.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,onDragStart:e=>{e.dataTransfer.setData("text/html",(0,a.serialize)(t))},__experimentalDragComponent:(0,c.createElement)(Hm,{count:t.length,icon:n||!r&&i,isPattern:r})},(({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})))};var Um=(0,c.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:l,...i}){const s=(0,c.useRef)(!1),u=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},p=(0,c.useMemo)((()=>[(0,a.createBlock)(n.name,n.initialAttributes,(0,a.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]),[n.name,n.initialAttributes,n.initialAttributes]),f=(0,a.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,a.isTemplatePart)(n);return(0,c.createElement)(Gm,{isEnabled:l&&!n.disabled,blocks:p,icon:n.icon},(({draggable:l,onDragStart:a,onDragEnd:p})=>(0,c.createElement)("div",{className:d()("block-editor-block-types-list__list-item",{"is-synced":f}),draggable:l,onDragStart:e=>{s.current=!0,a&&(r(null),a(e))},onDragEnd:e=>{s.current=!1,p&&p(e)}},(0,c.createElement)(Vm,{isFirst:t,className:d()("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,Pd.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Pd.ENTER&&(e.preventDefault(),o(n,(0,Pd.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{s.current||r(n)},onMouseLeave:()=>r(null),...i},(0,c.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:u},(0,c.createElement)(ep,{icon:n.icon,showColors:!0})),(0,c.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,c.createElement)(m.__experimentalTruncate,{numberOfLines:3},n.title))))))}));var $m=(0,c.forwardRef)((function(e,t){const[n,o]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{n&&(0,Ln.speak)((0,v.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,c.createElement)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})}));var jm=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(zm);return(0,c.createElement)(m.__unstableCompositeGroup,{state:n,role:"presentation",ref:t,...e})}));var Wm=function({items:e=[],onSelect:t,onHover:n=(()=>{}),children:o,label:r,isDraggable:l=!0}){return(0,c.createElement)($m,{className:"block-editor-block-types-list","aria-label":r},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}(e,3).map(((e,o)=>(0,c.createElement)(jm,{key:o},e.map(((e,r)=>(0,c.createElement)(Um,{key:e.id,item:e,className:(0,a.getBlockMenuDefaultClassName)(e.id),onSelect:t,onHover:n,isDraggable:l&&!e.isDisabled,isFirst:0===o&&0===r})))))),o)};var Km=function({title:e,icon:t,children:n}){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,c.createElement)("h2",{className:"block-editor-inserter__panel-title"},e),(0,c.createElement)(m.Icon,{icon:t})),(0,c.createElement)("div",{className:"block-editor-inserter__panel-content"},n))};var qm=(e,t)=>{const{categories:n,collections:o,items:r}=(0,f.useSelect)((t=>{const{getInserterItems:n}=t(Jo),{getCategories:o,getCollections:r}=t(a.store);return{categories:o(),collections:r(),items:n(e)}}),[e]);return[r,n,o,(0,c.useCallback)((({name:e,initialAttributes:n,innerBlocks:o,syncStatus:r,content:l},i)=>{const s="unsynced"===r?(0,a.parse)(l,{__unstableSkipMigrationLogs:!0}):(0,a.createBlock)(e,n,(0,a.createBlocksFromInnerBlocksTemplate)(o));t(s,void 0,i)}),[t])]};var Zm=function({children:e}){const t=(0,m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,c.createElement)(zm.Provider,{value:t},e)};const Ym=[];var Xm=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[r,l,i,a]=qm(e,t),s=(0,c.useMemo)((()=>K(r,"frecency","desc").slice(0,6)),[r]),u=(0,c.useMemo)((()=>r.filter((e=>!e.category))),[r]),d=(0,c.useMemo)((()=>(0,p.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>e.reduce(((e,t)=>{const{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{})))(r)),[r]),m=(0,c.useMemo)((()=>{const e={...i};return Object.keys(i).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,i]);(0,c.useEffect)((()=>()=>n(null)),[]);const f=(0,p.useAsyncList)(l),g=l.length===f.length,h=(0,c.useMemo)((()=>Object.entries(i)),[i]),b=(0,p.useAsyncList)(g?h:Ym);return(0,c.createElement)(Zm,null,(0,c.createElement)("div",null,o&&!!s.length&&(0,c.createElement)(Km,{title:(0,v._x)("Most used","blocks")},(0,c.createElement)(Wm,{items:s,onSelect:a,onHover:n,label:(0,v._x)("Most used","blocks")})),f.map((e=>{const t=d[e.slug];return t&&t.length?(0,c.createElement)(Km,{key:e.slug,title:e.title,icon:e.icon},(0,c.createElement)(Wm,{items:t,onSelect:a,onHover:n,label:e.title})):null})),g&&u.length>0&&(0,c.createElement)(Km,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,v.__)("Uncategorized")},(0,c.createElement)(Wm,{items:u,onSelect:a,onHover:n,label:(0,v.__)("Uncategorized")})),b.map((([e,t])=>{const o=m[e];return o&&o.length?(0,c.createElement)(Km,{key:e,title:t.title,icon:t.icon},(0,c.createElement)(Wm,{items:o,onSelect:a,onHover:n,label:t.title})):null}))))},Qm=window.wp.notices;var Jm=(e,t)=>{const{patternCategories:n,patterns:o,userPatternCategories:r}=(0,f.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Jo),{__experimentalUserPatternCategories:r,__experimentalBlockPatternCategories:l}=o();return{patterns:n(t),userPatternCategories:r,patternCategories:l}}),[t]),l=(0,c.useMemo)((()=>{const e=[...n];return r?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[n,r]),{createSuccessNotice:i}=(0,f.useDispatch)(Qm.store),s=(0,c.useCallback)(((t,n)=>{const o=t.id&&"unsynced"!==t.syncStatus?[(0,a.createBlock)("core/block",{ref:t.id})]:n;e((null!=o?o:[]).map((e=>(0,a.cloneBlock)(e))),t.name),i((0,v.sprintf)((0,v.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[i,e]);return[o,l,s]};function ef({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,c.createElement)(m.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper"},(0,c.createElement)(m.__experimentalText,{variant:"muted"},(0,v.sprintf)((0,v._n)("%s item","%s items",o),o)),t>1&&(0,c.createElement)(m.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination"},(0,c.createElement)(m.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous"},(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,v.__)("First page")},(0,c.createElement)("span",null,"«")),(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,v.__)("Previous page")},(0,c.createElement)("span",null,"‹"))),(0,c.createElement)(m.__experimentalText,{variant:"muted"},(0,v.sprintf)((0,v._x)("%1$s of %2$s","paging"),e,t)),(0,c.createElement)(m.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next"},(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,v.__)("Next page")},(0,c.createElement)("span",null,"›")),(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,v.__)("Last page"),size:"default"},(0,c.createElement)("span",null,"»")))))}const tf=({showTooltip:e,title:t,children:n})=>e?(0,c.createElement)(m.Tooltip,{text:t},n):(0,c.createElement)(c.Fragment,null,n);function nf({isDraggable:e,pattern:t,onClick:n,onHover:o,composite:r,showTooltip:l}){const[i,a]=(0,c.useState)(!1),{blocks:s,viewportWidth:u}=t,f=`block-editor-block-patterns-list__item-description-${(0,p.useInstanceId)(nf)}`;return(0,c.createElement)(Gm,{isEnabled:e,blocks:s,isPattern:!!t},(({draggable:e,onDragStart:p,onDragEnd:g})=>(0,c.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:e,onDragStart:e=>{a(!0),p&&(o?.(null),p(e))},onDragEnd:e=>{a(!1),g&&g(e)}},(0,c.createElement)(tf,{showTooltip:l&&"user"===!t.type,title:t.title},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...r,className:d()("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":"user"===t.type&&!t.syncStatus}),onClick:()=>{n(t,s),o?.(null)},onMouseEnter:()=>{i||o?.(t)},onMouseLeave:()=>o?.(null),"aria-label":t.title,"aria-describedby":t.description?f:void 0},(0,c.createElement)(Am,{blocks:s,viewportWidth:u}),(0,c.createElement)(m.__experimentalHStack,{className:"block-editor-patterns__pattern-details"},"user"===t.type&&!t.syncStatus&&(0,c.createElement)("div",{className:"block-editor-patterns__pattern-icon-wrapper"},(0,c.createElement)(ai,{className:"block-editor-patterns__pattern-icon",icon:H})),(!l||"user"===t.type)&&(0,c.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},t.title)),!!t.description&&(0,c.createElement)(m.VisuallyHidden,{id:f},t.description))))))}function of(){return(0,c.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var rf=(0,c.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:l,label:i=(0,v.__)("Block patterns"),showTitlesAsTooltip:a,pagingProps:s},u){const d=(0,m.__unstableUseCompositeState)({orientation:l});return(0,c.createElement)(m.__unstableComposite,{...d,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:u},t.map((t=>n.includes(t)?(0,c.createElement)(nf,{key:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,composite:d,showTooltip:a}):(0,c.createElement)(of,{key:t.name}))),s&&(0,c.createElement)(ef,{...s}))}));function lf({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,c.createElement)("div",{className:`${o}__categories-list`},t.map((({name:t,label:r})=>(0,c.createElement)(m.Button,{key:t,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)}},r))))}function af({searchValue:e,setSearchValue:t}){return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,v.__)("Search for patterns"),placeholder:(0,v.__)("Search")}))}var sf=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,c.createElement)(af,{searchValue:o,setSearchValue:r}),!o&&(0,c.createElement)(lf,{selectedCategory:e,patternCategories:t,onClickCategory:n}))};var cf=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:l=!0,selectBlockOnInsert:i=!0}){const{getSelectedBlock:s}=(0,f.useSelect)(Jo),{destinationRootClientId:u,destinationIndex:d}=(0,f.useSelect)((r=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:a,getBlockOrder:s}=r(Jo),c=l();let u,d=e;return void 0!==t?u=t:n?u=a(n):!o&&c?(d=i(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,o]),{replaceBlocks:p,insertBlocks:m,showInsertionPoint:g,hideInsertionPoint:h}=(0,f.useDispatch)(Jo),b=(0,c.useCallback)(((e,t,n=!1)=>{const c=s();!o&&c&&(0,a.isUnmodifiedDefaultBlock)(c)?p(c.clientId,e,null,l||n?0:null,t):m(e,d,u,i,l||n?0:null,t);const f=Array.isArray(e)?e.length:1,g=(0,v.sprintf)((0,v._n)("%d block added.","%d blocks added.",f),f);(0,Ln.speak)(g),r&&r(e)}),[o,s,p,m,u,d,r,l,i]),_=(0,c.useCallback)((e=>{e?g(u,d):h()}),[g,h,u,d]);return[u,b,_]},uf=n(4793),df=n.n(uf);const pf=e=>e.name||"",mf=e=>e.title,ff=e=>e.description||"",gf=e=>e.keywords||[],hf=e=>e.category,bf=()=>null;function vf(e=""){return il(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function _f(e=""){return e=(e=(e=df()(e)).replace(/^\//,"")).toLowerCase()}const kf=(e="")=>vf(_f(e)),yf=(e,t,n,o)=>{if(0===kf(o).length)return e;return Ef(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},Ef=(e=[],t="",n={})=>{if(0===kf(t).length)return e;const o=e.map((e=>[e,wf(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function wf(e,t,n={}){const{getName:o=pf,getTitle:r=mf,getDescription:l=ff,getKeywords:i=gf,getCategory:a=hf,getCollection:s=bf}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=a(e),f=s(e),g=_f(t),h=_f(u);let b=0;if(g===h)b+=30;else if(h.startsWith(g))b+=20;else{const e=[c,u,d,...p,m,f].join(" ");0===((e,t)=>e.filter((e=>!kf(t).some((t=>t.includes(e))))))(vf(g),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}const Sf=20,Cf=5;function xf(e,t,n,o=""){const[r,l]=(0,c.useState)(1),i=(0,p.usePrevious)(t),a=(0,p.usePrevious)(o);i===t&&a===o||1===r||l(1);const s=e.length,u=r-1,d=(0,c.useMemo)((()=>e.slice(u*Sf,u*Sf+Sf)),[u,e]),m=(0,p.useAsyncList)(d,{step:Cf}),f=Math.ceil(e.length/Sf);return(0,c.useEffect)((function(){const e=(0,da.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:s,categoryPatterns:d,categoryPatternsAsyncList:m,numPages:f,changePage:e=>{const t=(0,da.getScrollContainer)(n?.current);t?.scrollTo(0,0),l(e)},currentPage:r}}function Bf({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,c.createElement)(m.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,v.sprintf)((0,v._n)("%d pattern found","%d patterns found",t),t)):null}var If=function({searchValue:e,selectedCategory:t,patternCategories:n}){const o=(0,c.useRef)(),r=(0,p.useDebounce)(Ln.speak,500),[l,i]=cf({shouldFocusBlock:!0}),[a,,s]=Jm(i,l),u=(0,c.useMemo)((()=>n.map((e=>e.name))),[n]),d=(0,c.useMemo)((()=>{const n=a.filter((e=>{if(t===Vf.name)return!0;if(t===Ff.name&&e.id)return!0;if("uncategorized"===t){const t=e.categories.some((e=>u.includes(e)));return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?Ef(n,e):n}),[e,a,t,u]);(0,c.useEffect)((()=>{if(!e)return;const t=d.length,n=(0,v.sprintf)((0,v._n)("%d result found.","%d results found.",t),t);r(n)}),[e,r,d.length]);const m=xf(d,t,o),[f,g]=(0,c.useState)(e);e!==f&&(g(e),m.changePage(1));const h=!!d?.length;return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer__list",ref:o},(0,c.createElement)(Bf,{filterValue:e,filteredBlockPatternsLength:d.length}),(0,c.createElement)(Zm,null,h&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(rf,{shownPatterns:m.categoryPatternsAsyncList,blockPatterns:m.categoryPatterns,onClickPattern:s,isDraggable:!1}),(0,c.createElement)(ef,{...m}))))};function Tf({initialCategory:e,rootClientId:t}){const[n,o]=(0,c.useState)(""),[r,l]=(0,c.useState)("all"),[i,a]=(0,c.useState)(e?.name),s=Gf(t,r);return(0,c.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,c.createElement)(sf,{selectedCategory:i,patternCategories:s,onClickCategory:a,searchValue:n,setSearchValue:o,patternSourceFilter:r,setPatternSourceFilter:l}),(0,c.createElement)(If,{searchValue:n,selectedCategory:i,patternCategories:s,patternSourceFilter:r}))}var Mf=function({onModalClose:e,...t}){return(0,c.createElement)(m.Modal,{title:(0,v.__)("Patterns"),onRequestClose:e,isFullScreen:!0},(0,c.createElement)(Tf,{...t}))};function Pf({title:e}){return(0,c.createElement)(m.__experimentalVStack,{spacing:0},(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(m.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,c.createElement)(m.__experimentalHStack,{spacing:2},(0,c.createElement)(m.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,v.isRTL)()?Xd:Qd,isSmall:!0,"aria-label":(0,v.__)("Navigate to the previous view")}),(0,c.createElement)(m.__experimentalSpacer,null,(0,c.createElement)(m.__experimentalHeading,{level:5},e))))))}function Nf({categories:e,children:t}){return(0,c.createElement)(m.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,c.createElement)(m.__experimentalNavigatorScreen,{path:"/"},(0,c.createElement)(m.__experimentalItemGroup,null,e.map((e=>(0,c.createElement)(m.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:m.__experimentalItem,isAction:!0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,e.label),(0,c.createElement)(ai,{icon:(0,v.isRTL)()?Qd:Xd}))))))),e.map((e=>(0,c.createElement)(m.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,c.createElement)(Pf,{title:(0,v.__)("Back")}),t(e)))))}const Lf={all:"all",synced:"synced",unsynced:"unsynced",user:"user",theme:"theme",directory:"directory"},Rf={all:"all",full:"fully",unsynced:"unsynced"},Af=e=>e!==Lf.all&&e!==Lf.user,Df=e=>e.name===Ff.name;function Of({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:l}){const i=l.name===Ff.name?Lf.user:o,a=Af(i),s=Df(l),u=(0,c.useMemo)((()=>[{value:Rf.all,label:(0,v._x)("All","Option that shows all patterns")},{value:Rf.full,label:(0,v._x)("Synced","Option that shows all synchronized patterns"),disabled:a},{value:Rf.unsynced,label:(0,v._x)("Not synced","Option that shows all patterns that are not synchronized"),disabled:a}]),[a]),d=(0,c.useMemo)((()=>[{value:Lf.all,label:(0,v.__)("All"),disabled:s},{value:Lf.directory,label:(0,v.__)("Pattern Directory"),disabled:s},{value:Lf.theme,label:(0,v.__)("Theme & Plugins"),disabled:s},{value:Lf.user,label:(0,v.__)("User")}]),[s]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.DropdownMenu,{popoverProps:{placement:"right-end"},label:"Filter patterns",icon:(0,c.createElement)(ai,{icon:(0,c.createElement)(m.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(m.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"#1E1E1E"}))})},(()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Source")},(0,c.createElement)(m.MenuItemsChoice,{choices:d,onSelect:n=>{var o;t(o=n),Af(o)&&e(Rf.all),r.current?.scrollTo(0,0)},value:i})),(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Type")},(0,c.createElement)(m.MenuItemsChoice,{choices:u,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})),(0,c.createElement)("div",{className:"block-editor-tool-selector__help"},(0,c.createInterpolateElement)((0,v.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/patterns/")})}))))))}const zf=()=>{},Vf={name:"allPatterns",label:(0,v.__)("All patterns")},Ff={name:"myPatterns",label:(0,v.__)("My patterns")};function Hf(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Lf.theme||!o&&!r)||(!(t!==Lf.directory||!o&&r)||(t===Lf.user&&!e.id||(n===Rf.full&&""!==e.syncStatus||!(n!==Rf.unsynced||"unsynced"===e.syncStatus||!o))))}function Gf(e,t="all"){const[n,o]=Jm(void 0,e),r=(0,c.useMemo)((()=>"all"===t?n:n.filter((e=>!Hf(e,t)))),[t,n]),l=(0,c.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>o.some((t=>t.name===e))))),[o]),i=(0,c.useMemo)((()=>{const e=o.filter((e=>r.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return r.some((e=>!l(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,v._x)("Uncategorized")}),r.some((e=>e.id))&&e.unshift(Ff),r.length>0&&e.unshift({name:Vf.name,label:Vf.label}),(0,Ln.speak)((0,v.sprintf)((0,v._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r,l]);return i}function Uf({rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:l}){const i=(0,c.useRef)();return(0,c.useEffect)((()=>{const e=setTimeout((()=>{const[e]=da.focus.tabbable.find(i.current);e?.focus()}));return()=>clearTimeout(e)}),[o]),(0,c.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,c.createElement)($f,{key:o.name,rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:l}))}function $f({rootClientId:e,onInsert:t,onHover:n=zf,category:o,showTitlesAsTooltip:r}){const[l,,i]=Jm(t,e),[a,s]=(0,c.useState)("all"),[u,d]=(0,c.useState)("all"),p=Gf(e,u),f=(0,c.useRef)(),g=(0,c.useMemo)((()=>l.filter((e=>{var t;if(Hf(e,u,a))return!1;if(o.name===Vf.name)return!0;if(o.name===Ff.name&&e.id)return!0;if("uncategorized"!==o.name)return e.categories?.includes(o.name);return 0===(null!==(t=e.categories?.filter((e=>p.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[l,p,o.name,u,a]),h=xf(g,o,f),{changePage:b}=h;(0,c.useEffect)((()=>()=>n(null)),[]);const _=(0,c.useCallback)((e=>{s(e),b(1)}),[s,b]),k=(0,c.useCallback)((e=>{d(e),b(1)}),[d,b]);return(0,c.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,c.createElement)(m.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header"},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,(0,c.createElement)(m.__experimentalHeading,{level:4,as:"div"},o.label)),(0,c.createElement)(Of,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:_,setPatternSourceFilter:k,scrollContainerRef:f,category:o})),!g.length&&(0,c.createElement)(m.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results"},(0,v.__)("No results found"))),g.length>0&&(0,c.createElement)(rf,{ref:f,shownPatterns:h.categoryPatternsAsyncList,blockPatterns:h.categoryPatterns,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:u,pagingProps:h}))}var jf=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o}){const[r,l]=(0,c.useState)(!1),i=Gf(o),a=t||i[0],s=(0,p.useViewportMatch)("medium","<");return(0,c.createElement)(c.Fragment,null,!s&&(0,c.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,c.createElement)("nav",{"aria-label":(0,v.__)("Block pattern categories"),className:"block-editor-inserter__block-patterns-tabs"},(0,c.createElement)(m.__experimentalItemGroup,{role:"list"},i.map((n=>(0,c.createElement)(m.__experimentalItem,{role:"listitem",key:n.name,onClick:()=>e(n),className:n===t?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":n.label,"aria-current":n===t?"true":void 0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,n.label),(0,c.createElement)(ai,{icon:(0,v.isRTL)()?Qd:Xd}))))),(0,c.createElement)("div",{role:"listitem"},(0,c.createElement)(m.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>l(!0),variant:"secondary"},(0,v.__)("Explore all patterns")))))),s&&(0,c.createElement)(Nf,{categories:i},(e=>(0,c.createElement)($f,{key:e.name,onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),r&&(0,c.createElement)(Mf,{initialCategory:a,patternCategories:i,onModalClose:()=>l(!1),rootClientId:o}))};function Wf(e){const[t,n]=(0,c.useState)([]),o=(0,f.useSelect)((e=>Xo(e(Jo)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:l,canInsertAudio:i}=(0,f.useSelect)((t=>{const{canInsertBlockType:n}=t(Jo);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,c.useEffect)((()=>{(async()=>{const e=[];if(!o)return;const t=new Map(await Promise.all(o.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:r,video:l,audio:i};o.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,l,i,o]),t}var Kf=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),qf=window.wp.blob;const Zf={image:"img",video:"video",audio:"audio"};function Yf(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=Zf[t],i=(0,c.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=o)}});return[(0,a.createBlock)(`core/${t}`,n),i]}const Xf=["image"],Qf=25,Jf={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function eg({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,c.createElement)(m.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,v.__)("Options"),popoverProps:Jf,icon:_a},(()=>(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:Kf},(0,v.sprintf)((0,v.__)("Report %s"),e.mediaType)))))}function tg({onClose:e,onSubmit:t}){return(0,c.createElement)(m.Modal,{title:(0,v.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,c.createElement)(m.__experimentalVStack,{spacing:3},(0,c.createElement)("p",null,(0,v.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,c.createElement)("p",null,(0,v.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,c.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"tertiary",onClick:e},(0,v.__)("Cancel"))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"primary",onClick:t},(0,v.__)("Insert")))))}function ng({media:e,onClick:t,composite:n,category:o}){const[r,l]=(0,c.useState)(!1),[i,s]=(0,c.useState)(!1),[u,p]=(0,c.useState)(!1),[g,h]=(0,c.useMemo)((()=>Yf(e,o.mediaType)),[e,o.mediaType]),{createErrorNotice:b,createSuccessNotice:_}=(0,f.useDispatch)(Qm.store),k=(0,f.useSelect)((e=>e(Jo).getSettings().mediaUpload),[]),y=(0,c.useCallback)((e=>{if(u)return;const n=(0,a.cloneBlock)(e),{id:o,url:r,caption:i}=n.attributes;o?t(n):(p(!0),window.fetch(r).then((e=>e.blob())).then((e=>{k({filesList:[e],additionalData:{caption:i},onFileChange([e]){(0,qf.isBlobURL)(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),_((0,v.__)("Image uploaded and inserted."),{type:"snackbar"}),p(!1))},allowedTypes:Xf,onError(e){b(e,{type:"snackbar"}),p(!1)}})})).catch((()=>{l(!0),p(!1)})))}),[u,t,k,b,_]),E=e.title?.rendered||e.title;let w;if(E.length>Qf){const e="...";w=E.slice(0,Qf-e.length)+e}const S=(0,c.useCallback)((()=>s(!0)),[]),C=(0,c.useCallback)((()=>s(!1)),[]);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Gm,{isEnabled:!0,blocks:[g]},(({draggable:t,onDragStart:r,onDragEnd:l})=>(0,c.createElement)("div",{className:d()("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:r,onDragEnd:l},(0,c.createElement)(m.Tooltip,{text:w||E},(0,c.createElement)("div",{onMouseEnter:S,onMouseLeave:C},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,className:"block-editor-inserter__media-list__item",onClick:()=>y(g),"aria-label":E},(0,c.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},h,u&&(0,c.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,c.createElement)(m.Spinner,null)))),!u&&(0,c.createElement)(eg,{category:o,media:e})))))),r&&(0,c.createElement)(tg,{onClose:()=>l(!1),onSubmit:()=>{t((0,a.cloneBlock)(g)),_((0,v.__)("Image inserted."),{type:"snackbar"}),l(!1)}}))}var og=function({mediaList:e,category:t,onClick:n,label:o=(0,v.__)("Media List")}){const r=(0,m.__unstableUseCompositeState)();return(0,c.createElement)(m.__unstableComposite,{...r,role:"listbox",className:"block-editor-inserter__media-list","aria-label":o},e.map(((e,o)=>(0,c.createElement)(ng,{key:e.id||e.sourceId||o,media:e,category:t,onClick:n,composite:r}))))};function rg(e=""){const[t,n]=(0,c.useState)(e),[o,r]=(0,c.useState)(e),l=(0,p.useDebounce)(r,250);return(0,c.useEffect)((()=>{l(t)}),[t]),[t,n,o]}var lg=function(){return(0,c.createElement)("div",{className:"block-editor-inserter__no-results"},(0,c.createElement)(ai,{className:"block-editor-inserter__no-results-icon",icon:Jd}),(0,c.createElement)("p",null,(0,v.__)("No results found.")))};const ig=10;function ag({rootClientId:e,onInsert:t,category:n}){const o=(0,c.useRef)();return(0,c.useEffect)((()=>{const e=setTimeout((()=>{const[e]=da.focus.tabbable.find(o.current);e?.focus()}));return()=>clearTimeout(e)}),[n]),(0,c.createElement)("div",{ref:o,className:"block-editor-inserter__media-dialog"},(0,c.createElement)(sg,{rootClientId:e,onInsert:t,category:n}))}function sg({rootClientId:e,onInsert:t,category:n}){const[o,r,l]=rg(),{mediaList:i,isLoading:a}=function(e,t={}){const[n,o]=(0,c.useState)(),[r,l]=(0,c.useState)(!1),i=(0,c.useRef)();return(0,c.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});i.current=n,l(!0),o([]);const r=await(e.fetch?.(t));n===i.current&&(o(r),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:l?20:ig,search:l}),s="block-editor-inserter__media-panel",u=n.labels.search_items||(0,v.__)("Search");return(0,c.createElement)("div",{className:s},(0,c.createElement)(m.SearchControl,{className:`${s}-search`,onChange:r,value:o,label:u,placeholder:u}),a&&(0,c.createElement)("div",{className:`${s}-spinner`},(0,c.createElement)(m.Spinner,null)),!a&&!i?.length&&(0,c.createElement)(lg,null),!a&&!!i?.length&&(0,c.createElement)(og,{rootClientId:e,onClick:t,mediaList:i,category:n}))}var cg=function({fallback:e=null,children:t}){const n=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return!!t().mediaUpload}),[]);return n?t:e};var ug=(0,m.withFilters)("editor.MediaUpload")((()=>null));const dg=["image","video","audio"];var pg=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o}){const r=Wf(e),l=(0,p.useViewportMatch)("medium","<"),i="block-editor-inserter__media-tabs",a=(0,c.useCallback)((e=>{if(!e?.url)return;const[t]=Yf(e,e.type);o(t)}),[o]),s=(0,c.useMemo)((()=>r.map((e=>({...e,label:e.labels.name})))),[r]);return(0,c.createElement)(c.Fragment,null,!l&&(0,c.createElement)("div",{className:`${i}-container`},(0,c.createElement)("nav",{"aria-label":(0,v.__)("Media categories")},(0,c.createElement)(m.__experimentalItemGroup,{role:"list",className:i},r.map((e=>(0,c.createElement)(m.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>n(e),className:d()(`${i}__media-category`,{"is-selected":t===e}),"aria-label":e.labels.name,"aria-current":e===t?"true":void 0},(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.FlexBlock,null,e.labels.name),(0,c.createElement)(ai,{icon:(0,v.isRTL)()?Qd:Xd}))))),(0,c.createElement)("div",{role:"listitem"},(0,c.createElement)(cg,null,(0,c.createElement)(ug,{multiple:!1,onSelect:a,allowedTypes:dg,render:({open:e})=>(0,c.createElement)(m.Button,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,v.__)("Open Media Library"))})))))),l&&(0,c.createElement)(Nf,{categories:s},(t=>(0,c.createElement)(sg,{onInsert:o,rootClientId:e,category:t}))))};const{Fill:mg,Slot:fg}=(0,m.createSlotFill)("__unstableInserterMenuExtension");mg.Slot=fg;var gg=mg;const hg=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let o=t.indexOf(e),r=t.indexOf(n);return o<0&&(o=t.length),r<0&&(r=t.length),o-r})),e):e,bg=[];var vg=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:g=!0,shouldFocusBlock:h=!0,prioritizePatterns:b,selectBlockOnInsert:_}){const k=(0,p.useDebounce)(Ln.speak,500),{prioritizedBlocks:y}=(0,f.useSelect)((e=>{const t=e(Jo).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||bg}}),[r]),[E,w]=cf({onSelect:t,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:h,selectBlockOnInsert:_}),[S,C,x,B]=qm(E,w),[I,,T]=Jm(w,E),M=(0,c.useMemo)((()=>{if(0===s)return[];const t=Ef(I,e);return void 0!==s?t.slice(0,s):t}),[e,I,s]);let P=u;b&&M.length>2&&(P=0);const N=(0,c.useMemo)((()=>{if(0===P)return[];let t=K(S.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&y.length&&(t=hg(t,y));const n=yf(t,C,x,e);return void 0!==P?n.slice(0,P):n}),[e,S,C,x,P,y]);(0,c.useEffect)((()=>{if(!e)return;const t=N.length+M.length,n=(0,v.sprintf)((0,v._n)("%d result found.","%d results found.",t),t);k(n)}),[e,k,N,M]);const L=(0,p.useAsyncList)(N,{step:9}),R=(0,p.useAsyncList)(L.length===N.length?M:bg),A=N.length>0||M.length>0,D=!!N.length&&(0,c.createElement)(Km,{title:(0,c.createElement)(m.VisuallyHidden,null,(0,v.__)("Blocks"))},(0,c.createElement)(Wm,{items:L,onSelect:B,onHover:n,label:(0,v.__)("Blocks"),isDraggable:g})),O=!!M.length&&(0,c.createElement)(Km,{title:(0,c.createElement)(m.VisuallyHidden,null,(0,v.__)("Block patterns"))},(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,c.createElement)(rf,{shownPatterns:R,blockPatterns:M,onClickPattern:T,onHover:o,isDraggable:g})));return(0,c.createElement)(Zm,null,!d&&!A&&(0,c.createElement)(lg,null),b?O:D,!!N.length&&!!M.length&&(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?D:O,d&&(0,c.createElement)(gg.Slot,{fillProps:{onSelect:B,onHover:n,filterValue:e,hasItems:A,rootClientId:E}},(e=>e.length?e:A?null:(0,c.createElement)(lg,null))))};const _g={name:"blocks",title:(0,v.__)("Blocks")},kg={name:"patterns",title:(0,v.__)("Patterns")},yg={name:"media",title:(0,v.__)("Media")};var Eg=function({children:e,showPatterns:t=!1,showMedia:n=!1,onSelect:o,prioritizePatterns:r}){const l=(0,c.useMemo)((()=>{const e=[];return r&&t&&e.push(kg),e.push(_g),!r&&t&&e.push(kg),n&&e.push(yg),e}),[r,t,n]);return(0,c.createElement)(m.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:o},e)};var wg=(0,c.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalFilterValue:a="",shouldFocusBlock:s=!0,prioritizePatterns:u},p){const[g,h,b]=rg(a),[_,k]=(0,c.useState)(null),[y,E]=(0,c.useState)(null),[w,S]=(0,c.useState)("all"),[C,x]=(0,c.useState)(null),[B,I]=(0,c.useState)(null),[T,M,P]=cf({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:s}),{showPatterns:N,inserterItems:L}=(0,f.useSelect)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(Jo);return{showPatterns:!!t(T).length,inserterItems:n(T)}}),[T]),R=(0,c.useMemo)((()=>L.some((({category:e})=>"reusable"===e))),[L]),A=!!Wf(T).length,D=(0,c.useCallback)(((e,t,n)=>{M(e,t,n),r()}),[M,r]),O=(0,c.useCallback)(((e,t)=>{M(e,{patternName:t}),r()}),[M,r]),z=(0,c.useCallback)((e=>{P(!!e),k(e)}),[P,k]),V=(0,c.useCallback)((e=>{P(!!e)}),[P]),F=(0,c.useCallback)(((e,t)=>{E(e),S(t)}),[E]),H=(0,c.useMemo)((()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:"block-editor-inserter__block-list"},(0,c.createElement)(Xm,{rootClientId:T,onInsert:D,onHover:z,showMostUsedBlocks:i})),l&&(0,c.createElement)("div",{className:"block-editor-inserter__tips"},(0,c.createElement)(m.VisuallyHidden,{as:"h2"},(0,v.__)("A tip for using the block editor")),(0,c.createElement)(Yd,null)))),[T,D,z,i,l]),G=(0,c.useMemo)((()=>(0,c.createElement)(jf,{rootClientId:T,onInsert:O,onSelectCategory:F,selectedCategory:y})),[T,O,F,y]),U=(0,c.useMemo)((()=>(0,c.createElement)(pg,{rootClientId:T,selectedCategory:C,onSelectCategory:x,onInsert:D})),[T,D,C,x]),$=(0,c.useCallback)((e=>"blocks"===e.name?H:"patterns"===e.name?G:"media"===e.name?U:void 0),[H,G,U]),j=(0,c.useRef)();(0,c.useImperativeHandle)(p,(()=>({focusSearch:()=>{j.current.focus()}})));const W="patterns"===B&&!b&&y,K=!b&&(N||R||A),q="media"===B&&!b&&C;return(0,c.createElement)("div",{className:"block-editor-inserter__menu"},(0,c.createElement)("div",{className:d()("block-editor-inserter__main-area",{"show-as-tabs":K})},(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{_&&k(null),h(e)},value:g,label:(0,v.__)("Search for blocks and patterns"),placeholder:(0,v.__)("Search"),ref:j}),!!b&&(0,c.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,c.createElement)(vg,{filterValue:b,onSelect:r,onHover:z,onHoverPattern:V,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:s})),K&&(0,c.createElement)(Eg,{showPatterns:N,showReusableBlocks:R,showMedia:A,prioritizePatterns:u,onSelect:e=>{"patterns"!==e&&E(null),I(e)}},$),!b&&!K&&(0,c.createElement)("div",{className:"block-editor-inserter__no-tab-container"},H)),q&&(0,c.createElement)(ag,{rootClientId:T,onInsert:D,category:C}),l&&_&&(0,c.createElement)(Om,{item:_}),W&&(0,c.createElement)(Uf,{rootClientId:T,onInsert:O,onHover:V,category:y,patternFilter:w,showTitlesAsTooltip:!0}))}));function Sg({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:l}){const[i,a]=(0,c.useState)(""),[s,u]=cf({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:l}),[p]=qm(s,u),[g]=Jm(u,s),{setInserterIsOpened:h,insertionIndex:b}=(0,f.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(Jo),l=t(),i=o(n),a=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?a:i}}),[n]),_=g.length&&(!!i||r),k=_&&g.length>6||p.length>6;(0,c.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return _&&(y=r?4:2),(0,c.createElement)("div",{className:d()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":h})},k&&(0,c.createElement)(m.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,v.__)("Search for blocks and patterns"),placeholder:(0,v.__)("Search")}),(0,c.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,c.createElement)(vg,{filterValue:i,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:l})),h&&(0,c.createElement)(m.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:t,insertionIndex:b,filterValue:i})},"aria-label":(0,v.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,v.__)("Browse all")))}const Cg=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:l={},prioritizePatterns:i})=>{const{as:a=m.Button,label:s,onClick:u,...d}=l;let p=s;return!p&&r?p=(0,v.sprintf)((0,v._x)("Add %s","directly add the only allowed block"),o):!p&&i?p=(0,v.__)("Add pattern"):p||(p=(0,v._x)("Add block","Generic label for block inserter button")),(0,c.createElement)(a,{icon:qd,label:p,tooltipPosition:"bottom",onClick:function(t){e&&e(t),u&&u(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...d})};class xg extends c.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({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:o,hasSingleBlockType:r,directInsertBlock:l,toggleProps:i,hasItems:a,renderToggle:s=Cg,prioritizePatterns:c}=this.props;return s({onToggle:e,isOpen:t,disabled:n||!a,blockTitle:o,hasSingleBlockType:r,directInsertBlock:l,toggleProps:i,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:l,prioritizePatterns:i,onSelectOrClose:a,selectBlockOnInsert:s}=this.props;return l?(0,c.createElement)(Sg,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;a&&"function"==typeof a&&a(n),e()},rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:s}):(0,c.createElement)(wg,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,prioritizePatterns:i})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,c.createElement)(m.Dropdown,{className:"block-editor-inserter",contentClassName:d()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,v.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Bg=(0,p.compose)([(0,f.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:l,getAllowedBlocks:i,getDirectInsertBlock:s,getSettings:c}=e(Jo),{getBlockVariations:u}=e(a.store),d=i(n=n||r(t)||void 0),p=o&&s(n),m=c(),f=1===d?.length&&0===u(d[0].name,"inserter")?.length;let g=!1;return f&&(g=d[0]),{hasItems:l(n),hasSingleBlockType:f,blockTitle:g?g.title:"",allowedBlockType:g,directInsertBlock:p,rootClientId:n,prioritizePatterns:m.__experimentalPreferPatternsOnRoot&&!n}})),(0,f.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!c)return;const{insertBlock:p}=e(Jo);let m;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=n(Jo);if(!e||!r&&!o)return{};const i={};let a={};if(r){const e=t(r),n=t(l(r));e?.name===n?.name&&(a=n?.attributes||{})}else{const e=t(o);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&c?.name===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(i[e]=a[e])})),i}(c.attributesToCopy);m=(0,a.createBlock)(c.name,{...c.attributes||{},...e})}else m=(0,a.createBlock)(s.name);p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:a}=n(Jo);if(r)return e(r);const s=t();return!l&&s&&a(s)===o?e(s)+1:i(o).length}(),o,d),u&&u({clientId:m?.clientId});const f=(0,v.sprintf)((0,v.__)("%s block added"),s.title);(0,Ln.speak)(f)}}))),(0,p.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(xg);var Ig=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(Bg,{ref:t,...e})));var Tg=(0,p.compose)((0,f.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Jo),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,f.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Jo);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function({isLocked:e,onAppend:t,showPrompt:n,placeholder:o,rootClientId:r}){if(e)return null;const l=(0,Kd.decodeEntities)(o)||(0,v.__)("Type / to choose a block");return(0,c.createElement)("div",{"data-root-client-id":r||"",className:d()("block-editor-default-block-appender",{"has-visible-prompt":n})},(0,c.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,v.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Pd.ENTER!==e.keyCode&&Pd.SPACE!==e.keyCode||t()},onClick:()=>t(),onFocus:()=>{n&&t()}},n?l:"\ufeff"),(0,c.createElement)(Ig,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Mg({rootClientId:e,className:t,onFocus:n,tabIndex:o},r){return(0,c.createElement)(Ig,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:l,isOpen:i,blockTitle:a,hasSingleBlockType:s})=>{let u;u=s?(0,v.sprintf)((0,v._x)("Add %s","directly add the only allowed block"),a):(0,v._x)("Add block","Generic label for block inserter button");const p=!s;let f=(0,c.createElement)(m.Button,{ref:r,onFocus:n,tabIndex:o,className:d()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":p?"true":void 0,"aria-expanded":p?i:void 0,disabled:l,label:u},!s&&(0,c.createElement)(m.VisuallyHidden,{as:"span"},u),(0,c.createElement)(ai,{icon:qd}));return(p||s)&&(f=(0,c.createElement)(m.Tooltip,{text:u},f)),f},isAppender:!0})}const Pg=(0,c.forwardRef)(((e,t)=>($()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Mg(e,t))));var Ng=(0,c.forwardRef)(Mg);function Lg({rootClientId:e}){return(0,f.useSelect)((t=>t(Jo).canInsertBlockType((0,a.getDefaultBlockName)(),e)))?(0,c.createElement)(Tg,{rootClientId:e}):(0,c.createElement)(Ng,{rootClientId:e,className:"block-list-appender__toggle"})}var Rg=function({rootClientId:e,renderAppender:t,className:n,tagName:o="div"}){const r=function(e,t){const n=(0,f.useSelect)((n=>{const{getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:l,getBlockEditingMode:i}=n(Jo);if(!1===t)return!1;if(!t){const t=r();if(e!==t&&(e||t))return!1}return!o(e)&&"disabled"!==i(e)&&"zoom-out"!==l()}),[e,t]);return n?t?(0,c.createElement)(t,null):(0,c.createElement)(Lg,{rootClientId:e}):null}(e,t),l=(0,f.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(Jo),l=n();return o()&&e===l?.rootClientId&&0===r(e)}),[e]);return r?(0,c.createElement)(o,{tabIndex:-1,className:d()("block-list-appender wp-block",n,{"is-drag-over":l}),contentEditable:!1,"data-block":!0},r):null};var Ag=function(e){return(0,p.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 Dg=Number.MAX_SAFE_INTEGER;(0,c.createContext)();var Og=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,...l}){const[i,a]=(0,c.useReducer)((e=>(e+1)%Dg),0),{orientation:s,rootClientId:u,isVisible:p}=(0,f.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:l}=n(Jo),i=r(null!=e?e:t);return{orientation:o(i)?.orientation||"vertical",rootClientId:i,isVisible:l(e)&&l(t)}}),[e,t]),g=zd(e),h=zd(t),b="vertical"===s,_=(0,c.useMemo)((()=>{if(i<0||!g&&!h||!p)return;return{contextElement:g||h,getBoundingClientRect(){const e=g?g.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;let n=0,o=0,r=0,l=0;return b?(o=e?e.bottom:t.top,r=e?e.width:t.width,l=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,l=e?e.height:t.height,(0,v.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0)),new window.DOMRect(n,o,r,l)}}}),[g,h,i,b,p]),k=Ag(r);return(0,c.useLayoutEffect)((()=>{if(!g)return;const e=new window.MutationObserver(a);return e.observe(g,{attributes:!0}),()=>{e.disconnect()}}),[g]),(0,c.useLayoutEffect)((()=>{if(!h)return;const e=new window.MutationObserver(a);return e.observe(h,{attributes:!0}),()=>{e.disconnect()}}),[h]),(0,c.useLayoutEffect)((()=>{if(g)return g.ownerDocument.defaultView.addEventListener("resize",a),()=>{g.ownerDocument.defaultView?.removeEventListener("resize",a)}}),[g]),(g||h)&&p?(0,c.createElement)(m.Popover,{ref:k,animate:!1,anchor:_,focusOnMount:!1,__unstableSlotName:o,inline:!o,key:t+"--"+u,...l,className:d()("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"},(0,c.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},n)):null};const zg=Number.MAX_SAFE_INTEGER;var Vg=(0,c.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:r=!1,__unstablePopoverSlot:l,__unstableContentRef:i,shift:a=!0,...s},u){const f=zd(e),g=zd(null!=t?t:e),h=(0,p.useMergeRefs)([u,Ag(i)]),[b,v]=(0,c.useReducer)((e=>(e+1)%zg),0);(0,c.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(v);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]);const _=(0,c.useMemo)((()=>b<0||!f||g!==f?{}:{position:"absolute",width:f.offsetWidth,height:f.offsetHeight}),[f,g,o,b]),k=(0,c.useMemo)((()=>{if(!(b<0||!f||t&&!g))return{getBoundingClientRect(){var e,t,n,o;const r=f.getBoundingClientRect(),l=g?.getBoundingClientRect(),i=Math.min(r.left,null!==(e=l?.left)&&void 0!==e?e:1/0),a=Math.min(r.top,null!==(t=l?.top)&&void 0!==t?t:1/0),s=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-a;return new window.DOMRect(i,a,s,c)},contextElement:f}}),[t,g,f,b]);return!f||t&&!g?null:(0,c.createElement)(m.Popover,{ref:h,animate:!1,focusOnMount:!1,anchor:k,__unstableSlotName:l,inline:!l,placement:"top-start",resize:!1,flip:!1,shift:a,...s,className:d()("block-editor-block-popover",s.className),variant:"unstyled"},r&&(0,c.createElement)("div",{style:_},n),!r&&n)}));const Fg={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Hg=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,f.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(Jo),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,p.useReducedMotion)();return(0,c.createElement)(Vg,{clientId:n,__unstableCoverTarget:!0,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone"},(0,c.createElement)(m.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?Fg.show:Fg.hide,animate:Fg.show,exit:o?Fg.show:Fg.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Gg=(0,c.createContext)();function Ug({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:o}=(0,f.useDispatch)(Jo),r=(0,c.useContext)(Gg),l=(0,c.useRef)(),{orientation:i,previousClientId:a,nextClientId:s,rootClientId:u,isInserterShown:g,isDistractionFree:h,isNavigationMode:b}=(0,f.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:l,getNextBlockClientId:i,getSettings:a,isNavigationMode:s}=e(Jo),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=l(d);for(;r(p);)p=i(p);const m=a();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:s(),isDistractionFree:m.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),v=(0,p.useReducedMotion)();const _={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:g?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},k={start:{scale:v?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h&&!b)return null;const y=d()("block-editor-block-list__insertion-point","is-"+i);return(0,c.createElement)(Og,{previousClientId:a,nextClientId:s,__unstablePopoverSlot:e,__unstableContentRef:t},(0,c.createElement)(m.__unstableMotion.div,{layout:!v,initial:v?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&s&&n(s,-1)},onFocus:function(e){e.target!==l.current&&(r.current=!0)},className:d()(y,{"is-with-inserter":g}),onHoverEnd:function(e){e.target!==l.current||r.current||o()}},(0,c.createElement)(m.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),g&&(0,c.createElement)(m.__unstableMotion.div,{variants:k,className:d()("block-editor-block-list__insertion-point-inserter")},(0,c.createElement)(Ig,{position:"bottom center",clientId:s,rootClientId:u,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function $g(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,f.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(Jo),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,c.createElement)(Hg,{key:`${t.rootClientId}-${t.index}`,...e}):(0,c.createElement)(Ug,{...e})}function jg(){const e=(0,c.useContext)(Gg),t=(0,f.useSelect)((e=>e(Jo).getSettings().isDistractionFree||"zoom-out"===e(Jo).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:l,getTemplateLock:i,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:s}=(0,f.useSelect)(Jo),{showInsertionPoint:u,hideInsertionPoint:d}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((c=>{if(!t)return c.addEventListener("mousemove",p),()=>{c.removeEventListener("mousemove",p)};function p(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let c;if(!t.target.classList.contains("is-root-container")){c=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(i(c)||"disabled"===s(c))return;const p=n(c)?.orientation||"vertical",m=t.clientY,f=t.clientX;let g=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===p&&((0,v.isRTL)()?t.right<f:t.left>f)}));if(!g)return void d();if(!g.id&&(g=g.firstElementChild,!g))return void d();const h=g.id.slice(6);if(!h||a(h))return;if(l().includes(h))return;const b=g.getBoundingClientRect();if("horizontal"===p&&(t.clientY>b.bottom||t.clientY<b.top)||"vertical"===p&&(t.clientX>b.right||t.clientX<b.left))return void d();const _=o(h);0!==_?u(c,_,{__unstableWithInserter:!0}):d()}}),[e,n,o,r,u,d,l,t])}var Wg=(0,p.createHigherOrderComponent)((e=>t=>{const{clientId:n}=rr();return(0,c.createElement)(e,{...t,clientId:n})}),"withClientId");var Kg=Wg((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:o,isToggle:r})=>(0,c.createElement)(Ng,{className:d()({"block-list-appender__toggle":r}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:o})));var qg=(0,p.compose)([Wg,(0,f.withSelect)(((e,{clientId:t})=>{const{getBlockOrder:n}=e(Jo),o=n(t);return{lastBlockClientId:o[o.length-1]}}))])((({clientId:e})=>(0,c.createElement)(Tg,{rootClientId:e}))),Zg=window.wp.isShallowEqual,Yg=n.n(Zg);const Xg=new WeakMap;function Qg(e,t,n,o,r,l,i,a,s,u,d){const{updateBlockListSettings:p}=(0,f.useDispatch)(Jo),m=(0,f.useRegistry)(),{parentLock:g}=(0,f.useSelect)((t=>{const n=t(Jo).getBlockRootClientId(e);return{parentLock:t(Jo).getTemplateLock(n)}}),[e]),h=function(e){const[t,n]=(0,c.useState)(e);return Yg()(t,e)||n(e),t}(t),b=(0,c.useMemo)((()=>n),n),v=void 0===a||"contentOnly"===g?g:a;(0,c.useLayoutEffect)((()=>{const t={allowedBlocks:h,prioritizedInserterBlocks:b,templateLock:v};if(void 0!==s&&(t.__experimentalCaptureToolbars=s),void 0!==u)t.orientation=u;else{const e=bi(d?.type);t.orientation=e.getOrientation(d)}void 0!==l&&($()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=l),void 0!==o&&(t.defaultBlock=o),void 0!==i&&($()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=i),void 0!==r&&(t.directInsert=r),Xg.get(m)||Xg.set(m,[]),Xg.get(m).push([e,t]),window.queueMicrotask((()=>{Xg.get(m)?.length&&m.batch((()=>{Xg.get(m).forEach((e=>{p(...e)})),Xg.set(m,[])}))}))}),[e,h,b,v,o,r,l,i,s,u,p,d,m])}function Jg(e,t,n,o,r,l,i){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){i();const e=p.map((e=>(0,a.cloneBlock)(e)));l(e,!0,null)}if("block"===d){const l=n(u[0]);if(c===e&&l===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,a=u.length;r(u,c,i&&l<t?t-a:t)}}}function eh(e,t,n={}){const{operation:o="insert"}=n,r=(0,f.useSelect)((e=>e(Jo).getSettings().mediaUpload),[]),{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:s,getBlockOrder:u,getBlocksByClientId:d}=(0,f.useSelect)(Jo),{insertBlocks:p,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:h,replaceBlocks:b,removeBlocks:v}=(0,f.useDispatch)(Jo),_=(0,f.useRegistry)(),k=(0,c.useCallback)(((n,r=!0,l=0)=>{if("replace"===o){const o=u(e)[t];b(o,n,void 0,l)}else p(n,t,e,r,l)}),[o,u,p,b,t,e]),y=(0,c.useCallback)(((n,r,l)=>{if("replace"===o){const o=d(n),r=u(e)[t];_.batch((()=>{v(n,!1),b(r,o,void 0,0)}))}else m(n,r,e,l)}),[o,u,d,p,m,v,t,e]),E=Jg(e,t,i,s,y,k,h),w=function(e,t,n,o,r,l){return t=>{if(!n)return;const i=(0,a.findTransform)((0,a.getBlockTransforms)("from"),(n=>"files"===n.type&&r(n.blockName,e)&&n.isMatch(t)));if(i){const e=i.transform(t,o);l(e)}}}(e,0,r,g,l,k),S=function(e,t,n){return e=>{const t=(0,a.pasteHandler)({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}(0,0,k);return e=>{const t=(0,da.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?S(n):t.length?w(t):E(e)}}function th(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const l=function(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)}(e,t,n);(void 0===o||l<o)&&(o=l,r=n)})),[o,r]}function nh(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function oh({rootClientId:e=""}={}){const t=(0,f.useRegistry)(),[n,o]=(0,c.useState)({index:null,operation:"insert"}),r=(0,f.useSelect)((t=>{const{__unstableIsWithinBlockOverlay:n,__unstableHasActiveBlockOverlayActive:o,getBlockEditingMode:r}=t(Jo);return"default"!==r(e)||o(e)||n(e)}),[e]),{getBlockListSettings:l,getBlocks:i,getBlockIndex:s}=(0,f.useSelect)(Jo),{showInsertionPoint:u,hideInsertionPoint:d}=(0,f.useDispatch)(Jo),m=eh(e,n.index,{operation:n.operation}),g=(0,p.useThrottle)((0,c.useCallback)(((n,r)=>{const c=i(e);if(0===c.length)return void t.batch((()=>{o({index:0,operation:"insert"}),u(e,0,{operation:"insert"})}));const d=c.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,a.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>r.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:s(t)}})),[p,m]=function(e,t,n="vertical"){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,v.isRTL)();let l=0,i="before",a=1/0;e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:n,blockIndex:s})=>{const c=n();let[u,d]=th(t,c,o);e&&nh(t,c)&&(u=0),u<a&&(i="bottom"===d||!r&&"right"===d||r&&"left"===d?"after":"before",a=u,l=s)}));const s=l+("after"===i?1:-1),c=!!e[l]?.isUnmodifiedDefaultBlock,u=!!e[s]?.isUnmodifiedDefaultBlock;if(!c&&!u)return["after"===i?l+1:l,"insert"];return[c?l:s,"replace"]}(d,{x:n.clientX,y:n.clientY},l(e)?.orientation);t.batch((()=>{o({index:p,operation:m}),u(e,p,{operation:m})}))}),[i,e,l,t,u,s]),200);return(0,p.__experimentalUseDropZone)({isDisabled:r,onDrop:m,onDragOver(e){g(e,e.currentTarget.ownerDocument)},onDragLeave(){g.cancel(),d()},onDragEnd(){g.cancel(),d()}})}const rh={};function lh(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:l,__experimentalDefaultBlock:i,__experimentalDirectInsert:s,template:u,templateLock:d,wrapperRef:p,templateInsertUpdatesSelection:m,__experimentalCaptureToolbars:g,__experimentalAppenderTagName:h,renderAppender:v,orientation:_,placeholder:k,layout:y}=e;Qg(t,n,o,r,l,i,s,d,g,_,y),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,f.useSelect)(Jo),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:u}=(0,f.useDispatch)(Jo),{innerBlocks:d}=(0,f.useSelect)((t=>({innerBlocks:t(Jo).getBlocks(e)})),[e]),p=(0,c.useRef)(null);(0,c.useLayoutEffect)((()=>{let c=!1;return window.queueMicrotask((()=>{if(c)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,f=!b()(t,p.current);if(!m||!f)return;p.current=t;const g=(0,a.synchronizeBlocksWithTemplate)(d,t);b()(g,d)||(u(),s(e,g,0===d.length&&o&&0!==g.length&&i(e),l()))})),()=>{c=!0}}),[d,t,n,e])}(t,u,d,m);const E=function(e){return(0,f.useSelect)((t=>{const n=t(Jo).getBlock(e);if(!n)return;const o=t(a.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t),w=(0,f.useSelect)((e=>e(Jo).getBlock(t)?.name),[t]),S=(0,a.getBlockSupport)(w,"layout")||(0,a.getBlockSupport)(w,"__experimentalLayout")||rh,{allowSizingOnChildren:C=!1}=S,x=bl("layout")||rh,B=y||S,I=(0,c.useMemo)((()=>({...x,...B,...C&&{allowSizingOnChildren:!0}})),[x,B,C]);return(0,c.createElement)(ma,{value:E},(0,c.createElement)(kh,{rootClientId:t,renderAppender:v,__experimentalAppenderTagName:h,layout:I,wrapperRef:p,placeholder:k}))}function ih(e){return rp(e),(0,c.createElement)(lh,{...e})}const ah=(0,c.forwardRef)(((e,t)=>{const n=sh({ref:t},e);return(0,c.createElement)("div",{className:"block-editor-inner-blocks"},(0,c.createElement)("div",{...n}))}));function sh(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o}=t,{clientId:r,layout:l=null,__unstableLayoutClassNames:i=""}=rr(),s=(0,p.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:u,hasOverlay:m}=(0,f.useSelect)((e=>{if(!r)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:l}=e(Jo),i=t(r),c="navigation"===l()||s;return{__experimentalCaptureToolbars:e(a.store).hasBlockSupport(i,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==i&&!n(r)&&!o(r,!0)&&c}}),[r,s]),g=oh({rootClientId:r}),h=(0,p.useMergeRefs)([e.ref,o?null:g]),b={__experimentalCaptureToolbars:u,layout:l,...t},v=b.value&&b.onChange?ih:lh;return{...e,ref:h,className:d()(e.className,"block-editor-block-list__layout",n?"":i,{"has-overlay":m}),children:r?(0,c.createElement)(v,{...b,clientId:r}):(0,c.createElement)(kh,{...t})}}sh.save=a.__unstableGetInnerBlocksProps,ah.DefaultBlockAppender=qg,ah.ButtonBlockAppender=Kg,ah.Content=()=>sh.save().children;var ch=ah;const uh=new Set([Pd.UP,Pd.RIGHT,Pd.DOWN,Pd.LEFT,Pd.ENTER,Pd.BACKSPACE]);function dh(){const e=(0,f.useSelect)((e=>e(Jo).isTyping()),[]),{stopTyping:t}=(0,f.useDispatch)(Jo);return(0,p.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 ph(){const{isTyping:e,hasInlineToolbar:t}=(0,f.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(Jo);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,f.useDispatch)(Jo),r=dh(),l=(0,p.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,a=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,da.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==Pd.ESCAPE&&t!==Pd.TAB||o()}function p(){a.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:o}=e;(0,da.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&uh.has(t)}(e))&&n()}return r.addEventListener("keypress",s),r.addEventListener("keydown",s),()=>{r.removeEventListener("keypress",s),r.removeEventListener("keydown",s)}}),[e,t,n,o]);return(0,p.useMergeRefs)([r,l])}var mh=function({children:e}){return(0,c.createElement)("div",{ref:ph()},e)};const fh=(0,c.createContext)(),gh=(0,c.createContext)(),hh=new WeakMap;function bh({className:e,...t}){const[n,o]=(0,c.useState)(),r=(0,p.useViewportMatch)("medium"),{isOutlineMode:l,isFocusMode:i,editorMode:a}=(0,f.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(Jo),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),s=(0,f.useRegistry)(),{setBlockVisibility:u}=(0,f.useDispatch)(Jo),m=(0,p.useDebounce)((0,c.useCallback)((()=>{const e={};hh.get(s).forEach((([t,n])=>{e[t]=n})),u(e)}),[s]),300,{trailing:!0}),g=(0,c.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{hh.get(s)||hh.set(s,[]);for(const t of e){const e=t.target.getAttribute("data-block");hh.get(s).push([e,t.isIntersecting])}m()}))}),[]),h=sh({ref:(0,p.useMergeRefs)([up(),jg(),ph()]),className:d()("is-root-container",e,{"is-outline-mode":l,"is-focus-mode":i&&r,"is-navigate-mode":"navigation"===a})},t);return(0,c.createElement)(fh.Provider,{value:n},(0,c.createElement)(gh.Provider,{value:g},(0,c.createElement)("div",{...h}),(0,c.createElement)("div",{ref:o})))}function vh(e){return(0,c.createElement)(or,{value:tr},(0,c.createElement)(bh,{...e}))}function _h({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=vi}){const{order:l,selectedBlocks:i,visibleBlocks:a}=(0,f.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(Jo);return{order:n(t),selectedBlocks:o(),visibleBlocks:r()}}),[t]);return(0,c.createElement)(ki,{value:r},l.map((e=>(0,c.createElement)(f.AsyncModeProvider,{key:e,value:!a.has(e)&&!i.includes(e)},(0,c.createElement)(Wd,{rootClientId:t,clientId:e})))),l.length<1&&e,(0,c.createElement)(Rg,{tagName:o,rootClientId:t,renderAppender:n}))}function kh(e){return(0,c.createElement)(f.AsyncModeProvider,{value:!1},(0,c.createElement)(_h,{...e}))}vh.__unstableElementContext=fh;var yh=window.wp.url;var Eh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,c.createElement)(F.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"}));var wh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 Sh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),Ch=window.wp.preferences;var xh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,c.createElement)(F.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));var Bh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}));var Ih=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));var Th=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,p.useReducedMotion)(),l=r?c.Fragment:m.__unstableAnimatePresence,i=r?"div":m.__unstableMotion.div,a=`link-control-settings-drawer-${(0,p.useInstanceId)(e)}`;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,v.isRTL)()?Bh:Ih,"aria-controls":a},(0,v._x)("Advanced","Additional link settings")),(0,c.createElement)(l,null,n&&(0,c.createElement)(i,{className:"block-editor-link-control__drawer",hidden:!n,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,c.createElement)("div",{className:"block-editor-link-control__drawer-inner"},t))))},Mh=n(5425),Ph=n.n(Mh);function Nh(e){return"function"==typeof e}class Lh extends c.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,c.createRef)(),this.inputRef=(0,c.createRef)(),this.updateSuggestions=(0,p.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Ph()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(o?.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const o=!e?.length;if(e=e.trim(),!o&&(e.length<2||!n&&(0,yh.isURL)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const r=t(e,{isInitialSuggestions:o});r.then((t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,isUpdatingSuggestions:!1,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,v.sprintf)((0,v._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,v.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===r&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=r}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case Pd.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Pd.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Pd.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Pd.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case Pd.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Pd.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,v.__)("Link selected.")));break;case Pd.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let l=r;const i=e&&e.length;return o||i||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,c.createElement)(c.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,v.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:a="",hideLabelFromVision:s=!1}=this.props,{loading:u,showSuggestions:p,selectedSuggestion:f,suggestionsListboxId:g,suggestionOptionIdPrefix:h}=this.state,b=`url-input-control-${r}`,_={id:b,label:t,className:d()("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:s},k={id:b,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,v.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":null!==f?`${h}-${f}`:void 0,ref:this.inputRef};return i?i(_,k,u):(e||$()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,c.createElement)(m.BaseControl,{__nextHasNoMarginBottom:e,..._},(0,c.createElement)("input",{...k}),u&&(0,c.createElement)(m.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===o.length)return null;const u={id:i,ref:this.autocompleteRef,role:"listbox"},p=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l||void 0});return Nh(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:u,buildSuggestionItemProps:p,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,c.createElement)(m.Popover,{placement:"bottom",focusOnMount:!1},(0,c.createElement)("div",{...u,className:d()("block-editor-url-input__suggestions",`${e}__suggestions`)},o.map(((e,t)=>(0,c.createElement)(m.Button,{...p(0,t),key:e.id,className:d()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)},e.title)))))}}var Rh=(0,p.compose)(p.withSafeTimeout,m.withSpokenMessages,p.withInstanceId,(0,f.withSelect)(((e,t)=>{if(Nh(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Jo);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Lh);var Ah=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return r=o?"function"==typeof o?o(e):o:(0,c.createInterpolateElement)((0,v.sprintf)((0,v.__)("Create: <mark>%s</mark>"),e),{mark:(0,c.createElement)("mark",null)}),(0,c.createElement)(m.MenuItem,{...n,iconPosition:"left",icon:qd,className:"block-editor-link-control__search-item",onClick:t},r)};var Dh=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));var Oh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 zh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var Vh=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"}));var Fh=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));var Hh=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const Gh={post:Dh,page:Oh,post_tag:zh,category:Vh,attachment:Fh};function Uh({isURL:e,suggestion:t}){let n=null;return e?n=Hh:t.type in Gh&&(n=Gh[t.type]),n?(0,c.createElement)(ai,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function $h(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function jh(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function Wh(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}var Kh=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:l=!1})=>{const i=r?(0,v.__)("Press ENTER to add this link"):(a=t.url)?(0,p.pipe)(yh.safeDecodeURI,yh.getPath,(e=>t=>null==t||t!=t?e:t)(""),((e,...t)=>(...n)=>e(...n,...t))(yh.filterURLForDisplay,24),jh,$h)(a):a;var a;return(0,c.createElement)(m.MenuItem,{...e,info:i,iconPosition:"left",icon:(0,c.createElement)(Uh,{suggestion:t,isURL:r}),onClick:o,shortcut:l&&Wh(t),className:"block-editor-link-control__search-item"},(0,c.createElement)(m.TextHighlight,{text:(0,da.__unstableStripHTML)(t.title),highlight:n}))};const qh="__CREATE__",Zh="link",Yh="mailto",Xh="internal",Qh=[Zh,Yh,"tel",Xh],Jh=[{id:"opensInNewTab",title:(0,v.__)("Open in new tab")}];function eb({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:l,suggestions:i,selectedSuggestion:a,isLoading:s,isInitialSuggestions:u,createSuggestionButtonText:p,suggestionsQuery:f}){const g=d()("block-editor-link-control__search-results",{"is-loading":s}),h=1===i.length&&Qh.includes(i[0].type),b=t&&!h&&!u,_=!f?.type,k=`block-editor-link-control-search-results-label-${e}`,y=u?(0,v.__)("Suggestions"):(0,v.sprintf)((0,v.__)('Search results for "%s"'),n),E=(0,c.createElement)(m.VisuallyHidden,{id:k},y);return(0,c.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},E,(0,c.createElement)("div",{...r,className:g,"aria-labelledby":k},(0,c.createElement)(m.MenuGroup,null,i.map(((e,t)=>b&&qh===e.type?(0,c.createElement)(Ah,{searchTerm:n,buttonText:p,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===a}):qh===e.type?null:(0,c.createElement)(Kh,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===a,isURL:Qh.includes(e.type),searchTerm:n,shouldShowType:_,isFrontPage:e?.isFrontPage}))))))}function tb(e){if(e.includes(" "))return!1;const t=(0,yh.getProtocol)(e),n=(0,yh.isValidProtocol)(t),o=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www."),l=e?.startsWith("#")&&(0,yh.isValidFragment)(e);return n||r||l||o}const nb=()=>Promise.resolve([]),ob=e=>{let t=Zh;const n=(0,yh.getProtocol)(e)||"";return n.includes("mailto")&&(t=Yh),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=Xh),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,yh.prependHTTP)(e):e,type:t}])};function rb(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?ob:nb;return(0,c.useCallback)(((t,{isInitialSuggestions:l})=>tb(t)?i(t,{isInitialSuggestions:l}):(async(e,t,n,o,r)=>{const{isInitialSuggestions:l}=t,i=await n(e,t);return i.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):e)),l||tb(e)||!o?i:i.concat({title:e,url:e,type:qh})})(t,{...e,isInitialSuggestions:l},r,n,o)),[i,r,l,e,n,o])}const lb=()=>Promise.resolve([]),ib=()=>{},ab=(0,c.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:l=!1,onCreateSuggestion:i=ib,onChange:a=ib,onSelect:s=ib,showSuggestions:u=!0,renderSuggestions:m=(e=>(0,c.createElement)(eb,{...e})),fetchSuggestions:f=null,allowDirectEntry:g=!0,showInitialSuggestions:h=!1,suggestionsQuery:b={},withURLSuggestion:_=!0,createSuggestionButtonText:k,hideLabelFromVision:y=!1},E)=>{const w=rb(b,g,l,_),S=u?f||w:lb,C=(0,p.useInstanceId)(ab),[x,B]=(0,c.useState)(),I=async e=>{let t=e;if(qh!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=null!=n?n:{};s({...r,...t},t)}}else try{t=await i(e.title),t?.url&&s(t)}catch(e){}},T=d()(o,{});return(0,c.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,c.createElement)(Rh,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,v.__)("Link"),hideLabelFromVision:y,className:T,value:e,onChange:(e,t)=>{a(e),B(t)},placeholder:null!=r?r:(0,v.__)("Search or type url"),__experimentalRenderSuggestions:u?e=>m({...e,instanceId:C,withCreateSuggestion:l,createSuggestionButtonText:k,suggestionsQuery:b,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:S,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,onSubmit:(t,n)=>{const o=t||x;o||e?.trim()?.length?I(o||{url:e}):n.preventDefault()},ref:E}),t)}));var sb=ab;var cb=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 ub=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"}));var db=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"}));const{Slot:pb,Fill:mb}=(0,m.createSlotFill)("BlockEditorLinkControlViewer");function fb(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 gb=function(e){const[t,n]=(0,c.useReducer)(fb,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,c.useEffect)((()=>{if(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 hb({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r,additionalControls:l}){const i=n?e?.url:null,{richData:a,isFetching:s}=gb(i),u=a&&Object.keys(a).length,p=e&&(0,yh.filterURLForDisplay)((0,yh.safeDecodeURI)(e.url),16)||"",f=!e?.url?.length,g=!f&&(0,da.__unstableStripHTML)(a?.title||e?.title||p);let h;return h=a?.icon?(0,c.createElement)("img",{src:a?.icon,alt:""}):f?(0,c.createElement)(ai,{icon:cb,size:32}):(0,c.createElement)(ai,{icon:Hh}),(0,c.createElement)("div",{"aria-label":(0,v.__)("Currently selected"),className:d()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!s,"is-preview":!0,"is-error":f,"is-url-title":g===p})},(0,c.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,c.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,c.createElement)("span",{className:d()("block-editor-link-control__search-item-icon",{"is-image":a?.icon})},h),(0,c.createElement)("span",{className:"block-editor-link-control__search-item-details"},f?(0,c.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,v.__)("Link is empty")):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},g),e?.url&&g!==p&&(0,c.createElement)("span",{className:"block-editor-link-control__search-item-info"},p)))),(0,c.createElement)(m.Button,{icon:ub,label:(0,v.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:t,iconSize:24}),o&&(0,c.createElement)(m.Button,{icon:db,label:(0,v.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:r,iconSize:24}),(0,c.createElement)(pb,{fillProps:e})),!!(u&&(a?.image||a?.description)||s)&&(0,c.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},(a?.image||s)&&(0,c.createElement)("div",{"aria-hidden":!a?.image,className:d()("block-editor-link-control__search-item-image",{"is-placeholder":!a?.image})},a?.image&&(0,c.createElement)("img",{src:a?.image,alt:""})),(a?.description||s)&&(0,c.createElement)("div",{"aria-hidden":!a?.description,className:d()("block-editor-link-control__search-item-description",{"is-placeholder":!a?.description})},a?.description&&(0,c.createElement)(m.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))),l&&l())}const bb=()=>{};var vb=({value:e,onChange:t=bb,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:o(t),checked:!!e&&!!e[t.id],help:t?.help})));return(0,c.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Currently selected link settings")),r)};const _b=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}}};const kb=()=>{},yb="core/block-editor",Eb="linkControlSettingsDrawer";function wb({searchInputPlaceholder:e,value:t,settings:n=Jh,onChange:o=kb,onRemove:r,onCancel:l,noDirectEntry:i=!1,showSuggestions:a=!0,showInitialSuggestions:s,forceIsEditingLink:u,createSuggestion:p,withCreateSuggestion:g,inputValue:h="",suggestionsQuery:b={},noURLSuggestion:_=!1,createSuggestionButtonText:k,hasRichPreviews:y=!1,hasTextControl:E=!1,renderControlBottom:w=null}){void 0===g&&p&&(g=!0);const[S,C]=(0,c.useState)(!1),{advancedSettingsPreference:x}=(0,f.useSelect)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(Ch.store).get(yb,Eb))&&void 0!==t&&t}}),[]),{set:B}=(0,f.useDispatch)(Ch.store),I=x||S,T=(0,c.useRef)(!0),M=(0,c.useRef)(),P=(0,c.useRef)(),N=(0,c.useRef)(!1),L=n.map((({id:e})=>e)),[R,A,D,O,z]=function(e){const[t,n]=(0,c.useState)(e||{});return(0,c.useEffect)((()=>{n((t=>e&&e!==t?e:t))}),[e]),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>o=>{const r=Object.keys(o).reduce(((t,n)=>(e.includes(n)&&(t[n]=o[n]),t)),{});n({...t,...r})}]}(t),V=t&&!(0,Zg.isShallowEqualObjects)(R,t),[F,H]=(0,c.useState)(void 0!==u?u:!t||!t.url),{createPage:G,isCreatingPage:U,errorMessage:$}=function(e){const t=(0,c.useRef)(),[n,o]=(0,c.useState)(!1),[r,l]=(0,c.useState)(null);return(0,c.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=_b(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,v.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(p);(0,c.useEffect)((()=>{void 0!==u&&H(u)}),[u]),(0,c.useEffect)((()=>{if(T.current)return void(T.current=!1);(da.focus.focusable.find(M.current)[0]||M.current).focus(),N.current=!1}),[F,U]);const j=t?.url?.trim()?.length>0,W=()=>{N.current=!!M.current?.contains(M.current.ownerDocument.activeElement),H(!1)},K=()=>{V&&o({...t,...R,url:q}),W()},q=h||R?.url||"",Z=!q?.trim()?.length,Y=r&&t&&!F&&!U,X=F&&j,Q=j&&E,J=(F||!t)&&!U,ee=!V||Z,te=!!n?.length&&F&&j;return(0,c.createElement)("div",{tabIndex:-1,ref:M,className:"block-editor-link-control"},U&&(0,c.createElement)("div",{className:"block-editor-link-control__loading"},(0,c.createElement)(m.Spinner,null)," ",(0,v.__)("Creating"),"…"),J&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:d()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Q,"has-actions":X})},Q&&(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,ref:P,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,v.__)("Text"),value:R?.title,onChange:O,onKeyDown:e=>{const{keyCode:t}=e;t!==Pd.ENTER||Z||(e.preventDefault(),K())},size:"__unstable-large"}),(0,c.createElement)(sb,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:q,withCreateSuggestion:g,onCreateSuggestion:G,onChange:D,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(L.includes(n)||(t[n]=e[n]),t)),{});o({...R,...t,title:R?.title||e?.title}),W()},showInitialSuggestions:s,allowDirectEntry:!i,showSuggestions:a,suggestionsQuery:b,withURLSuggestion:!_,createSuggestionButtonText:k,hideLabelFromVision:!Q}),!X&&(0,c.createElement)("div",{className:"block-editor-link-control__search-enter"},(0,c.createElement)(m.Button,{onClick:ee?kb:K,label:(0,v.__)("Submit"),icon:xh,className:"block-editor-link-control__search-submit","aria-disabled":ee}))),$&&(0,c.createElement)(m.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},$)),t&&!F&&!U&&(0,c.createElement)(hb,{key:t?.url,value:t,onEditClick:()=>H(!0),hasRichPreviews:y,hasUnlinkControl:Y,additionalControls:()=>{if(n?.find((e=>"opensInNewTab"===e.id)))return(0,c.createElement)(vb,{value:R,settings:n?.filter((({id:e})=>"opensInNewTab"===e)),onChange:o})},onRemove:()=>{r(),H(!0)}}),te&&(0,c.createElement)("div",{className:"block-editor-link-control__tools"},!Z&&(0,c.createElement)(Th,{settingsOpen:I,setSettingsOpen:e=>{B&&B(yb,Eb,e),C(e)}},(0,c.createElement)(vb,{value:R,settings:n,onChange:z(L)}))),X&&(0,c.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,c.createElement)(m.Button,{variant:"primary",onClick:ee?kb:K,className:"block-editor-link-control__search-submit","aria-disabled":ee},(0,v.__)("Save")),(0,c.createElement)(m.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),A(t),j?W():r?.(),l?.()}},(0,v.__)("Cancel"))),w&&w())}wb.ViewerFill=mb,wb.DEFAULT_LINK_SETTINGS=Jh;var Sb=wb;const Cb=()=>{};let xb=0;var Bb=(0,p.compose)([(0,f.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Qm.store);return{createNotice:t,removeNotice:n}})),(0,m.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:l,onSelect:i,onSelectURL:a,onToggleFeaturedImage:s,useFeaturedImage:u,onFilesUpload:p=Cb,name:g=(0,v.__)("Replace"),createNotice:h,removeNotice:b,children:_,multiple:k=!1,addToGallery:y,handleUpload:E=!0,popoverProps:w})=>{const S=(0,f.useSelect)((e=>e(Jo).getSettings().mediaUpload),[]),C=!!S,x=(0,c.useRef)(),B="block-editor/media-replace-flow/error-notice/"+ ++xb,I=e=>{const t=(0,da.__unstableStripHTML)(e);l?l(t):setTimeout((()=>{h("error",t,{speak:!0,id:B,isDismissible:!0})}),1e3)},T=(e,t)=>{u&&s&&s(),t(),i(e),(0,Ln.speak)((0,v.__)("The media file has been replaced")),b(B)},M=e=>{e.keyCode===Pd.DOWN&&(e.preventDefault(),e.target.click())},P=k&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,c.createElement)(m.Dropdown,{popoverProps:w,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,c.createElement)(m.ToolbarButton,{ref:x,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:M},g),renderContent:({onClose:l})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,c.createElement)(cg,null,(0,c.createElement)(ug,{gallery:P,addToGallery:y,multiple:k,value:k?n:t,onSelect:e=>T(e,l),allowedTypes:o,render:({open:e})=>(0,c.createElement)(m.MenuItem,{icon:Eh,onClick:e},(0,v.__)("Open Media Library"))}),(0,c.createElement)(m.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),i(n);p(n),S({allowedTypes:o,filesList:n,onFileChange:([e])=>{T(e,t)},onError:I})})(e,l)},accept:r,multiple:!!k,render:({openFileDialog:e})=>(0,c.createElement)(m.MenuItem,{icon:wh,onClick:()=>{e()}},(0,v.__)("Upload"))})),s&&(0,c.createElement)(m.MenuItem,{icon:Sh,onClick:s,isPressed:u},(0,v.__)("Use featured image")),_),a&&(0,c.createElement)("form",{className:d()("block-editor-media-flow__url-input",{"has-siblings":C||s})},(0,c.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,v.__)("Current media URL:")),(0,c.createElement)(m.Tooltip,{text:e},(0,c.createElement)("div",null,(0,c.createElement)(Sb,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),x.current.focus()}})))))})}));const Ib="background",Tb="image";function Mb({attributes:e={},setAttributes:t}){const{style:n={}}=e;t({style:Wl({...n,background:{...n?.background,backgroundImage:void 0}})})}function Pb({label:e,filename:t,url:n}){const o=e||(0,yh.getFilename)(n);return(0,c.createElement)(m.__experimentalItemGroup,{as:"span"},(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start",as:"span"},(0,c.createElement)("span",{className:d()("block-editor-hooks__background__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0},n&&(0,c.createElement)("span",{className:"block-editor-hooks__background__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})),(0,c.createElement)(m.FlexItem,{as:"span"},(0,c.createElement)(m.__experimentalTruncate,{numberOfLines:1,className:"block-editor-hooks__background__inspector-media-replace-title"},o),(0,c.createElement)(m.VisuallyHidden,{as:"span"},t?(0,v.sprintf)((0,v.__)("Selected image: %s"),t):(0,v.__)("No image selected")))))}function Nb(e){const{attributes:t,clientId:n,setAttributes:o}=e,{id:r,title:l,url:i}=t.style?.background?.backgroundImage||{},a=(0,c.useRef)(),{mediaUpload:s}=(0,f.useSelect)((e=>({mediaUpload:e(Jo).getSettings().mediaUpload}))),{createErrorNotice:u}=(0,f.useDispatch)(Qm.store),d=e=>{u(e,{type:"snackbar"})},p=e=>{if(!e||!e.url){const e={...t.style,background:{...t.style?.background,backgroundImage:void 0}},n={style:Wl(e)};return void o(n)}if((0,qf.isBlobURL)(e.url))return;if(e.media_type&&e.media_type!==Tb||!e.media_type&&e.type&&e.type!==Tb)return void d((0,v.__)("Only images can be used as a background image."));const n={...t.style,background:{...t.style?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0}}},r={style:Wl(n)};o(r)},g=(0,c.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),h=function(e){return!!e.attributes.style?.background?.backgroundImage?.id||!!e.attributes.style?.background?.backgroundImage?.url}(e);return(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>h,label:(0,v.__)("Background image"),onDeselect:()=>Mb(e),isShownByDefault:!0,resetAllFilter:g,panelId:n},(0,c.createElement)("div",{className:"block-editor-hooks__background__inspector-media-replace-container",ref:a},(0,c.createElement)(Bb,{mediaId:r,mediaURL:i,allowedTypes:[Tb],accept:"image/*",onSelect:p,name:(0,c.createElement)(Pb,{label:(0,v.__)("Background image"),filename:l,url:i}),variant:"secondary"},h&&(0,c.createElement)(m.MenuItem,{onClick:()=>{const[t]=da.focus.tabbable.find(a.current);t?.focus(),t?.click(),Mb(e)}},(0,v.__)("Reset "))),(0,c.createElement)(m.DropZone,{onFilesDrop:e=>{s({allowedTypes:["image"],filesList:e,onFileChange([e]){(0,qf.isBlobURL)(e?.url)||p(e)},onError:d})},label:(0,v.__)("Drop to upload")})))}function Lb(e){const t=bl("background.backgroundImage")&&function(e,t="any"){if("web"!==c.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,Ib);return!0===n||("any"===t?!!n?.backgroundImage:!!n?.[t])}(e.name,"backgroundImage");return t?(0,c.createElement)(la,{group:"background"},t&&(0,c.createElement)(Nb,{...e})):null}om([rm,am]);const Rb=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Ab=(e,t)=>e?.find((e=>e.color===t));function Db(e,t){if(e&&t)return`has-${cl(t)}-${e}`}function Ob(){const e={disableCustomColors:!bl("color.custom"),disableCustomGradients:!bl("color.customGradient")},t=bl("color.palette.custom"),n=bl("color.palette.theme"),o=bl("color.palette.default"),r=bl("color.defaultPalette");e.colors=(0,c.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,v._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t,r]);const l=bl("color.gradients.custom"),i=bl("color.gradients.theme"),a=bl("color.gradients.default"),s=bl("color.defaultGradients");return e.gradients=(0,c.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,v._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),s&&a&&a.length&&e.push({name:(0,v._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,v._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a,s]),e.hasColorsOrGradients=!!e.colors.length||!!e.gradients.length,e}function zb(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Vb(e={}){const{flat:t,...n}=e;return t||zb(Object.values(n).filter(Boolean))||"px"}function Fb(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,m.__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=zb(o);return 0===r||r?`${r}${l}`:void 0}function Hb(e={}){const t=Fb(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function Gb(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function Ub({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let l=Fb(o);void 0===l&&(l=Vb(t));const i=Gb(o)&&Hb(o),a=i?(0,v.__)("Mixed"):null;return(0,c.createElement)(m.__experimentalUnitControl,{...r,"aria-label":(0,v.__)("Border radius"),disableUnits:i,isOnly:!0,value:l,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const $b={topLeft:(0,v.__)("Top left"),topRight:(0,v.__)("Top right"),bottomLeft:(0,v.__)("Bottom left"),bottomRight:(0,v.__)("Bottom right")};function jb({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const l=t=>n=>{if(!e)return;const o=!isNaN(parseFloat(n))?n:void 0;e({...i,[t]:o})},i="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,c.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries($b).map((([e,o])=>{const[a,s]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(i[e]),u=i[e]?s:t[e]||t.flat;return(0,c.createElement)(m.Tooltip,{text:o,placement:"top",key:e},(0,c.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,c.createElement)(m.__experimentalUnitControl,{...r,"aria-label":o,value:[a,u].join(""),onChange:l(e),onUnitChange:(d=e,e=>{const o={...t};o[d]=e,n(o)}),size:"__unstable-large"})));var d})))}var Wb=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"}));function Kb({isLinked:e,...t}){const n=e?(0,v.__)("Unlink radii"):(0,v.__)("Link radii");return(0,c.createElement)(m.Tooltip,{text:n},(0,c.createElement)(m.Button,{...t,className:"component-border-radius-control__linked-button",isSmall:!0,icon:e?Wb:db,iconSize:24,"aria-label":n}))}const qb={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Zb=0,Yb={px:100,em:20,rem:20};function Xb({onChange:e,values:t}){const[n,o]=(0,c.useState)(!Gb(t)||!Hb(t)),[r,l]=(0,c.useState)({flat:"string"==typeof t?(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,m.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),i=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["px","em","rem"]}),a=Vb(r),s=i&&i.find((e=>e.value===a)),u=s?.step||1,[d]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(Fb(t));return(0,c.createElement)("fieldset",{className:"components-border-radius-control"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Radius")),(0,c.createElement)("div",{className:"components-border-radius-control__wrapper"},n?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Ub,{className:"components-border-radius-control__unit-control",values:t,min:Zb,onChange:e,selectedUnits:r,setSelectedUnits:l,units:i}),(0,c.createElement)(m.RangeControl,{label:(0,v.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:Zb,max:Yb[a],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${a}`:void 0)},step:u,__nextHasNoMarginBottom:!0})):(0,c.createElement)(jb,{min:Zb,onChange:e,selectedUnits:r,setSelectedUnits:l,values:t||qb,units:i}),(0,c.createElement)(Kb,{onClick:()=>o(!n),isLinked:n})))}function Qb(e){return[Jb(e),ev(e),tv(e),nv(e)].some(Boolean)}function Jb(e){return e?.border?.color}function ev(e){return e?.border?.radius}function tv(e){return e?.border?.style}function nv(e){return e?.border?.width}function ov({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Border"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const rv={radius:!0,color:!0,width:!0};function lv({as:e=ov,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=rv}){const a=$l(r),s=e=>{const t=a.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},u=(0,c.useCallback)((e=>{const t=a.flatMap((({colors:e})=>e)).find((({slug:t})=>e==="var:preset|color|"+t));return t?t.color:e}),[a]),d=(0,c.useMemo)((()=>{if((0,m.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:u(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?u(o?.border?.color):void 0}}),[o?.border,u]),p=e=>n({...t,border:e}),f=Jb(r),g=tv(r),h=nv(r),b=ev(r),_=(k=d?.radius,Rl({settings:r},"",k));var k;const y=e=>p({...d,radius:e}),E=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},w=(0,c.useCallback)((e=>({...e,border:void 0})),[]),S=i?.color||i?.width;return(0,c.createElement)(e,{resetAllFilter:w,value:t,onChange:n,panelId:l},(h||f)&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>(0,m.__experimentalIsDefinedBorder)(t?.border),label:(0,v.__)("Border"),onDeselect:()=>(()=>{if(E())return p({radius:t?.border?.radius});p(void 0)})(),isShownByDefault:S,panelId:l},(0,c.createElement)(m.__experimentalBorderBoxControl,{colors:a,enableAlpha:!0,enableStyle:g,onChange:e=>{const t={...e};(0,m.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:s(t[e]?.color)})})):t&&(t.color=s(t.color)),p({radius:d?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:d,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),b&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:E,label:(0,v.__)("Radius"),onDeselect:()=>y(void 0),isShownByDefault:i.radius,panelId:l},(0,c.createElement)(Xb,{values:_,onChange:e=>{y(e||void 0)}})))}const iv="__experimentalBorder",av=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},sv=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=av(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=av(e,"color",n);return o||{color:n}};function cv(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function uv(e){if((0,m.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o={...e};return o.border={...o.border,color:n?void 0:t},{style:Wl(o),borderColor:n}}function dv(e){return(0,m.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function pv({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=dv(e),o=t(n);return{...e,...uv(o)}}),[t]);return(0,c.createElement)(la,{group:"border",resetAllFilter:n},e)}function mv(e){const{clientId:t,name:n,attributes:o,setAttributes:r}=e,l=Zl(n),i=Qb(l),s=(0,c.useMemo)((()=>dv({style:o.style,borderColor:o.borderColor})),[o.style,o.borderColor]);if(!i)return null;const u=(0,a.getBlockSupport)(e.name,[iv,"__experimentalDefaultControls"]);return(0,c.createElement)(lv,{as:pv,panelId:t,settings:l,value:s,onChange:e=>{r(uv(e))},defaultControls:u})}function fv(e,t="any"){if("web"!==c.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,iv);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function gv(e,t,n){if(!fv(t,"color")||ql(t,iv,"color"))return e;const o=hv(n),r=d()(e.className,o);return e.className=r||void 0,e}function hv(e){const{borderColor:t,style:n}=e,o=Db("border-color",t);return d()({"has-border-color":t||n?.border?.color,[o]:!!o})}const bv=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{borderColor:r,style:l}=o,{colors:i}=Ob();if(!fv(n,"color")||ql(n,iv,"color"))return(0,c.createElement)(e,{...t});const{color:a}=sv({colors:i,namedColor:r}),{color:s}=sv({colors:i,namedColor:cv(l?.border?.top?.color)}),{color:u}=sv({colors:i,namedColor:cv(l?.border?.right?.color)}),{color:d}=sv({colors:i,namedColor:cv(l?.border?.bottom?.color)}),{color:p}=sv({colors:i,namedColor:cv(l?.border?.left?.color)}),m=Wl({borderTopColor:s||a,borderRightColor:u||a,borderBottomColor:d||a,borderLeftColor:p||a})||{};let f=t.wrapperProps;return f={...t.wrapperProps,style:{...t.wrapperProps?.style,...m}},(0,c.createElement)(e,{...t,wrapperProps:f})}),"withBorderColorPaletteStyles");function vv(e){if(e)return`has-${e}-gradient-background`}function _v(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function kv(e,t){const n=e?.find((e=>e.gradient===t));return n}function yv(e,t){const n=kv(e,t);return n&&n.slug}function Ev({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=rr(),o=bl("color.gradients.custom"),r=bl("color.gradients.theme"),l=bl("color.gradients.default"),i=(0,c.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:s}=(0,f.useSelect)((o=>{const{getBlockAttributes:r}=o(Jo),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,f.useDispatch)(Jo),d=(0,c.useCallback)((o=>{const r=yv(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=vv(a);let m;return m=a?_v(i,a):s,{gradientClass:p,gradientValue:m,setGradient:d}}(0,s.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return fv(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",gv),(0,s.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!fv(e,"color")||ql(e,iv,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),gv(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",bv);const wv=["colors","disableCustomColors","gradients","disableCustomGradients"],Sv={name:"color",title:(0,v.__)("Solid"),value:"color"},Cv={name:"gradient",title:(0,v.__)("Gradient"),value:"gradient"},xv=[Sv,Cv];function Bv({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:l,label:i,onColorChange:a,onGradientChange:s,colorValue:u,gradientValue:p,clearable:f,showTitle:g=!0,enableAlpha:h,headingLevel:b}){const v=a&&(e&&e.length>0||!n),_=s&&(t&&t.length>0||!o);if(!v&&!_)return null;const k={[Sv.value]:(0,c.createElement)(m.ColorPalette,{value:u,onChange:_?e=>{a(e),s()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:f,enableAlpha:h,headingLevel:b}),[Cv.value]:(0,c.createElement)(m.GradientPicker,{__nextHasNoMargin:!0,value:p,onChange:v?e=>{s(e),a()}:s,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:f,headingLevel:b})},y=e=>(0,c.createElement)("div",{className:"block-editor-color-gradient-control__panel"},k[e]);return(0,c.createElement)(m.BaseControl,{__nextHasNoMarginBottom:!0,className:d()("block-editor-color-gradient-control",l)},(0,c.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,c.createElement)(m.__experimentalVStack,{spacing:1},g&&(0,c.createElement)("legend",null,(0,c.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,c.createElement)(m.BaseControl.VisualLabel,null,i))),v&&_&&(0,c.createElement)(m.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:xv,initialTabName:p?Cv.value:!!v&&Sv.value},(e=>y(e.value))),!_&&y(Sv.value),!v&&y(Cv.value))))}function Iv(e){const t={};return t.colors=bl("color.palette"),t.gradients=bl("color.gradients"),t.disableCustomColors=!bl("color.custom"),t.disableCustomGradients=!bl("color.customGradient"),(0,c.createElement)(Bv,{...t,...e})}var Tv=function(e){return wv.every((t=>e.hasOwnProperty(t)))?(0,c.createElement)(Bv,{...e}):(0,c.createElement)(Iv,{...e})};function Mv(e){const t=Pv(e),n=Dv(e),o=Nv(e),r=Rv(e),l=Av(e),i=Lv(e);return t||n||o||r||l||i}function Pv(e){const t=$l(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Nv(e){const t=$l(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Lv(e){const t=$l(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Rv(e){const t=$l(e),n=jl(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Av(e){const t=$l(e),n=jl(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Dv(e){const t=$l(e),n=jl(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Ov({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Color"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,c.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},r))}const zv={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},Vv={placement:"left-start",offset:36,shift:!0},Fv=({indicators:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.__experimentalZStack,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,c.createElement)(m.Flex,{key:t,expanded:!1},(0,c.createElement)(m.ColorIndicator,{colorValue:e}))))),(0,c.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function Hv({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,c.createElement)(Tv,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:o,onGradientChange:e?o:void 0,clearable:t===n,headingLevel:3})}function Gv({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:l,colorGradientControlSettings:i,panelId:a}){const s=l.map((({key:e,label:t})=>({name:e,title:t})));return(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:a},(0,c.createElement)(m.Dropdown,{popoverProps:Vv,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:d()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,v.sprintf)((0,v.__)("Color %s styles"),e)};return(0,c.createElement)(m.Button,{...o},(0,c.createElement)(Fv,{indicators:r,label:e}))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,c.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===l.length&&(0,c.createElement)(Hv,{...l[0],colorGradientControlSettings:i}),l.length>1&&(0,c.createElement)(m.TabPanel,{tabs:s},(e=>{const t=l.find((t=>t.key===e.name));return t?(0,c.createElement)(Hv,{...t,colorGradientControlSettings:i}):null}))))}))}function Uv({as:e=Ov,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=zv,children:a}){const s=$l(r),u=jl(r),d=r?.color?.custom,p=r?.color?.customGradient,m=s.length>0||d,f=u.length>0||p,g=e=>Rl({settings:r},"",e),h=e=>{const t=s.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},b=e=>{const t=u.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},_=Dv(r),k=g(o?.color?.background),y=g(t?.color?.background),E=g(o?.color?.gradient),w=g(t?.color?.gradient),S=Nv(r),C=g(o?.elements?.link?.color?.text),x=g(t?.elements?.link?.color?.text),B=g(o?.elements?.link?.[":hover"]?.color?.text),I=g(t?.elements?.link?.[":hover"]?.color?.text),T=Pv(r),M=g(o?.color?.text),P=g(t?.color?.text),N=e=>{let o=dl(t,["color","text"],h(e));M===C&&(o=dl(o,["elements","link","color","text"],h(e))),n(o)},L=[{name:"caption",label:(0,v.__)("Captions"),showPanel:Lv(r)},{name:"button",label:(0,v.__)("Button"),showPanel:Av(r)},{name:"heading",label:(0,v.__)("Heading"),showPanel:Rv(r)},{name:"h1",label:(0,v.__)("H1"),showPanel:Rv(r)},{name:"h2",label:(0,v.__)("H2"),showPanel:Rv(r)},{name:"h3",label:(0,v.__)("H3"),showPanel:Rv(r)},{name:"h4",label:(0,v.__)("H4"),showPanel:Rv(r)},{name:"h5",label:(0,v.__)("H5"),showPanel:Rv(r)},{name:"h6",label:(0,v.__)("H6"),showPanel:Rv(r)}],R=(0,c.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...L.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),A=[T&&{key:"text",label:(0,v.__)("Text"),hasValue:()=>!!P,resetValue:()=>N(void 0),isShownByDefault:i.text,indicators:[M],tabs:[{key:"text",label:(0,v.__)("Text"),inheritedValue:M,setValue:N,userValue:P}]},_&&{key:"background",label:(0,v.__)("Background"),hasValue:()=>!!y||!!w,resetValue:()=>{const e=dl(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:i.background,indicators:[null!=E?E:k],tabs:[m&&{key:"background",label:(0,v.__)("Solid"),inheritedValue:k,setValue:e=>{const o=dl(t,["color","background"],h(e));o.color.gradient=void 0,n(o)},userValue:y},f&&{key:"gradient",label:(0,v.__)("Gradient"),inheritedValue:E,setValue:e=>{const o=dl(t,["color","gradient"],b(e));o.color.background=void 0,n(o)},userValue:w,isGradient:!0}].filter(Boolean)},S&&{key:"link",label:(0,v.__)("Link"),hasValue:()=>!!x||!!I,resetValue:()=>{let e=dl(t,["elements","link",":hover","color","text"],void 0);e=dl(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:i.link,indicators:[C,B],tabs:[{key:"link",label:(0,v.__)("Default"),inheritedValue:C,setValue:e=>{n(dl(t,["elements","link","color","text"],h(e)))},userValue:x},{key:"hover",label:(0,v.__)("Hover"),inheritedValue:B,setValue:e=>{n(dl(t,["elements","link",":hover","color","text"],h(e)))},userValue:I}]}].filter(Boolean);return L.forEach((({name:e,label:r,showPanel:l})=>{if(!l)return;const a=g(o?.elements?.[e]?.color?.background),s=g(o?.elements?.[e]?.color?.gradient),c=g(o?.elements?.[e]?.color?.text),u=g(t?.elements?.[e]?.color?.background),d=g(t?.elements?.[e]?.color?.gradient),p=g(t?.elements?.[e]?.color?.text),_="caption"!==e;A.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=dl(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:i[e],indicators:_?[c,null!=s?s:a]:[c],tabs:[m&&{key:"text",label:(0,v.__)("Text"),inheritedValue:c,setValue:o=>{n(dl(t,["elements",e,"color","text"],h(o)))},userValue:p},m&&_&&{key:"background",label:(0,v.__)("Background"),inheritedValue:a,setValue:o=>{const r=dl(t,["elements",e,"color","background"],h(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},f&&_&&{key:"gradient",label:(0,v.__)("Gradient"),inheritedValue:s,setValue:o=>{const r=dl(t,["elements",e,"color","gradient"],b(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,c.createElement)(e,{resetAllFilter:R,value:t,onChange:n,panelId:l},A.map((e=>(0,c.createElement)(Gv,{key:e.key,...e,colorGradientControlSettings:{colors:s,disableCustomColors:!d,gradients:u,disableCustomGradients:!p},panelId:l}))),a)}om([rm,am]);var $v=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:l,textColor:i,linkColor:a,enableAlphaChecker:s=!1}){const u=e||t;if(!u)return null;const d=i||n,p=a||o;if(!d&&!p)return null;const f=[{color:d,description:(0,v.__)("text color")},{color:p,description:(0,v.__)("link color")}],g=tm(u),h=g.alpha()<1,b=g.brightness(),_={level:"AA",size:l||!1!==l&&r>=24?"large":"small"};let k="",y="";for(const e of f){if(!e.color)continue;const t=tm(e.color),n=t.isReadable(g,_),o=t.alpha()<1;if(!n){if(h||o)continue;k=b<t.brightness()?(0,v.sprintf)((0,v.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,v.sprintf)((0,v.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),y=(0,v.__)("This color combination may be hard for people to read.");break}o&&s&&(k=(0,v.__)("Transparent text may be hard for people to read."),y=(0,v.__)("Transparent text may be hard for people to read."))}return k?((0,Ln.speak)(y),(0,c.createElement)("div",{className:"block-editor-contrast-checker"},(0,c.createElement)(m.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},k))):null};function jv(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Wv({clientId:e}){const[t,n]=(0,c.useState)(),[o,r]=(0,c.useState)(),[l,i]=(0,c.useState)(),a=Od(e);return(0,c.useEffect)((()=>{if(!a.current)return;r(jv(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&i(jv(e).color);let t=a.current,o=jv(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=jv(t).backgroundColor;n(o)})),(0,c.createElement)($v,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:l})}const Kv="color",qv=e=>{const t=(0,a.getBlockSupport)(e,Kv);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Zv=e=>{if("web"!==c.Platform.OS)return!1;const t=(0,a.getBlockSupport)(e,Kv);return null!==t&&"object"==typeof t&&!!t.link},Yv=e=>{const t=(0,a.getBlockSupport)(e,Kv);return null!==t&&"object"==typeof t&&!!t.gradients},Xv=e=>{const t=(0,a.getBlockSupport)(e,Kv);return t&&!1!==t.background},Qv=e=>{const t=(0,a.getBlockSupport)(e,Kv);return t&&!1!==t.text};function Jv(e,t,n){if(!qv(t)||ql(t,Kv))return e;const o=Yv(t),{backgroundColor:r,textColor:l,gradient:i,style:a}=n,s=e=>!ql(t,Kv,e),c=s("text")?Db("color",l):void 0,u=s("gradients")?vv(i):void 0,p=s("background")?Db("background-color",r):void 0,m=s("background")||s("gradients"),f=r||a?.color?.background||o&&(i||a?.color?.gradient),g=d()(e.className,c,u,{[p]:!(o&&a?.color?.gradient||!p),"has-text-color":s("text")&&(l||a?.color?.text),"has-background":m&&f,"has-link-color":s("link")&&a?.elements?.link?.color});return e.className=g||void 0,e}function e_(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,l=e?.color?.gradient,i=l?.startsWith("var:preset|gradient|")?l.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:l},{style:Wl(a),textColor:n,backgroundColor:r,gradient:i}}function t_(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function n_({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=t_(e),o=t(n);return{...e,...e_(o)}}),[t]);return(0,c.createElement)(la,{group:"color",resetAllFilter:n},e)}function o_(e){const{clientId:t,name:n,attributes:o,setAttributes:r}=e,l=Zl(n),i=Mv(l),s=(0,c.useMemo)((()=>t_({style:o.style,textColor:o.textColor,backgroundColor:o.backgroundColor,gradient:o.gradient})),[o.style,o.textColor,o.backgroundColor,o.gradient]);if(!i)return null;const u=(0,a.getBlockSupport)(e.name,[Kv,"__experimentalDefaultControls"]),d="web"===c.Platform.OS&&!s?.color?.gradient&&(l?.color?.text||l?.color?.link)&&!1!==(0,a.getBlockSupport)(e.name,[Kv,"enableContrastChecker"]);return(0,c.createElement)(Uv,{as:n_,panelId:t,settings:l,value:s,onChange:e=>{r(e_(e))},defaultControls:u,enableContrastChecker:!1!==(0,a.getBlockSupport)(e.name,[Kv,"enableContrastChecker"])},d&&(0,c.createElement)(Wv,{clientId:t}))}const r_=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{backgroundColor:r,textColor:l}=o,i=bl("color.palette.custom"),a=bl("color.palette.theme"),s=bl("color.palette.default"),u=(0,c.useMemo)((()=>[...i||[],...a||[],...s||[]]),[i,a,s]);if(!qv(n)||ql(n,Kv))return(0,c.createElement)(e,{...t});const d={};l&&!ql(n,Kv,"text")&&(d.color=Rb(u,l)?.color),r&&!ql(n,Kv,"background")&&(d.backgroundColor=Rb(u,r)?.color);let p=t.wrapperProps;return p={...t.wrapperProps,style:{...d,...t.wrapperProps?.style}},(0,c.createElement)(e,{...t,wrapperProps:p})}),"withColorPaletteStyles"),l_={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function i_({value:e="",onChange:t,fontFamilies:n,...o}){const r=bl("typography.fontFamilies");if(n||(n=r),!n||0===n.length)return null;const l=[{value:"",label:(0,v.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Font"),options:l,value:e,onChange:t,labelPosition:"top",...o})}(0,s.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return qv(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Yv(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Jv),(0,s.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!qv(e)||ql(e,Kv))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Jv(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",r_),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Kl({linkColor:Zv(r),textColor:Qv(r),backgroundColor:Xv(r),gradient:Yv(r)},l_,e,t,n,o)}));const a_=[{name:(0,v._x)("Regular","font style"),value:"normal"},{name:(0,v._x)("Italic","font style"),value:"italic"}],s_=[{name:(0,v._x)("Thin","font weight"),value:"100"},{name:(0,v._x)("Extra Light","font weight"),value:"200"},{name:(0,v._x)("Light","font weight"),value:"300"},{name:(0,v._x)("Regular","font weight"),value:"400"},{name:(0,v._x)("Medium","font weight"),value:"500"},{name:(0,v._x)("Semi Bold","font weight"),value:"600"},{name:(0,v._x)("Bold","font weight"),value:"700"},{name:(0,v._x)("Extra Bold","font weight"),value:"800"},{name:(0,v._x)("Black","font weight"),value:"900"}],c_=(e,t)=>e?t?(0,v.__)("Appearance"):(0,v.__)("Font style"):(0,v.__)("Font weight");function u_(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,s=c_(n,o),u={key:"default",name:(0,v.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},d=(0,c.useMemo)((()=>n&&o?(()=>{const e=[u];return a_.forEach((({name:t,value:n})=>{s_.forEach((({name:o,value:r})=>{const l="normal"===n?o:(0,v.sprintf)((0,v.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:l,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[u];return a_.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[u];return s_.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),p=d.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||d[0];return a&&(0,c.createElement)(m.CustomSelectControl,{...i,className:"components-font-appearance-control",label:s,describedBy:p?n?o?(0,v.sprintf)((0,v.__)("Currently selected font appearance: %s"),p.name):(0,v.sprintf)((0,v.__)("Currently selected font style: %s"),p.name):(0,v.sprintf)((0,v.__)("Currently selected font weight: %s"),p.name):(0,v.__)("No selected font appearance"),options:d,value:p,onChange:({selectedItem:e})=>t(e.style),__nextUnconstrainedWidth:!0})}const d_=1.5;var p_=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:o="60px",...r})=>{const l=function(e){return void 0!==e&&""!==e}(e),i=(e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return d_;default:return e}},a=l?e:"";n||$()("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=n?void 0:{marginBottom:24};return(0,c.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,c.createElement)(m.__experimentalNumberControl,{...r,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=i(e.value,n);return{...e,value:o}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(i(`${e}`,!1)):t()},label:(0,v.__)("Line height"),placeholder:d_,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"}))};function m_({value:e,onChange:t,__unstableInputWidth:n="60px",...o}){const r=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,c.createElement)(m.__experimentalUnitControl,{...o,label:(0,v.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:r,onChange:t})}var f_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 11.5h10V13H7z"}));var g_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"}));var h_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"}));var b_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"}));const v_=[{name:(0,v.__)("None"),value:"none",icon:f_},{name:(0,v.__)("Uppercase"),value:"uppercase",icon:g_},{name:(0,v.__)("Lowercase"),value:"lowercase",icon:h_},{name:(0,v.__)("Capitalize"),value:"capitalize",icon:b_}];function __({className:e,value:t,onChange:n}){return(0,c.createElement)("fieldset",{className:d()("block-editor-text-transform-control",e)},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Letter case")),(0,c.createElement)("div",{className:"block-editor-text-transform-control__buttons"},v_.map((e=>(0,c.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}var k_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}));var y_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const E_=[{name:(0,v.__)("None"),value:"none",icon:f_},{name:(0,v.__)("Underline"),value:"underline",icon:k_},{name:(0,v.__)("Strikethrough"),value:"line-through",icon:y_}];function w_({value:e,onChange:t,className:n}){return(0,c.createElement)("fieldset",{className:d()("block-editor-text-decoration-control",n)},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Decoration")),(0,c.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},E_.map((n=>(0,c.createElement)(m.Button,{key:n.value,icon:n.icon,label:n.name,isPressed:n.value===e,onClick:()=>{t(n.value===e?void 0:n.value)}})))))}var S_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z"}));var C_=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"}));const x_=[{name:(0,v.__)("Horizontal"),value:"horizontal-tb",icon:S_},{name:(0,v.__)("Vertical"),value:(0,v.isRTL)()?"vertical-lr":"vertical-rl",icon:C_}];function B_({className:e,value:t,onChange:n}){return(0,c.createElement)("fieldset",{className:d()("block-editor-writing-mode-control",e)},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},(0,v.__)("Orientation")),(0,c.createElement)("div",{className:"block-editor-writing-mode-control__buttons"},x_.map((e=>(0,c.createElement)(m.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const I_=1,T_=6;function M_(e){const t=N_(e),n=L_(e),o=R_(e),r=A_(e),l=D_(e),i=O_(e),a=z_(e),s=V_(e),c=P_(e);return t||n||o||r||l||c||i||a||s}function P_(e){var t,n,o,r;const l=!e?.typography?.customFontSize,i=null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{},a=[].concat(null!==(n=i?.custom)&&void 0!==n?n:[]).concat(null!==(o=i?.theme)&&void 0!==o?o:[]).concat(null!==(r=i.default)&&void 0!==r?r:[]);return!!a?.length||!l}function N_(e){var t,n,o;const r=e?.typography?.fontFamilies,l=[].concat(null!==(t=r?.custom)&&void 0!==t?t:[]).concat(null!==(n=r?.theme)&&void 0!==n?n:[]).concat(null!==(o=r?.default)&&void 0!==o?o:[]).sort(((e,t)=>(e?.name||e?.slug).localeCompare(t?.name||e?.slug)));return!!l?.length}function L_(e){return e?.typography?.lineHeight}function R_(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t||n}function A_(e){return e?.typography?.letterSpacing}function D_(e){return e?.typography?.textTransform}function O_(e){return e?.typography?.textDecoration}function z_(e){return e?.typography?.writingMode}function V_(e){return e?.typography?.textColumns}function F_({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const H_={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function G_({as:e=F_,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=H_}){var a,s,u;const d=e=>Rl({settings:r},"",e),p=N_(r),f=r?.typography?.fontFamilies,g=[].concat(null!==(a=f?.custom)&&void 0!==a?a:[]).concat(null!==(s=f?.theme)&&void 0!==s?s:[]).concat(null!==(u=f?.default)&&void 0!==u?u:[]),h=d(o?.typography?.fontFamily),b=e=>{const o=g?.find((({fontFamily:t})=>t===e))?.slug;n(dl(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},_=P_(r),k=!r?.typography?.customFontSize,y=function(e){var t,n,o,r;const l=null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{};return[].concat(null!==(n=l?.custom)&&void 0!==n?n:[]).concat(null!==(o=l?.theme)&&void 0!==o?o:[]).concat(null!==(r=l.default)&&void 0!==r?r:[]).reduce(((e,t)=>(e.some((({slug:e})=>e===t.slug))||e.push(t),e)),[])}(r),E=d(o?.typography?.fontSize),w=(e,o)=>{n(dl(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},S=R_(r),C=function(e){const t=e?.typography?.fontStyle,n=e?.typography?.fontWeight;return t?n?(0,v.__)("Appearance"):(0,v.__)("Font style"):(0,v.__)("Font weight")}(r),x=r?.typography?.fontStyle,B=r?.typography?.fontWeight,I=d(o?.typography?.fontStyle),T=d(o?.typography?.fontWeight),M=({fontStyle:e,fontWeight:o})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},P=L_(r),N=d(o?.typography?.lineHeight),L=e=>{n(dl(t,["typography","lineHeight"],e||void 0))},R=A_(r),A=d(o?.typography?.letterSpacing),D=e=>{n(dl(t,["typography","letterSpacing"],e||void 0))},O=V_(r),z=d(o?.typography?.textColumns),V=e=>{n(dl(t,["typography","textColumns"],e||void 0))},F=D_(r),H=d(o?.typography?.textTransform),G=e=>{n(dl(t,["typography","textTransform"],e||void 0))},U=O_(r),$=d(o?.typography?.textDecoration),j=e=>{n(dl(t,["typography","textDecoration"],e||void 0))},W=z_(r),K=d(o?.typography?.writingMode),q=e=>{n(dl(t,["typography","writingMode"],e||void 0))},Z=(0,c.useCallback)((e=>({...e,typography:{}})),[]);return(0,c.createElement)(e,{resetAllFilter:Z,value:t,onChange:n,panelId:l},p&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Font family"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>b(void 0),isShownByDefault:i.fontFamily,panelId:l},(0,c.createElement)(i_,{fontFamilies:g,value:h,onChange:b,size:"__unstable-large",__nextHasNoMarginBottom:!0})),_&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Font size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>w(void 0),isShownByDefault:i.fontSize,panelId:l},(0,c.createElement)(m.FontSizePicker,{value:E,onChange:w,fontSizes:y,disableCustomFontSizes:k,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),S&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:C,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{M({})},isShownByDefault:i.fontAppearance,panelId:l},(0,c.createElement)(u_,{value:{fontStyle:I,fontWeight:T},onChange:M,hasFontStyles:x,hasFontWeights:B,size:"__unstable-large",__nextHasNoMarginBottom:!0})),P&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>L(void 0),isShownByDefault:i.lineHeight,panelId:l},(0,c.createElement)(p_,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:N,onChange:L,size:"__unstable-large"})),R&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>D(void 0),isShownByDefault:i.letterSpacing,panelId:l},(0,c.createElement)(m_,{value:A,onChange:D,size:"__unstable-large",__unstableInputWidth:"auto"})),O&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Text columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>V(void 0),isShownByDefault:i.textColumns,panelId:l},(0,c.createElement)(m.__experimentalNumberControl,{label:(0,v.__)("Text columns"),max:T_,min:I_,onChange:V,size:"__unstable-large",spinControls:"custom",value:z,initialPosition:1})),U&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Text decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>j(void 0),isShownByDefault:i.textDecoration,panelId:l},(0,c.createElement)(w_,{value:$,onChange:j,size:"__unstable-large",__unstableInputWidth:"auto"})),W&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Text orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>q(void 0),isShownByDefault:i.writingMode,panelId:l},(0,c.createElement)(B_,{value:K,onChange:q,size:"__unstable-large",__nextHasNoMarginBottom:!0})),F&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>G(void 0),isShownByDefault:i.textTransform,panelId:l},(0,c.createElement)(__,{value:H,onChange:G,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}const U_="typography.lineHeight";var $_=window.wp.tokenList,j_=n.n($_);const W_="typography.__experimentalFontFamily";function K_(e,t,n){if(!(0,a.hasBlockSupport)(t,W_))return e;if(ql(t,nk,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(j_())(e.className);o.add(`has-${cl(n?.fontFamily)}-font-family`);const r=o.value;return e.className=r||void 0,e}(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,W_)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",K_),(0,s.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,W_))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),K_(o,e,n)},e}));const q_=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function Z_(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Y_(e){if(e)return`has-${cl(e)}-font-size`}const X_="typography.fontSize";function Q_(e,t,n){if(!(0,a.hasBlockSupport)(t,X_))return e;if(ql(t,nk,"fontSize"))return e;const o=new(j_())(e.className);o.add(Y_(n.fontSize));const r=o.value;return e.className=r||void 0,e}const J_=(0,p.createHigherOrderComponent)((e=>t=>{const n=bl("typography.fontSizes"),{name:o,attributes:{fontSize:r,style:l},wrapperProps:i}=t;if(!(0,a.hasBlockSupport)(o,X_)||ql(o,nk,"fontSize")||!r||l?.typography?.fontSize)return(0,c.createElement)(e,{...t});const s=q_(n,r,l?.typography?.fontSize).size,u={...t,wrapperProps:{...i,style:{fontSize:s,...i?.style}}};return(0,c.createElement)(e,{...u})}),"withFontSizeInlineStyles"),ek={fontSize:[["fontSize"],["style","typography","fontSize"]]};function tk(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}(0,s.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,a.hasBlockSupport)(e,X_)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Q_),(0,s.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,a.hasBlockSupport)(e,X_))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Q_(o,e,n)},e})),(0,s.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",J_),(0,s.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return Kl({fontSize:(0,a.hasBlockSupport)(r,X_)},ek,e,t,n,o)})),(0,s.addFilter)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!(0,a.hasBlockSupport)(e,X_)||ql(e,nk,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{const n=t?t(e):{},o=n?.style?.fontSize,r=Tl((0,f.select)(Jo).getSettings().__experimentalFeatures),l=o?Bl({size:o},r):null;return null===l?n:{...n,style:{...n?.style,fontSize:l}}},e}),11);const nk="typography",ok=[U_,X_,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",W_,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function rk(e){const t={...tk(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,l=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...tk(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:Wl(t),fontFamily:l,fontSize:r}}function lk(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function ik({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=lk(e),o=t(n);return{...e,...rk(o)}}),[t]);return(0,c.createElement)(la,{group:"typography",resetAllFilter:n},e)}function ak({clientId:e,name:t,attributes:n,setAttributes:o,__unstableParentLayout:r}){const l=Zl(t,r),i=M_(l),s=(0,c.useMemo)((()=>lk({style:n.style,fontFamily:n.fontFamily,fontSize:n.fontSize})),[n.style,n.fontSize,n.fontFamily]);if(!i)return null;const u=(0,a.getBlockSupport)(t,[nk,"__experimentalDefaultControls"]);return(0,c.createElement)(G_,{as:ik,panelId:e,settings:l,value:s,onChange:e=>{o(rk(e))},defaultControls:u})}var sk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,c.createElement)(F.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"}));const ck={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function uk({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,side:a,spacingSizes:s,type:u,value:d}){var g,h;d=Or(d,s);let b=s;const _=s.length<=8,k=(0,f.useSelect)((e=>{const t=e(Jo).getSettings();return t?.disableCustomSpacingSizes})),[y,E]=(0,c.useState)(!k&&void 0!==d&&!Ar(d)),w=(0,p.usePrevious)(d);d&&w!==d&&!Ar(d)&&!0!==y&&E(!0);const S=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["px","em","rem"]});let C=null;!_&&!y&&void 0!==d&&(!Ar(d)||Ar(d)&&t)?(b=[...s,{name:t?(0,v.__)("Mixed"):(0,v.sprintf)((0,v.__)("Custom (%s)"),d),slug:"custom",size:d}],C=b.length-1):t||(C=y?Dr(d,s):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Vr(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(d,s));const x=(0,c.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(C)),[C])[1]||S[0].value,B=parseFloat(C,10),I=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${s[e]?.slug}`},T=t?(0,v.__)("Mixed"):null,M=b.map(((e,t)=>({key:t,name:e.name}))),P=s.map(((e,t)=>({value:t,label:void 0}))),N=Mr.includes(a)&&i?Lr[a]:"",L=i?u?.toLowerCase():u,R=(0,v.sprintf)((0,v.__)("%1$s %2$s"),N,L).trim();return(0,c.createElement)(m.__experimentalHStack,{className:"spacing-sizes-control__wrapper"},e&&(0,c.createElement)(m.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),y&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalUnitControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:S,min:n,placeholder:T,disableUnits:t,label:R,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,c.createElement)(m.RangeControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,value:B,min:0,max:null!==(g=ck[x]?.max)&&void 0!==g?g:10,step:null!==(h=ck[x]?.steps)&&void 0!==h?h:.1,withInputField:!1,onChange:e=>{o([e,x].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),_&&!y&&(0,c.createElement)(m.RangeControl,{onMouseOver:l,onMouseOut:r,className:"spacing-sizes-control__range-control",value:C,onChange:e=>o(I(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===d&&o("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":s[C]?.name,renderTooltipContent:e=>void 0===d?void 0:s[e]?.name,min:0,max:s.length-1,marks:P,label:R,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:l,onBlur:r}),!_&&!y&&(0,c.createElement)(m.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:M.find((e=>e.key===C))||"",onChange:e=>{o(I(e.selectedItem.key,"selectList"))},options:M,label:R,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r}),!k&&(0,c.createElement)(m.Button,{label:y?(0,v.__)("Use size preset"):(0,v.__)("Set custom size"),icon:sk,onClick:()=>{E(!y)},isPressed:y,isSmall:!0,className:"spacing-sizes-control__custom-toggle",iconSize:24}))}const dk=["vertical","horizontal"];function pk({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const s=e=>n=>{if(!t)return;const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Or(a[t],l),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},u=r?.length?dk.filter((e=>Fr(r,e))):dk;return(0,c.createElement)(c.Fragment,null,u.map((t=>{const r="vertical"===t?a.top:a.left;return(0,c.createElement)(uk,{key:`spacing-sizes-control-${t}`,icon:Nr[t],label:Lr[t],minimumCustomValue:e,onChange:s(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:r,withInputField:!1})})))}function mk({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const s=r?.length?Mr.filter((e=>r.includes(e))):Mr,u=e=>n=>{const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Or(a[t],l),e)),{})};o[e]=n,t(o)};return(0,c.createElement)(c.Fragment,null,s.map((t=>(0,c.createElement)(uk,{key:`spacing-sizes-control-${t}`,icon:Nr[t],label:Lr[t],minimumCustomValue:e,onChange:u(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:a[t],withInputField:!1}))))}function fk({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,values:s}){return(0,c.createElement)(uk,{label:Lr[l],minimumCustomValue:e,onChange:(u=l,e=>{const n={...Object.keys(s).reduce(((e,t)=>(e[t]=Or(s[t],i),e)),{})};n[u]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,value:s[l],withInputField:!1});var u}var gk=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));const hk=(0,c.createElement)(m.Icon,{icon:gk,size:24});function bk({label:e,onChange:t,sides:n,value:o}){if(!n||!n.length)return;const r=function(e){if(!e||!e.length)return{};const t={},n=Fr(e,"horizontal"),o=Fr(e,"vertical");n&&o?t.axial={label:Lr.axial,icon:Nr.axial}:n?t.axial={label:Lr.horizontal,icon:Nr.horizontal}:o&&(t.axial={label:Lr.vertical,icon:Nr.vertical});let r=0;return Mr.forEach((n=>{e.includes(n)&&(r+=1,t[n]={label:Lr[n],icon:Nr[n]})})),r>1&&(t.custom={label:Lr.custom,icon:Nr.custom}),t}(n),l=r[o].icon,{custom:i,...a}=r;return(0,c.createElement)(m.DropdownMenu,{icon:l,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{isSmall:!0}},(({onClose:e})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,Object.entries(a).map((([n,{label:r,icon:l}])=>{const i=o===n;return(0,c.createElement)(m.MenuItem,{key:n,icon:l,iconPosition:"left",isSelected:i,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:i?hk:void 0},r)}))),!!i&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{icon:i.icon,iconPosition:"left",isSelected:o===Rr.custom,role:"menuitemradio",onClick:()=>{t(Rr.custom),e()},suffix:o===Rr.custom?hk:void 0},i.label)))))}function vk({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,sides:a=Mr,useSelect:s,values:u}){const d=function(){const e=[{name:0,slug:"0",size:0},...bl("spacing.spacingSizes")||[]];return e.length>8&&e.unshift({name:(0,v.__)("Default"),slug:"default",size:void 0}),e}(),p=u||Pr,f=1===a?.length,g=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[h,b]=(0,c.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:l}=e,i=[n,o,r,l].filter(Boolean),a=!(n!==r||l!==o||!n&&!l),s=!i.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(Fr(t)&&(a||s))return Rr.axial;if(1===i.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||i.length?Rr.custom:t[0]}(p,a)),_={...e,minimumCustomValue:n,onChange:e=>{const t={...u,...e};o(t)},onMouseOut:r,onMouseOver:l,sides:a,spacingSizes:d,type:t,useSelect:s,values:p},k=Mr.includes(h)&&i?Lr[h]:"",y=(0,v.sprintf)((0,v.__)("%1$s %2$s"),t,k).trim(),E=(0,v.sprintf)((0,v._x)("%s options","Button label to reveal side configuration options"),t);return(0,c.createElement)("fieldset",{className:"spacing-sizes-control"},(0,c.createElement)(m.__experimentalHStack,{className:"spacing-sizes-control__header"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label"},y),!f&&!g&&(0,c.createElement)(bk,{label:E,onChange:b,sides:a,value:h})),h===Rr.axial?(0,c.createElement)(pk,{..._}):h===Rr.custom?(0,c.createElement)(mk,{..._}):(0,c.createElement)(fk,{side:h,..._,showSideInLabel:i}))}const _k={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function kk({label:e=(0,v.__)("Height"),onChange:t,value:n}){var o,r;const l=parseFloat(n),i=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["%","px","em","rem","vh","vw"]}),a=(0,c.useMemo)((()=>(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||i[0]?.value||"px";return(0,c.createElement)("fieldset",{className:"block-editor-height-control"},(0,c.createElement)(m.BaseControl.VisualLabel,{as:"legend"},e),(0,c.createElement)(m.Flex,null,(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalUnitControl,{value:n,units:i,onChange:t,onUnitChange:e=>{const[o,r]=(0,m.__experimentalParseQuantityAndUnitFromRawValue)(n);["em","rem"].includes(e)&&"px"===r?t((o/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*o)+e):["vh","vw","%"].includes(e)&&o>100&&t(100+e)},min:0,size:"__unstable-large"})),(0,c.createElement)(m.FlexItem,{isBlock:!0},(0,c.createElement)(m.__experimentalSpacer,{marginX:2,marginBottom:0},(0,c.createElement)(m.RangeControl,{value:l,min:0,max:null!==(o=_k[a]?.max)&&void 0!==o?o:100,step:null!==(r=_k[a]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,a].join(""))},__nextHasNoMarginBottom:!0})))))}function yk(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,v.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,v.__)("Specify a fixed width."):"fixed"===e?(0,v.__)("Specify a fixed height."):(0,v.__)("Fit contents.")}function Ek({value:e={},onChange:t,parentLayout:n}){const{selfStretch:o,flexSize:r}=e;return(0,c.useEffect)((()=>{"fixed"!==o||r||t({...e,selfStretch:"fit"})}),[]),(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:wk(n),value:o||"fit",help:yk(o,n),onChange:n=>{const o="fixed"!==n?null:r;t({...e,selfStretch:n,flexSize:o})},isBlock:!0},(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,v.__)("Fit")}),(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,v.__)("Fill")}),(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,v.__)("Fixed")})),"fixed"===o&&(0,c.createElement)(m.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,flexSize:n})},value:r}))}function wk(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,v.__)("Width"):(0,v.__)("Height")}const Sk=["horizontal","vertical"];function Ck(e){const t=xk(e),n=Bk(e),o=Ik(e),r=Tk(e),l=Mk(e),i=Pk(e),a=Nk(e);return"web"===c.Platform.OS&&(t||n||o||r||l||i||a)}function xk(e){return e?.layout?.contentSize}function Bk(e){return e?.layout?.wideSize}function Ik(e){return e?.spacing?.padding}function Tk(e){return e?.spacing?.margin}function Mk(e){return e?.spacing?.blockGap}function Pk(e){return e?.dimensions?.minHeight}function Nk(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},l=("flex"===o||"flex"===n)&&r;return!!e?.layout&&l}function Lk(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function Rk(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Ak({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const Dk={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!0};function Ok({as:e=Ak,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=Dk,onVisualize:a=(()=>{}),includeLayoutControls:s=!1}){var u,p,f,g,h,b,_,k;const{dimensions:y,spacing:E}=r,w=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Rl({settings:{dimensions:y,spacing:E}},"",e[n]),t)),{}):Rl({settings:{dimensions:y,spacing:E}},"",e),S=function(e){var t,n;const{custom:o,theme:r,default:l}=e?.spacing?.spacingSizes||{};return(null!==(t=null!==(n=null!=o?o:r)&&void 0!==n?n:l)&&void 0!==t?t:[]).length>0}(r),C=(0,m.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),x=xk(r)&&s,B=w(o?.layout?.contentSize),I=e=>{n(dl(t,["layout","contentSize"],e||void 0))},T=Bk(r)&&s,M=w(o?.layout?.wideSize),P=e=>{n(dl(t,["layout","wideSize"],e||void 0))},N=Ik(r),L=Rk(w(o?.spacing?.padding)),R=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,A=R&&R.some((e=>Sk.includes(e))),D=e=>{const o=Lk(e,R);n(dl(t,["spacing","padding"],o))},O=()=>a("padding"),z=Tk(r),V=Rk(w(o?.spacing?.margin)),F=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,H=F&&F.some((e=>Sk.includes(e))),G=e=>{const o=Lk(e,F);n(dl(t,["spacing","margin"],o))},U=()=>a("margin"),$=Mk(r),j=w(o?.spacing?.blockGap),W=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(j),K=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,q=K&&K.some((e=>Sk.includes(e))),Z=e=>{n(dl(t,["spacing","blockGap"],e))},Y=e=>{e||Z(null),!q&&e?.hasOwnProperty("top")?Z(e.top):Z({top:e?.top,left:e?.left})},X=Pk(r),Q=w(o?.dimensions?.minHeight),J=e=>{n(dl(t,["dimensions","minHeight"],e))},ee=Nk(r),te=o?.layout,{orientation:ne="horizontal"}=null!==(u=r?.parentLayout)&&void 0!==u?u:{},oe="horizontal"===ne?(0,v.__)("Width"):(0,v.__)("Height"),re=e=>{n({...t,layout:{...t?.layout,...e}})},le=(0,c.useCallback)((e=>({...e,layout:Wl({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0}})),[]),ie=()=>a(!1);return(0,c.createElement)(e,{resetAllFilter:le,value:t,onChange:n,panelId:l},(x||T)&&(0,c.createElement)("span",{className:"span-columns"},(0,v.__)("Set the width of the main content area.")),x&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>I(void 0),isShownByDefault:null!==(p=i.contentSize)&&void 0!==p?p:Dk.contentSize,panelId:l},(0,c.createElement)(m.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:B||"",onChange:e=>{I(e)},units:C}),(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(ai,{icon:si})))),T&&(0,c.createElement)(m.__experimentalToolsPanelItem,{className:"single-column",label:(0,v.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>P(void 0),isShownByDefault:null!==(f=i.wideSize)&&void 0!==f?f:Dk.wideSize,panelId:l},(0,c.createElement)(m.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:M||"",onChange:e=>{P(e)},units:C}),(0,c.createElement)(m.__experimentalView,null,(0,c.createElement)(ai,{icon:ci})))),N&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,v.__)("Padding"),onDeselect:()=>D(void 0),isShownByDefault:null!==(g=i.padding)&&void 0!==g?g:Dk.padding,className:d()({"tools-panel-item-spacing":S}),panelId:l},!S&&(0,c.createElement)(m.__experimentalBoxControl,{values:L,onChange:D,label:(0,v.__)("Padding"),sides:R,units:C,allowReset:!1,splitOnAxis:A,onMouseOver:O,onMouseOut:ie}),S&&(0,c.createElement)(vk,{values:L,onChange:D,label:(0,v.__)("Padding"),sides:R,units:C,allowReset:!1,onMouseOver:O,onMouseOut:ie})),z&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,v.__)("Margin"),onDeselect:()=>G(void 0),isShownByDefault:null!==(h=i.margin)&&void 0!==h?h:Dk.margin,className:d()({"tools-panel-item-spacing":S}),panelId:l},!S&&(0,c.createElement)(m.__experimentalBoxControl,{values:V,onChange:G,label:(0,v.__)("Margin"),sides:F,units:C,allowReset:!1,splitOnAxis:H,onMouseOver:U,onMouseOut:ie}),S&&(0,c.createElement)(vk,{values:V,onChange:G,label:(0,v.__)("Margin"),sides:F,units:C,allowReset:!1,onMouseOver:U,onMouseOut:ie})),$&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,v.__)("Block spacing"),onDeselect:()=>Z(void 0),isShownByDefault:null!==(b=i.blockGap)&&void 0!==b?b:Dk.blockGap,className:d()({"tools-panel-item-spacing":S}),panelId:l},!S&&(q?(0,c.createElement)(m.__experimentalBoxControl,{label:(0,v.__)("Block spacing"),min:0,onChange:Y,units:C,sides:K,values:W,allowReset:!1,splitOnAxis:q}):(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:Z,units:C,value:j})),S&&(0,c.createElement)(vk,{label:(0,v.__)("Block spacing"),min:0,onChange:Y,showSideInLabel:!1,sides:q?K:["top"],values:W,allowReset:!1})),X&&(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,v.__)("Min. height"),onDeselect:()=>{J(void 0)},isShownByDefault:null!==(_=i.minHeight)&&void 0!==_?_:Dk.minHeight,panelId:l},(0,c.createElement)(kk,{label:(0,v.__)("Min. height"),value:Q,onChange:J})),ee&&(0,c.createElement)(m.__experimentalVStack,{as:m.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!t?.layout,label:oe,onDeselect:()=>{re({selfStretch:void 0,flexSize:void 0})},isShownByDefault:null!==(k=i.childLayout)&&void 0!==k?k:Dk.childLayout,panelId:l},(0,c.createElement)(Ek,{value:te,onChange:re,parentLayout:r?.parentLayout})))}function zk(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Vk({clientId:e,attributes:t,forceShow:n}){const o=zd(e),[r,l]=(0,c.useState)(),i=t?.style?.spacing?.margin;(0,c.useEffect)((()=>{if(!o||null===o.ownerDocument.defaultView)return;const e=zk(o,"margin-top"),t=zk(o,"margin-right"),n=zk(o,"margin-bottom"),r=zk(o,"margin-left");l({borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:r,top:e?`-${e}`:0,right:t?`-${t}`:0,bottom:n?`-${n}`:0,left:r?`-${r}`:0})}),[o,i]);const[a,s]=(0,c.useState)(!1),u=(0,c.useRef)(i),d=(0,c.useRef)();return(0,c.useEffect)((()=>(Yg()(i,u.current)||n||(s(!0),u.current=i,d.current=setTimeout((()=>{s(!1)}),400)),()=>{s(!1),d.current&&window.clearTimeout(d.current)})),[i,n]),a||n?(0,c.createElement)(Vg,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,c.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}function Fk(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Hk({clientId:e,attributes:t,forceShow:n}){const o=zd(e),[r,l]=(0,c.useState)(),i=t?.style?.spacing?.padding;(0,c.useEffect)((()=>{o&&null!==o.ownerDocument.defaultView&&l({borderTopWidth:Fk(o,"padding-top"),borderRightWidth:Fk(o,"padding-right"),borderBottomWidth:Fk(o,"padding-bottom"),borderLeftWidth:Fk(o,"padding-left")})}),[o,i]);const[a,s]=(0,c.useState)(!1),u=(0,c.useRef)(i),d=(0,c.useRef)();return(0,c.useEffect)((()=>(Yg()(i,u.current)||n||(s(!0),u.current=i,d.current=setTimeout((()=>{s(!1)}),400)),()=>{s(!1),d.current&&window.clearTimeout(d.current)})),[i,n]),a||n?(0,c.createElement)(Vg,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,c.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}const Gk="dimensions",Uk="spacing";function $k({children:e,resetAllFilter:t}){const n=(0,c.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,c.createElement)(la,{group:"dimensions",resetAllFilter:n},e)}function jk(e){const{clientId:t,name:n,attributes:o,setAttributes:r,__unstableParentLayout:l}=e,i=Zl(n,l),s=Ck(i),u=o.style,[d,p]=function(){const[e,t]=(0,c.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=Xo((0,f.useDispatch)(Jo));return(0,c.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!s)return null;const m={...(0,a.getBlockSupport)(e.name,[Gk,"__experimentalDefaultControls"]),...(0,a.getBlockSupport)(e.name,[Uk,"__experimentalDefaultControls"])};return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Ok,{as:$k,panelId:t,settings:i,value:u,onChange:e=>{r({style:Wl(e)})},defaultControls:m,onVisualize:p}),!!i?.spacing?.padding&&(0,c.createElement)(Hk,{forceShow:"padding"===d,...e}),!!i?.spacing?.margin&&(0,c.createElement)(Vk,{forceShow:"margin"===d,...e}))}function Wk(){$()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const Kk=[...ok,iv,Kv,Gk,Ib,Uk],qk=e=>Kk.some((t=>(0,a.hasBlockSupport)(e,t)));function Zk(e={}){const t={};return(0,ui.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Yk={[`${iv}.__experimentalSkipSerialization`]:["border"],[`${Kv}.__experimentalSkipSerialization`]:[Kv],[`${nk}.__experimentalSkipSerialization`]:[nk],[`${Gk}.__experimentalSkipSerialization`]:[Gk],[`${Uk}.__experimentalSkipSerialization`]:[Uk]},Xk={...Yk,[`${Ib}`]:[Ib]},Qk={[`${Ib}`]:!0},Jk={gradients:"gradient"};function ey(e,t,n=!1){if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;ey(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function ty(e,t,n,o=Xk){if(!qk(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=Qk[e]||(0,a.getBlockSupport)(t,e);!0===o&&(r=ey(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=Jk[e]||e;r=ey(r,[[...n,t]])}))})),e.style={...Zk(r),...e.style},e}const ny=(0,p.createHigherOrderComponent)((e=>t=>{if(!qk(t.name))return(0,c.createElement)(e,{key:"edit",...t});const n=lr(),o=Ai();return(0,c.createElement)(c.Fragment,null,n&&"default"===o&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(o_,{...t}),(0,c.createElement)(Lb,{...t}),(0,c.createElement)(ak,{...t}),(0,c.createElement)(mv,{...t}),(0,c.createElement)(jk,{...t})),(0,c.createElement)(e,{key:"edit",...t}))}),"withToolbarControls"),oy=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],ry=(0,p.createHigherOrderComponent)((e=>t=>{const n=`wp-elements-${(0,p.useInstanceId)(e)}`,o=`.editor-styles-wrapper .${n}`,r=t.attributes.style?.elements,l=(0,c.useMemo)((()=>{if(!r)return;const e=[];return oy.forEach((({elementType:n,pseudo:l,elements:i})=>{if(ql(t.name,Kv,n))return;const s=r?.[n];if(s){const t=Al(o,a.__EXPERIMENTAL_ELEMENTS[n]);e.push((0,ui.compileCSS)(s,{selector:t})),l&&l.forEach((t=>{s[t]&&e.push((0,ui.compileCSS)(s[t],{selector:Al(o,`${a.__EXPERIMENTAL_ELEMENTS[n]}${t}`)}))}))}i&&i.forEach((t=>{r[t]&&e.push((0,ui.compileCSS)(r[t],{selector:Al(o,a.__EXPERIMENTAL_ELEMENTS[t])}))}))})),e.length>0?e.join(""):void 0}),[o,r,t.name]),i=(0,c.useContext)(vh.__unstableElementContext);return(0,c.createElement)(c.Fragment,null,l&&i&&(0,c.createPortal)((0,c.createElement)("style",{dangerouslySetInnerHTML:{__html:l}}),i),(0,c.createElement)(e,{...t,className:t.attributes.style?.elements?d()(t.className,n):t.className}))}),"withElementsStyles");(0,s.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return qk(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",ty),(0,s.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!qk(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ty(o,e,n,Yk)},e})),(0,s.addFilter)("editor.BlockEdit","core/style/with-block-controls",ny),(0,s.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",ry);(0,s.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return t=e,(0,a.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t}));var ly=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));var iy=function({colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}){let i;return i="unset"===r?(0,c.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):r?(0,c.createElement)(m.DuotoneSwatch,{values:r}):(0,c.createElement)(ai,{icon:ly}),(0,c.createElement)(m.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,v.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,c.createElement)(m.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Pd.DOWN||(n.preventDefault(),t())},label:(0,v.__)("Apply duotone filter"),icon:i}),renderContent:()=>(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Duotone")},(0,c.createElement)("div",{className:"block-editor-duotone-control__description"},(0,v.__)("Create a two-tone color effect without losing your original image.")),(0,c.createElement)(m.DuotonePicker,{colorPalette:e,duotonePalette:t,disableCustomColors:n,disableCustomDuotone:o,value:r,onChange:l}))})};function ay(e){return`${e}{filter:none}`}function sy(e,t){return`${e}{filter:url(#${t})}`}function cy(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=tm(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}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}function uy(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:l,supports:i}=e,a=l&&Object.keys(l).length>0,s=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&l.root?l?.root:i?.__experimentalSelector?i.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===s)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=o?c:null;if(a){return pl(l,`${s}.root`,null)||pl(l,s,null)||e}const t=pl(i,`${s}.__experimentalSelector`,null);return t?Al(c,t):e}let d;return a&&(d=pl(l,s,null)),d||(o?uy(e,u[0],n):null)}const dy=[];function py(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||dy,l=e?.color?.[t]?.theme||dy,i=e?.color?.[t]?.default||dy;return(0,c.useMemo)((()=>[...r,...l,...o?dy:i]),[o,r,l,i])}function my(e){return fy(e)}function fy(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function gy({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const hy={duotone:!0},by={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,v.__)("Duotone")},vy=({indicator:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.__experimentalZStack,{isLayered:!1,offset:-8},(0,c.createElement)(m.Flex,{expanded:!1},"unset"!==e&&e?(0,c.createElement)(m.DuotoneSwatch,{values:e}):(0,c.createElement)(m.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}))),(0,c.createElement)(m.FlexItem,{title:t},t));function _y({as:e=gy,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=hy}){const a=fy(r),s=py(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),u=py(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=(f=o?.filter?.duotone,Rl({settings:r},"",f));var f;const g=e=>{const o=s.find((({colors:t})=>t===e)),r=o?`var:preset|duotone|${o.slug}`:e;n(dl(t,["filter","duotone"],r))},h=(0,c.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,c.createElement)(e,{resetAllFilter:h,value:t,onChange:n,panelId:l},a&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>g(void 0),isShownByDefault:i.duotone,panelId:l},(0,c.createElement)(m.Dropdown,{popoverProps:by,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:d()({"is-open":t}),"aria-expanded":t};return(0,c.createElement)(m.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,c.createElement)(m.Button,{...n},(0,c.createElement)(vy,{indicator:p,label:(0,v.__)("Duotone")})))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,c.createElement)(m.__experimentalVStack,null,(0,c.createElement)("p",null,(0,v.__)("Create a two-tone color effect without losing your original image.")),(0,c.createElement)(m.DuotonePicker,{colorPalette:u,duotonePalette:s,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:g})))})))}const ky=[],yy=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function Ey({presetSetting:e,defaultSetting:t}){const n=!bl(t),o=bl(`${e}.custom`)||ky,r=bl(`${e}.theme`)||ky,l=bl(`${e}.default`)||ky;return(0,c.useMemo)((()=>[...o,...r,...n?ky:l]),[n,o,r,l])}function wy(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}function Sy({attributes:e,setAttributes:t,name:n}){const o=e?.style,r=o?.color?.duotone,l=Zl(n),i=Ey({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Ey({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!bl("color.custom"),u=!bl("color.customDuotone")||0===a?.length&&s;if(0===i?.length&&u)return null;const d=Array.isArray(r)?r:wy(r,i);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(la,{group:"filter"},(0,c.createElement)(_y,{value:{filter:{duotone:d}},onChange:e=>{const n={...o,color:{...e?.filter}};t({style:n})},settings:l})),(0,c.createElement)(dr,{group:"block",__experimentalShareWithChildBlocks:!0},(0,c.createElement)(iy,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:s,value:d,onChange:e=>{const n=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(e,i),r={...o,color:{...o?.color,duotone:null!=n?n:e}};t({style:r})},settings:l})))}om([rm]);const Cy=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,a.hasBlockSupport)(t.name,"filter.duotone"),o=Ai();return(0,c.createElement)(c.Fragment,null,n&&"default"===o&&(0,c.createElement)(Sy,{...t}),(0,c.createElement)(e,{...t}))}),"withDuotoneControls");function xy({clientId:e,id:t,selector:n,attribute:o}){const r=Ey({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Array.isArray(o),i=l?void 0:wy(o,r),a="string"==typeof o&&i;let s=null;a?s=i:("string"==typeof o&&!a||l)&&(s=o);const u=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(s)||"unset"===s,{setStyleOverride:p,deleteStyleOverride:m}=Xo((0,f.useDispatch)(Jo)),g=zd(e);return(0,c.useEffect)((()=>{if(d){if(p(t,{css:"unset"!==s?sy(u,t):ay(u),__unstableType:"presets"}),p(`duotone-${t}`,{assets:"unset"!==s?cy(t,s):"",__unstableType:"svgs"}),g&&yy){const e=g.style.display;g.style.display="inline-block",g.offsetHeight,g.style.display=e}return()=>{m(t),m(`duotone-${t}`)}}}),[d,g,s,u,t,p,m]),null}const By=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,p.useInstanceId)(e),o=(0,c.useMemo)((()=>{const e=(0,a.getBlockType)(t.name);if(e){if(!(0,a.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,a.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=uy(e);return"string"==typeof t?Al(n,t):n}return uy(e,"filter.duotone",{fallback:!0})}}),[t.name]),r=t?.attributes?.style?.color?.duotone,l=`wp-duotone-${n}`,i=o&&r,s=i?d()(t?.className,l):t?.className;return(0,c.createElement)(c.Fragment,null,i&&(0,c.createElement)(xy,{clientId:t.clientId,id:l,selector:o,attribute:r}),(0,c.createElement)(e,{...t,className:s}))}),"withDuotoneStyles");function Iy(e){return(0,f.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t(Jo),{getBlockType:l,getActiveBlockVariation:i}=t(a.store),s=n(e),c=l(s);if(!c)return null;const u=o(e),d=i(s,u),p=(0,a.isReusableBlock)(c),m=(p?r(u.ref):void 0)||c.title,f=p||(0,a.isTemplatePart)(c),g=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,v.__)("Sticky"):"fixed"===t?(0,v.__)("Fixed"):null}(u),h={isSynced:f,title:m,icon:c.icon,description:c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name};return d?{isSynced:f,title:d.title||c.title,icon:d.icon||c.icon,description:d.description||c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name}:h}),[e])}(0,s.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,a.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,s.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Cy),(0,s.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",By);const{CustomSelectControl:Ty}=Xo(m.privateApis),My="position",Py="block-editor-hooks__position-selection__select-control__option",Ny={key:"default",value:"",name:(0,v.__)("Default"),className:Py},Ly={key:"sticky",value:"sticky",name:(0,v._x)("Sticky","Name for the value of the CSS position property"),className:Py,__experimentalHint:(0,v.__)("The block will stick to the top of the window instead of scrolling.")},Ry={key:"fixed",value:"fixed",name:(0,v._x)("Fixed","Name for the value of the CSS position property"),className:Py,__experimentalHint:(0,v.__)("The block will not move when the page is scrolled.")},Ay=["top","right","bottom","left"],Dy=["sticky","fixed"];function Oy(e){const t=e.style?.position?.type;return"sticky"===t||"fixed"===t}function zy({name:e}={}){const t=bl("position.fixed"),n=bl("position.sticky"),o=!t&&!n;return r=e,!(0,a.getBlockSupport)(r,My)||o;var r}function Vy(e){const{attributes:{style:t={}},clientId:n,name:o,setAttributes:r}=e,l=function(e){const t=(0,a.getBlockSupport)(e,My);return!(!0!==t&&!t?.fixed)}(o),i=function(e){const t=(0,a.getBlockSupport)(e,My);return!(!0!==t&&!t?.sticky)}(o),s=t?.position?.type,{firstParentClientId:u}=(0,f.useSelect)((e=>{const{getBlockParents:t}=e(Jo),o=t(n);return{firstParentClientId:o[o.length-1]}}),[n]),d=Iy(u),p=i&&s===Ly.value&&d?(0,v.sprintf)((0,v.__)("The block will stick to the scrollable area of the parent %s block."),d.title):null,g=(0,c.useMemo)((()=>{const e=[Ny];return(i||s===Ly.value)&&e.push(Ly),(l||s===Ry.value)&&e.push(Ry),e}),[l,i,s]),h=s&&g.find((e=>e.value===s))||Ny;return c.Platform.select({web:g.length>1?(0,c.createElement)(la,{group:"position"},(0,c.createElement)(m.BaseControl,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:p},(0,c.createElement)(Ty,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,v.__)("Position"),hideLabelFromVision:!0,describedBy:(0,v.sprintf)((0,v.__)("Currently selected position: %s"),h.name),options:g,value:h,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{(e=>{const n={...t,position:{...t?.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};r({style:Wl(n)})})(e.value)},size:"__unstable-large"}))):null,native:null})}const Fy=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=(0,a.hasBlockSupport)(n,My),r=zy(t);return[o&&!r&&(0,c.createElement)(Vy,{key:"position",...t}),(0,c.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),Hy=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=(0,a.hasBlockSupport)(n,My),l=zy(t),i=r&&!l,s=(0,p.useInstanceId)(e),u=(0,c.useContext)(vh.__unstableElementContext);let m;i&&(m=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return Dy.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,Ay.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:o?.style})||"");const f=d()(t?.className,{[`wp-container-${s}`]:i&&!!m,[`is-position-${o?.style?.position?.type}`]:i&&!!m&&!!o?.style?.position?.type});return(0,c.createElement)(c.Fragment,null,i&&u&&!!m&&(0,c.createPortal)((0,c.createElement)("style",null,m),u),(0,c.createElement)(e,{...t,className:f}))}),"withPositionStyles");(0,s.addFilter)("editor.BlockListBlock","core/editor/position/with-position-styles",Hy),(0,s.addFilter)("editor.BlockEdit","core/editor/position/with-inspector-controls",Fy);const Gy="layout";function Uy(e){return(0,a.hasBlockSupport)(e,"layout")||(0,a.hasBlockSupport)(e,"__experimentalLayout")}function $y(e={},t=""){const n=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return t().__experimentalFeatures?.useRootPaddingAwareAlignments}),[]),{layout:o}=e,{default:r}=(0,a.getBlockSupport)(t,Gy)||{},l=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(_r[l?.type||"default"]?.className){const e=_r[l?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,o)}return(l?.inherit||l?.contentSize||"constrained"===l?.type)&&n&&i.push("has-global-padding"),l?.orientation&&i.push(`is-${cl(l.orientation)}`),l?.justifyContent&&i.push(`is-content-justification-${cl(l.justifyContent)}`),l?.flexWrap&&"nowrap"===l.flexWrap&&i.push("is-nowrap"),i}function jy({setAttributes:e,attributes:t,name:n}){const o=Zl(n),{layout:{allowEditing:r}}=o,{layout:l}=t,i=bl("layout"),{themeSupportsLayout:s}=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return{themeSupportsLayout:t().supportsLayout}}),[]),u=Ai(),d=(0,a.getBlockSupport)(n,Gy,{}),{allowSwitching:p,allowEditing:g=null==r||r,allowInheriting:h=!0,default:b}=d;if(!g)return null;const _=!(!h||!i||l?.type&&"default"!==l?.type&&"constrained"!==l?.type&&!l?.inherit),k=l||b||{},{inherit:y=!1,type:E="default",contentSize:w=null}=k;if(("default"===E||"constrained"===E)&&!s)return null;const S=bi(E),C=bi("constrained"),x=!k.type&&(w||y),B=!!y||!!w,I=t=>e({layout:t});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(la,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Layout")},_&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,v.__)("Inner blocks use content width"),checked:"constrained"===S?.name||B,onChange:()=>e({layout:{type:"constrained"===S?.name||B?"default":"constrained"}}),help:"constrained"===S?.name||B?(0,v.__)("Nested blocks use content width with options for full and wide widths."):(0,v.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!y&&p&&(0,c.createElement)(Wy,{type:E,onChange:t=>e({layout:{type:t}})}),S&&"default"!==S.name&&(0,c.createElement)(S.inspectorControls,{layout:k,onChange:I,layoutBlockSupport:d}),C&&x&&(0,c.createElement)(C.inspectorControls,{layout:k,onChange:I,layoutBlockSupport:d}))),!y&&"default"===u&&S&&(0,c.createElement)(S.toolBarControls,{layout:k,onChange:I,layoutBlockSupport:d}))}function Wy({type:e,onChange:t}){return(0,c.createElement)(m.ButtonGroup,null,hi.map((({name:n,label:o})=>(0,c.createElement)(m.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}const Ky=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Uy(n),r=Ai();return[o&&"default"===r&&(0,c.createElement)(jy,{key:"layout",...t}),(0,c.createElement)(e,{key:"edit",...t})]}),"withInspectorControls"),qy=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,r=Uy(n),l=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return!!t().disableLayoutStyles})),i=r&&!l,s=(0,p.useInstanceId)(e),{layout:u}=o,{default:m}=(0,a.getBlockSupport)(n,Gy)||{},g=u?.inherit||u?.contentSize||u?.wideSize?{...u,type:"constrained"}:u||m||{},h=r?$y(o,n):null,b=`.wp-container-${s}.wp-container-${s}`,v=null!==bl("spacing.blockGap");let _;if(i){const e=bi(g?.type||"default");_=e?.getLayoutStyle?.({blockName:n,selector:b,layout:g,style:o?.style,hasBlockGapSupport:v})}const k=d()({[`wp-container-${s}`]:i&&!!_},h),{setStyleOverride:y,deleteStyleOverride:E}=Xo((0,f.useDispatch)(Jo));return(0,c.useEffect)((()=>{if(_)return y(b,{css:_}),()=>{E(b)}}),[b,_,y,E]),(0,c.createElement)(e,{...t,__unstableLayoutClassNames:k})}),"withLayoutStyles"),Zy=(0,p.createHigherOrderComponent)((e=>t=>{const{attributes:n}=t,{style:{layout:o={}}={}}=n,{selfStretch:r,flexSize:l}=o,i=r||l,a=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return!!t().disableLayoutStyles})),s=i&&!a,u=(0,p.useInstanceId)(e),m=`.wp-container-content-${u}`;let g="";"fixed"===r&&l?g+=`${m} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===r&&(g+=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const h=d()(t?.className,{[`wp-container-content-${u}`]:s&&!!g}),{setStyleOverride:b,deleteStyleOverride:v}=Xo((0,f.useDispatch)(Jo));return(0,c.useEffect)((()=>{if(g)return b(m,{css:g}),()=>{v(m)}}),[m,g,b,v]),(0,c.createElement)(e,{...t,className:h})}),"withChildLayoutStyles");function Yy(e){return(0,f.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:l}=t(Jo),{getGroupingBlockName:i,getBlockType:s}=t(a.store),c=e?.length?e:o(),u=n(c),[d]=u,p=1===c.length&&r(c[0]);return{clientIds:c,isGroupable:l(c),isUngroupable:p,blocksSelection:u,groupingBlockName:i(),onUngroup:p&&s(d.name)?.transforms?.ungroup}}),[e])}function Xy({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}){const{replaceBlocks:s}=(0,f.useDispatch)(Jo);return t||n?(0,c.createElement)(c.Fragment,null,t&&(0,c.createElement)(m.MenuItem,{onClick:()=>{(()=>{const t=(0,a.switchToBlockType)(r,l);t&&s(e,t)})(),i()}},(0,v._x)("Group","verb")),n&&(0,c.createElement)(m.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),s(e,t))})(),i()}},(0,v._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor "))):null}function Qy(e){return(0,f.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:a,getTemplateLock:s}=t(Jo),c=a(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}(0,s.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||Uy(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",qy),(0,s.addFilter)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",Zy),(0,s.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",Ky);var Jy=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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 eE=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"}));var tE=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));const nE=["core/block","core/navigation"];function oE(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function rE({clientId:e,onClose:t}){const[n,o]=(0,c.useState)({move:!1,remove:!1}),{canEdit:r,canMove:l,canRemove:i}=Qy(e),{allowsEditLocking:s,templateLock:u,hasTemplateLock:d}=(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Jo),r=n(e),l=(0,a.getBlockType)(r);return{allowsEditLocking:nE.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!l?.attributes?.templateLock}}),[e]),[g,h]=(0,c.useState)(!!u),{updateBlockAttributes:b}=(0,f.useDispatch)(Jo),_=Iy(e),k=(0,p.useInstanceId)(rE,"block-editor-block-lock-modal__options-title");(0,c.useEffect)((()=>{o({move:!l,remove:!i,...s?{edit:!r}:{}})}),[r,l,i,s]);const y=Object.values(n).every(Boolean),E=Object.values(n).some(Boolean)&&!y;return(0,c.createElement)(m.Modal,{title:(0,v.sprintf)((0,v.__)("Lock %s"),_.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t},(0,c.createElement)("p",null,(0,v.__)("Choose specific attributes to restrict or lock all available options.")),(0,c.createElement)("form",{onSubmit:o=>{o.preventDefault(),b([e],{lock:n,templateLock:g?oE(n):void 0}),t()}},(0,c.createElement)("div",{role:"group","aria-labelledby":k,className:"block-editor-block-lock-modal__options"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,c.createElement)("span",{id:k},(0,v.__)("Lock all")),checked:y,indeterminate:E,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,c.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?tE:Jy})),(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?tE:Jy})),(0,c.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,c.createElement)(m.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,c.createElement)(m.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?tE:Jy}))),d&&(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,v.__)("Apply to all blocks inside"),checked:g,disabled:n.move&&!n.remove,onChange:()=>h(!g)})),(0,c.createElement)(m.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"tertiary",onClick:t},(0,v.__)("Cancel"))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{variant:"primary",type:"submit"},(0,v.__)("Apply"))))))}function lE({clientId:e}){const{canLock:t,isLocked:n}=Qy(e),[o,r]=(0,c.useReducer)((e=>!e),!1);if(!t)return null;const l=n?(0,v.__)("Unlock"):(0,v.__)("Lock");return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuItem,{icon:n?Jy:eE,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"},l),o&&(0,c.createElement)(rE,{clientId:e,onClose:r}))}const iE=()=>{};var aE=(0,p.compose)([(0,f.withSelect)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:o,getSettings:r}=e(Jo),l=n(t),i=r().codeEditingEnabled;return{mode:o(t),blockType:l?(0,a.getBlockType)(l.name):null,isCodeEditingEnabled:i}})),(0,f.withDispatch)(((e,{onToggle:t=iE,clientId:n})=>({onToggleMode(){e(Jo).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:o=!1,isCodeEditingEnabled:r=!0}){if(!e||!(0,a.hasBlockSupport)(e,"html",!0)||!r)return null;const l="visual"===t?(0,v.__)("Edit as HTML"):(0,v.__)("Edit visually");return(0,c.createElement)(m.MenuItem,{onClick:n},!o&&l)}));function sE(e){return 0===e?.trim()?.length}function cE({blockName:e,originalBlockName:t,onClose:n,onSave:o}){const[r,l]=(0,c.useState)(e),i=r!==e,a=r===t,s=sE(r),u=i||a,d=(0,p.useInstanceId)(cE,"block-editor-rename-modal__description");return(0,c.createElement)(m.Modal,{title:(0,v.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",aria:{describedby:d},focusOnMount:"firstContentElement"},(0,c.createElement)("p",{id:d},(0,v.__)("Enter a custom name for this block.")),(0,c.createElement)("form",{onSubmit:e=>{e.preventDefault(),u&&(()=>{const e=a||s?(0,v.sprintf)((0,v.__)('Block name reset to: "%s".'),r):(0,v.sprintf)((0,v.__)('Block name changed to: "%s".'),r);(0,Ln.speak)(e,"assertive"),o(r),n()})()}},(0,c.createElement)(m.__experimentalVStack,{spacing:"3"},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,value:r,label:(0,v.__)("Block name"),hideLabelFromVision:!0,placeholder:t,onChange:l,onFocus:e=>e.target.select()}),(0,c.createElement)(m.__experimentalHStack,{justify:"right"},(0,c.createElement)(m.Button,{variant:"tertiary",onClick:n},(0,v.__)("Cancel")),(0,c.createElement)(m.Button,{"aria-disabled":!u,variant:"primary",type:"submit"},(0,v.__)("Save"))))))}function uE({clientId:e}){const[t,n]=(0,c.useState)(!1),{metadata:o}=(0,f.useSelect)((t=>{const{getBlockAttributes:n}=t(Jo),o=n(e)?.metadata;return{metadata:o}}),[e]),{updateBlockAttributes:r}=(0,f.useDispatch)(Jo),l=o?.name;const i=Iy(e);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog"},(0,v.__)("Rename")),t&&(0,c.createElement)(cE,{blockName:l||"",originalBlockName:i?.title,onClose:()=>n(!1),onSave:t=>{(t===i?.title||sE(t))&&(t=void 0),function(t){r([e],{metadata:{...o&&o,name:t}})}(t)}}))}const{Fill:dE,Slot:pE}=(0,m.createSlotFill)("BlockSettingsMenuControls");function mE({...e}){return(0,c.createElement)(m.__experimentalStyleProvider,{document:document},(0,c.createElement)(dE,{...e}))}mE.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:o,selectedClientIds:r}=(0,f.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o}=e(Jo),r=null!==t?t:o();return{selectedBlocks:n(r),selectedClientIds:r}}),[t]),{canLock:l}=Qy(r[0]),{canRename:i}=function(e){const t=(0,a.getBlockSupport)(e,"__experimentalMetadata",!1);return{canRename:!(!0!==t&&!t?.name)}}(o[0]),s=1===r.length&&l,u=1===r.length&&i,d=Yy(r),{isGroupable:g,isUngroupable:h}=d,b=g||h;return(0,c.createElement)(pE,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:o,selectedClientIds:r}},(t=>!t?.length>0&&!b&&!s?null:(0,c.createElement)(m.MenuGroup,null,b&&(0,c.createElement)(Xy,{...d,onClose:e?.onClose}),s&&(0,c.createElement)(lE,{clientId:r[0]}),u&&(0,c.createElement)(uE,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(e?.onClose,e?.onMoveTo)},(0,v.__)("Move to")),1===e?.count&&(0,c.createElement)(aE,{clientId:e?.firstBlockClientId,onToggle:e?.onClose}))))};var fE=mE;function gE({clientId:e,stopEditingAsBlock:t}){const n=(0,f.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(Jo);return n(e)||o(e,!0)}),[e]);return(0,c.useEffect)((()=>{n||t()}),[n,t]),null}const hE=(0,p.createHigherOrderComponent)((e=>t=>{const{getBlockListSettings:n,getSettings:o}=(0,f.useSelect)(Jo),r=(0,c.useRef)(),{templateLock:l,isLockedByParent:i,isEditingAsBlocks:a}=(0,f.useSelect)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=e(Jo);return{templateLock:o(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:r()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:u,__unstableSetTemporarilyEditingAsBlocks:d}=(0,f.useDispatch)(Jo),p=!i&&"contentOnly"===l,{__unstableMarkNextChangeAsNotPersistent:g,updateBlockAttributes:h}=(0,f.useDispatch)(Jo),b=(0,c.useCallback)((()=>{g(),h(t.clientId,{templateLock:"contentOnly"}),u(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:r.current}),d()}),[t.clientId,s,u,n,g,h,d]);if(!p&&!a)return(0,c.createElement)(e,{key:"edit",...t});const _=a&&!p,k=!a&&p&&t.isSelected;return(0,c.createElement)(c.Fragment,null,_&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(gE,{clientId:t.clientId,stopEditingAsBlock:b}),(0,c.createElement)(dr,{group:"other"},(0,c.createElement)(m.ToolbarButton,{onClick:()=>{b()}},(0,v.__)("Done")))),k&&(0,c.createElement)(fE,null,(({onClose:e})=>(0,c.createElement)(m.MenuItem,{onClick:()=>{g(),h(t.clientId,{templateLock:void 0}),u(t.clientId,{...n(t.clientId),templateLock:!1}),r.current=o().focusMode,s({focusMode:!0}),d(t.clientId),e()}},(0,v.__)("Modify")))),(0,c.createElement)(e,{key:"edit",...t}))}),"withToolbarControls");(0,s.addFilter)("editor.BlockEdit","core/content-lock-ui/with-block-controls",hE);const bE="metadata";function vE(e,t=""){if(!e.name.startsWith("core/"))return!1;const n=(0,a.getBlockSupport)(e,"__experimentalMetadata");return!(!0!==n&&!n?.[t])}(0,s.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[bE]?.type||vE(e,"name")&&(e.attributes={...e.attributes,[bE]:{type:"object"}}),e})),(0,s.addFilter)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return vE(t)&&(e[bE]=n[bE]),e})),(0,s.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||vE(e,"name")&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const _E=(0,p.createHigherOrderComponent)((e=>t=>{const n=Ai(),o=(0,a.hasBlockSupport)(t.name,"__experimentalConnections",!1);if(!["core/paragraph","core/image"].includes(t.name))return(0,c.createElement)(e,{...t});let r;return"core/paragraph"===t.name&&(r="content"),"core/image"===t.name&&(r="url"),o&&t.isSelected?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(e,{...t}),"default"===n&&(0,c.createElement)(la,null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Connections"),initialOpen:!0},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,v.__)("Custom field meta_key"),value:t.attributes?.connections?.attributes?.[r]?.value||"",onChange:e=>{""===e?t.setAttributes({connections:void 0,[r]:void 0,placeholder:void 0}):t.setAttributes({connections:{attributes:{[r]:{source:"meta_fields",value:e}}},[r]:void 0,placeholder:(0,v.sprintf)('This content will be replaced on the frontend by the value of "%s" custom field.',e)})}})))):(0,c.createElement)(e,{...t})}),"withInspectorControl");window.__experimentalConnections&&((0,s.addFilter)("blocks.registerBlockType","core/connections/attribute",(function(e){return(0,a.hasBlockSupport)(e,"__experimentalConnections",!0)&&(e.attributes={...e.attributes,connections:{type:"object"}}),e})),(0,s.addFilter)("editor.BlockEdit","core/connections/with-inspector-control",_E));const kE={};function yE(e){const t=(0,f.useSelect)((e=>e(a.store).getBlockTypes()),[]),n=(0,c.useMemo)((()=>t?.filter((({blockHooks:t})=>t&&e.blockName in t))),[t,e.blockName]),{blockIndex:o,rootClientId:r,innerBlocksLength:l}=(0,f.useSelect)((t=>{const{getBlock:n,getBlockIndex:o,getBlockRootClientId:r}=t(Jo);return{blockIndex:o(e.clientId),innerBlocksLength:n(e.clientId)?.innerBlocks?.length,rootClientId:r(e.clientId)}}),[e.clientId]),i=(0,f.useSelect)((t=>{const{getBlock:o,getGlobalBlockCount:l}=t(Jo),i=n.reduce(((t,n)=>{if(0===l(n.name))return t;const i=n?.blockHooks?.[e.blockName];let a;switch(i){case"before":case"after":a=o(r)?.innerBlocks;break;case"first_child":case"last_child":a=o(e.clientId).innerBlocks}const s=a?.find((({name:e})=>e===n.name));return s?{...t,[n.name]:s.clientId}:{...t,[n.name]:!1}}),{});return Object.values(i).length>0?i:kE}),[n,e.blockName,e.clientId,r]),{insertBlock:s,removeBlock:u}=(0,f.useDispatch)(Jo),d=n?.filter((e=>!1!==i?.[e.name]));if(!d.length)return null;const p=n.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,c.createElement)(la,null,(0,c.createElement)(m.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,v.__)("Plugins"),initialOpen:!0},Object.keys(p).map((t=>(0,c.createElement)(c.Fragment,{key:t},(0,c.createElement)("h3",null,t),p[t].map((t=>{const n=t.name in i;return(0,c.createElement)(m.ToggleControl,{checked:n,key:t.title,label:(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(ep,{icon:t.icon}),(0,c.createElement)("span",null,t.title)),onChange:()=>{if(!n){const n=t.blockHooks[e.blockName];return void((t,n)=>{switch(n){case"before":case"after":s(t,"after"===n?o+1:o,r,!1);break;case"first_child":case"last_child":s(t,"first_child"===n?0:l,e.clientId,!1)}})((0,a.createBlock)(t.name),n)}const c=i[t.name];u(c,!1)}})})))))))}const EE=(0,p.createHigherOrderComponent)((e=>t=>{const n=(0,c.createElement)(e,{key:"edit",...t});return(0,c.createElement)(c.Fragment,null,n,(0,c.createElement)(yE,{blockName:t.name,clientId:t.clientId}))}),"withBlockHooks");(0,s.addFilter)("editor.BlockEdit","core/block-hooks/with-inspector-control",EE);const wE=(0,p.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o,setAttributes:r,isSelected:l}=t,i=(0,a.hasBlockSupport)(n,"__experimentalMetadata",!1);return(0,c.createElement)(c.Fragment,null,l&&i&&(0,c.createElement)(la,{group:"advanced"},(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Block name"),value:o?.metadata?.name||"",onChange:e=>{r({metadata:{...o?.metadata,name:e}})}})),(0,c.createElement)(e,{key:"edit",...t}))}),"withToolbarControls");function SE(e){const t=e.style?.border||{};return{className:hv(e)||void 0,style:Zk({border:t})}}function CE(e){const{colors:t}=Ob(),n=SE(e),{borderColor:o}=e;if(o){const e=sv({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function xE(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,l=Db("background-color",t),i=Db("color",n),a=vv(o),s=a||r?.color?.gradient;return{className:d()(i,a,{[l]:!s&&!!l,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color})||void 0,style:Zk({color:r?.color||{}})}}(0,s.addFilter)("editor.BlockEdit","core/block-rename-ui/with-block-rename-control",wE);const BE={};function IE(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=bl("color.palette.custom"),l=bl("color.palette.theme"),i=bl("color.palette.default"),a=bl("color.gradients")||BE,s=(0,c.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,c.useMemo)((()=>[...a?.custom||[],...a?.theme||[],...a?.default||[]]),[a]),d=xE(e);if(t){const e=Rb(s,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=_v(u,o)),n){const e=Rb(s,n);d.style.color=e.color}return d}function TE(e){const{style:t}=e;return{style:Zk({spacing:t?.spacing||{}})}}function ME(e,t){let n=e?.style?.typography||{};const o=Tl(t);n={...n,fontSize:Bl({size:e?.style?.typography?.fontSize},o)};const r=Zk({typography:n}),l=e?.fontFamily?`has-${cl(e.fontFamily)}-font-family`:"";return{className:d()(l,Y_(e?.fontSize)),style:r}}function PE(e){const[t,n]=(0,c.useState)(e);return(0,c.useEffect)((()=>{e&&n(e)}),[e]),t}const NE=([e,...t])=>e.toUpperCase()+t.join(""),LE=e=>(0,p.createHigherOrderComponent)((t=>n=>(0,c.createElement)(t,{...n,colors:e})),"withCustomColorPalette"),RE=()=>(0,p.createHigherOrderComponent)((e=>t=>{const n=bl("color.palette.custom"),o=bl("color.palette.theme"),r=bl("color.palette.default"),l=(0,c.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,c.createElement)(e,{...t,colors:l})}),"withEditorColorPalette");function AE(e,t){const n=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:cl(t)}:t})),{});return(0,p.compose)([t,e=>class extends c.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=tm(t),o=({color:e})=>n.contrast(e),r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(n).reduce(((e,t)=>{const n=NE(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Ab(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},o){return Object.entries(n).reduce(((n,[r,l])=>{const i=Rb(t,e[r],e[`custom${NE(r)}`]),a=o[r],s=a?.color;return s===i.color&&a?n[r]=a:n[r]={...i,class:Db(l,i.slug)},n}),{})}render(){return(0,c.createElement)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function DE(e){return(...t)=>{const n=LE(e);return(0,p.createHigherOrderComponent)(AE(t,n),"withCustomColors")}}function OE(...e){const t=RE();return(0,p.createHigherOrderComponent)(AE(e,t),"withColors")}var zE=function(e){const t=bl("typography.fontSizes"),n=!bl("typography.customFontSize");return(0,c.createElement)(m.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:n})};const VE=[],FE=([e,...t])=>e.toUpperCase()+t.join("");var HE=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${FE(t)}`,e)),{});return(0,p.createHigherOrderComponent)((0,p.compose)([(0,p.createHigherOrderComponent)((e=>t=>{const n=bl("typography.fontSizes")||VE;return(0,c.createElement)(e,{...t,fontSizes:n})}),"withFontSizes"),e=>class extends c.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${FE(t)}`]=this.createSetFontSize(t,n),e)),{})}createSetFontSize(e,t){return n=>{const o=this.props.fontSizes?.find((({size:e})=>e===Number(n)));this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!Object.values(t).some(r))return null;const l=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const l=e[o],i=q_(n,l,e[r]);return t[o]={...i,class:Y_(l)},t}),{});return{...o,...l}}render(){return(0,c.createElement)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")};var GE=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"}));var UE=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"}));var $E=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"}));const jE=[{icon:GE,title:(0,v.__)("Align text left"),align:"left"},{icon:UE,title:(0,v.__)("Align text center"),align:"center"},{icon:$E,title:(0,v.__)("Align text right"),align:"right"}],WE={placement:"bottom-start"};var KE=function({value:e,onChange:t,alignmentControls:n=jE,label:o=(0,v.__)("Align text"),describedBy:r=(0,v.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:i}){function a(n){return()=>t(e===n?void 0:n)}const s=n.find((t=>t.align===e)),u=i?m.ToolbarGroup:m.ToolbarDropdownMenu,d=i?{isCollapsed:l}:{toggleProps:{describedBy:r},popoverProps:WE};return(0,c.createElement)(u,{icon:s?s.icon:(0,v.isRTL)()?$E:GE,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:a(n)}})),...d})};const qE=e=>(0,c.createElement)(KE,{...e,isToolbar:!1}),ZE=e=>(0,c.createElement)(KE,{...e,isToolbar:!0}),YE=()=>{};var XE={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:o}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:o,getBlockRootClientId:r}=e(Jo),l=t(),i=r(l);return{selectedBlockName:l?n(l):null,rootClientId:i,prioritizedBlocks:o(i)?.prioritizedInserterBlocks}}),[]),[r,l,i]=qm(t,YE),a=(0,c.useMemo)((()=>(e.trim()?yf(r,l,i,e):hg(K(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,l,i,o]),s=(0,c.useMemo)((()=>a.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ep,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[a]);return[s]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:r,content:l}=e;return{action:"replace",value:"unsynced"===r?(0,a.parse)(l,{__unstableSkipMigrationLogs:!0}):(0,a.createBlock)(t,n,(0,a.createBlocksFromInnerBlocksTemplate)(o))}}},QE=window.wp.apiFetch,JE=n.n(QE);var ew=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 tw={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await JE()({path:(0,yh.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ai,{key:"icon",icon:"page"===e.subtype?Oh:ew}),e.title)},getOptionCompletion(e){return(0,c.createElement)("a",{href:e.url},e.title)}};const nw=[];function ow({completers:e=nw}){const{name:t}=rr();return(0,c.useMemo)((()=>{let n=[...e,tw];return(t===(0,a.getDefaultBlockName)()||(0,a.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,XE]),(0,s.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,s.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}var rw=function(e){return(0,c.createElement)(m.Autocomplete,{...e,completers:ow(e)})};var lw=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"}));var iw=function({isActive:e,label:t=(0,v.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,c.createElement)(m.ToolbarButton,{isActive:e,icon:lw,label:t,onClick:()=>n(!e),disabled:o})};const aw=()=>{};var sw=function(e){const{label:t=(0,v.__)("Change matrix alignment"),onChange:n=aw,value:o="center",isDisabled:r}=e,l=(0,c.createElement)(m.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,c.createElement)(m.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==Pd.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:r}),renderContent:()=>(0,c.createElement)(m.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function cw({clientId:e,maximumLength:t,context:n}){const{attributes:o,name:r,reusableBlockTitle:l}=(0,f.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t(Jo),l=n(e);if(!l)return{};const i=(0,a.isReusableBlock)((0,a.getBlockType)(l));return{attributes:o(e),name:l,reusableBlockTitle:i&&r(o(e).ref)}}),[e]),i=Iy(e);if(!r||!i)return null;const s=(0,a.getBlockType)(r),c=s?(0,a.__experimentalGetBlockLabel)(s,o,n):null,u=l||c,d=u&&u!==s.title?u:i.title;if(t&&t>0&&d.length>t){const e="...";return d.slice(0,t-e.length)+e}return d}function uw({clientId:e,maximumLength:t,context:n}){return cw({clientId:e,maximumLength:t,context:n})}var dw=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,f.useDispatch)(Jo),{clientId:o,parents:r,hasSelection:l}=(0,f.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=Xo(e(Jo)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,v.__)("Document");return(0,c.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,v.__)("Block breadcrumb")},(0,c.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&(0,c.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},i),!l&&i,!!o&&(0,c.createElement)(ai,{icon:Ih,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,c.createElement)("li",{key:e},(0,c.createElement)(m.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,c.createElement)(uw,{clientId:e,maximumLength:35})),(0,c.createElement)(ai,{icon:Ih,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,c.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,c.createElement)(uw,{clientId:o,maximumLength:35})))};function pw(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}function mw(){const{getBlockName:e}=(0,f.useSelect)(Jo),{getBlockType:t}=(0,f.useSelect)(a.store),{createSuccessNotice:n}=(0,f.useDispatch)(Qm.store);return(0,c.useCallback)(((o,r)=>{let l="";if(1===r.length){const n=r[0],i=t(e(n))?.title;l="copy"===o?(0,v.sprintf)((0,v.__)('Copied "%s" to clipboard.'),i):(0,v.sprintf)((0,v.__)('Moved "%s" to clipboard.'),i)}else l="copy"===o?(0,v.sprintf)((0,v._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,v.sprintf)((0,v._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function fw(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:c}=(0,f.useSelect)(Jo),{flashBlock:u,removeBlocks:d,replaceBlocks:m,__unstableDeleteSelection:g,__unstableExpandSelection:h,insertBlocks:b}=(0,f.useDispatch)(Jo),v=mw();return(0,p.useRefEffect)((p=>{function f(f){if(f.defaultPrevented)return;const _=t();if(0===_.length)return;if(!n()){const{target:e}=f,{ownerDocument:t}=e;if("copy"===f.type||"cut"===f.type?(0,da.documentHasUncollapsedSelection)(t):(0,da.documentHasSelection)(t))return}if(!p.contains(f.target.ownerDocument.activeElement))return;f.preventDefault();const k=i(),y=l()||r(),E=!y&&!k;if("copy"===f.type||"cut"===f.type)if(1===_.length&&u(_[0]),E)h();else{let t;if(v(f.type,_),y)t=e(_);else{const[n,o]=s();t=[n,...e(_.slice(1,_.length-1)),o]}const n=f.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,a.createBlock)(n,JSON.parse(f.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,a.serialize)(t);f.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,da.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(o)),f.clipboardData.setData("text/html",o)}if("cut"===f.type)y&&!E?d(_):(f.target.ownerDocument.activeElement.contentEditable=!1,g());else if("paste"===f.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=function({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}const o=(0,da.getFilesFromDataTransfer)(e);return o.length&&!pw(o,n)?{files:o}:{html:n,plainText:t,files:[]}}(f);let l=[];if(r.length){const e=(0,a.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,a.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===_.length){const[e]=_;if(l.every((t=>c(t.name,e))))return void b(l,void 0,e)}m(_,l,l.length-1,-1)}}return p.ownerDocument.addEventListener("copy",f),p.ownerDocument.addEventListener("cut",f),p.ownerDocument.addEventListener("paste",f),()=>{p.ownerDocument.removeEventListener("copy",f),p.ownerDocument.removeEventListener("cut",f),p.ownerDocument.removeEventListener("paste",f)}}),[])}var gw=function({children:e}){return(0,c.createElement)("div",{ref:fw()},e)};function hw({shouldIframe:e=!0,height:t="300px",children:n=(0,c.createElement)(vh,null),styles:o,contentRef:r,iframeProps:l}){const i=dh(),a=fw(),s=up(),u=(0,p.useMergeRefs)([a,r,s]);return e?(0,c.createElement)(Ip,{...l,ref:i,contentRef:u,style:{width:"100%",height:t,...l?.style},name:"editor-canvas"},(0,c.createElement)(Mm,{styles:o}),n):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(Mm,{styles:o,scope:".editor-styles-wrapper"}),(0,c.createElement)(Sp,{ref:u,className:"editor-styles-wrapper",tabIndex:-1,style:{height:t}},n))}var bw=function({children:e,height:t,styles:n}){return(0,c.createElement)(hw,{height:t,styles:n},e)};const vw=()=>(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,c.createElement)(m.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"})),_w=({style:e,className:t})=>(0,c.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,c.createElement)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e},(0,c.createElement)(vw,null))),kw=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,v.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==Pd.DOWN||(e.preventDefault(),n())},icon:(0,c.createElement)(t,null,(0,c.createElement)(e,null,(0,c.createElement)(_w,null)))}));var yw=({children:e,...t})=>($()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:kw(t),renderContent:()=>e}));var Ew=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));const ww=(0,c.createContext)({}),Sw=()=>(0,c.useContext)(ww);function Cw({children:e,...t}){const n=(0,c.useRef)();return(0,c.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,c.createElement)("div",{hidden:!0,...t,ref:n},e)}const xw=(0,c.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:l,setInsertedBlock:i}=Sw(),a=(0,p.useInstanceId)(xw),s=(0,f.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(Jo);return!!t(n)||"zoom-out"===o()}),[n]),u=cw({clientId:n,context:"list-view"}),d=cw({clientId:l?.clientId,context:"list-view"});if((0,c.useEffect)((()=>{d?.length&&(0,Ln.speak)((0,v.sprintf)((0,v.__)("%s block inserted"),d),"assertive")}),[d]),s)return null;const m=`list-view-appender__${a}`,g=(0,v.sprintf)((0,v.__)("Append to %1$s block at position %2$d, Level %3$d"),u,t+1,e);return(0,c.createElement)("div",{className:"list-view-appender"},(0,c.createElement)(Ig,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":m},onSelectOrClose:e=>{e?.clientId&&i(e)}}),(0,c.createElement)(Cw,{id:m},g))})),Bw=md(m.__experimentalTreeGridRow),Iw=(0,c.forwardRef)((({isSelected:e,position:t,level:n,rowCount:o,children:r,className:l,path:i,...a},s)=>{const u=hd({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:i}),m=(0,p.useMergeRefs)([s,u]);return(0,c.createElement)(Bw,{ref:m,className:d()("block-editor-list-view-leaf",l),level:n,positionInSet:t,setSize:o,isExpanded:void 0,...a},r)}));var Tw=Iw;var Mw=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));var Pw=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Nw=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,v.isRTL)()?"left":"right":"down":null;function Lw(e,t,n,o,r,l,i){const a=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,v.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Nw("down",l);if("down"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=Nw("down",l);if("down"===e)return(0,v.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,v.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,v.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Nw("up",l);if("up"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,v.sprintf)((0,v.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=Nw("up",l);if("up"===e)return(0,v.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,v.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,v.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,v.sprintf)((0,v.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=Nw("down",i);if("down"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(l>0&&r){const e=Nw("down",i);if("down"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=Nw("up",i);if("up"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,v.sprintf)((0,v.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(l<0&&o){const e=Nw("up",i);if("up"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,v.sprintf)((0,v.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const Rw=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?Xd:Qd:Mw:"down"===e?"horizontal"===t?(0,v.isRTL)()?Qd:Xd:Pw:null,Aw=(e,t)=>"up"===e?"horizontal"===t?(0,v.isRTL)()?(0,v.__)("Move right"):(0,v.__)("Move left"):(0,v.__)("Move up"):"down"===e?"horizontal"===t?(0,v.isRTL)()?(0,v.__)("Move left"):(0,v.__)("Move right"):(0,v.__)("Move down"):null,Dw=(0,c.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const l=(0,p.useInstanceId)(Dw),i=Array.isArray(e)?e:[e],s=i.length,{blockType:u,isDisabled:g,rootClientId:h,isFirst:b,isLast:v,firstIndex:_,orientation:k="vertical"}=(0,f.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:l,getBlock:s,getBlockListSettings:c}=e(Jo),u=i[0],d=r(u),p=o(u),m=o(i[i.length-1]),f=l(d),g=s(u),h=0===p,b=m===f.length-1,{orientation:v}=c(d)||{};return{blockType:g?(0,a.getBlockType)(g.name):null,isDisabled:"up"===t?h:b,rootClientId:d,firstIndex:p,isFirst:h,isLast:b,orientation:n||v}}),[e,t]),{moveBlocksDown:y,moveBlocksUp:E}=(0,f.useDispatch)(Jo),w="up"===t?E:y,S=`block-editor-block-mover-button__description-${l}`;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{ref:r,className:d()("block-editor-block-mover-button",`is-${t}-button`),icon:Rw(t,k),label:Aw(t,k),"aria-describedby":S,...o,onClick:g?null:t=>{w(e,h),o.onClick&&o.onClick(t)},disabled:g,__experimentalIsFocusable:!0}),(0,c.createElement)(m.VisuallyHidden,{id:S},Lw(s,u&&u.title,_,b,v,"up"===t?-1:1,k)))})),Ow=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(Dw,{direction:"up",ref:t,...e}))),zw=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(Dw,{direction:"down",ref:t,...e})));var Vw=(0,c.createElement)(F.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z"}));var Fw=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));function Hw({onClick:e}){return(0,c.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander"},(0,c.createElement)(ai,{icon:(0,v.isRTL)()?Bh:Ih}))}const Gw=3;function Uw(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}function $w(e,t){const n=Uw(e);return n?[n]:t?[]:function(e){if("core/gallery"!==e.name||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const e=Uw(n);if(e&&t.push(e),t.length>=Gw)return t}return t}(e)}var jw=(0,c.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onToggleExpanded:o,tabIndex:r,onFocus:l,onDragStart:i,onDragEnd:s,draggable:u,isExpanded:p,ariaLabel:g,ariaDescribedBy:h,updateFocusAndSelection:b},_){const k=Iy(t),y=cw({clientId:t,context:"list-view"}),{isLocked:E}=Qy(t),{canInsertBlockType:w,getSelectedBlockClientIds:S,getPreviousBlockClientId:C,getBlockRootClientId:x,getBlockOrder:B,getBlocksByClientId:I,canRemoveBlocks:T}=(0,f.useSelect)(Jo),{duplicateBlocks:M,removeBlocks:P}=(0,f.useDispatch)(Jo),N=(0,lp.__unstableUseShortcutEventMatch)(),L="sticky"===k?.positionType,R=function({clientId:e,isExpanded:t}){const{block:n}=(0,f.useSelect)((t=>({block:t(Jo).getBlock(e)})),[e]);return(0,c.useMemo)((()=>$w(n,t)),[n,t])}({clientId:t,isExpanded:p}),A=k?.positionLabel?(0,v.sprintf)((0,v.__)("Position: %1$s"),k.positionLabel):"";function D(){const e=S(),n=e.includes(t),o=n?e[0]:t,r=x(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{className:d()("block-editor-list-view-block-select-button",e),onClick:n,onKeyDown:async function(e){if(e.keyCode===Pd.ENTER||e.keyCode===Pd.SPACE)n(e);else if(e.keyCode===Pd.BACKSPACE||e.keyCode===Pd.DELETE||N("core/block-editor/remove",e)){var t;const{blocksToUpdate:e,firstBlockClientId:n,firstBlockRootClientId:o,selectedBlockClientIds:r}=D();if(!T(e,o))return;let l=null!==(t=C(n))&&void 0!==t?t:o;P(e,!1);const i=r.length>0&&0===S().length;l||(l=B()[0]),b(l,i)}else if(N("core/block-editor/duplicate",e)){if(e.defaultPrevented)return;e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=D(),o=I(t).every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&w(e.name,n)));if(o){const e=await M(t,!1);e?.length&&b(e[0],!1)}}},ref:_,tabIndex:r,onFocus:l,onDragStart:e=>{e.dataTransfer.clearData(),i?.(e)},onDragEnd:s,draggable:u,href:`#block-${t}`,"aria-label":g,"aria-describedby":h,"aria-expanded":p},(0,c.createElement)(Hw,{onClick:o}),(0,c.createElement)(ep,{icon:k?.icon,showColors:!0,context:"list-view"}),(0,c.createElement)(m.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,c.createElement)(m.__experimentalTruncate,{ellipsizeMode:"auto"},y)),k?.anchor&&(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,c.createElement)(m.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},k.anchor)),A&&L&&(0,c.createElement)(m.Tooltip,{text:A},(0,c.createElement)(ai,{icon:Vw})),R.length?(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0},R.map(((e,t)=>(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__image",key:e.clientId,style:{backgroundImage:`url(${e.url})`,zIndex:R.length-t}})))):null,E&&(0,c.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,c.createElement)(ai,{icon:Fw})))))}));var Ww=({children:e,clientIds:t,cloneClassname:n,onDragStart:o,onDragEnd:r})=>{const{srcRootClientId:l,isDraggable:i,icon:s}=(0,f.useSelect)((e=>{const{canMoveBlocks:n,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:l}=e(Jo),{getBlockType:i,getActiveBlockVariation:s}=e(a.store),c=o(t[0]),u=r(t[0]),d=s(u,l(t[0]));return{srcRootClientId:c,isDraggable:n(t,c),icon:d?.icon||i(u)?.icon}}),[t]),u=(0,c.useRef)(!1),[d,p,g]=function(){const e=(0,c.useRef)(null),t=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null);return(0,c.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,c.useCallback)((r=>{e.current=r.clientY,n.current=(0,da.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,c.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),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0),o=0===e||0===n?0:n/e;t.current=-25*o}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:h,stopDraggingBlocks:b}=(0,f.useDispatch)(Jo);if((0,c.useEffect)((()=>()=>{u.current&&b()}),[]),!i)return e({draggable:!1});const v={type:"block",srcClientIds:t,srcRootClientId:l};return(0,c.createElement)(m.Draggable,{cloneClassname:n,__experimentalTransferDataType:"wp-blocks",transferData:v,onDragStart:e=>{window.requestAnimationFrame((()=>{h(t),u.current=!0,d(e),o&&o()}))},onDragOver:p,onDragEnd:()=>{b(),u.current=!1,g(),r&&r()},__experimentalDragComponent:(0,c.createElement)(Hm,{count:t.length,icon:s})},(({onDraggableStart:t,onDraggableEnd:n})=>e({draggable:!0,onDragStart:t,onDragEnd:n})))};const Kw=(0,c.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:l,level:i,isExpanded:a,selectedClientIds:s,...u},p)=>{const{clientId:m}=n,{blockMovingClientId:g,selectedBlockInBlockEditor:h}=(0,f.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Jo);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:b,insertedBlock:v,setInsertedBlock:_}=Sw(),k=g&&h===m,y=d()("block-editor-list-view-block-contents",{"is-dropping-before":k}),E=s.includes(m)?s:[m];return(0,c.createElement)(c.Fragment,null,b&&(0,c.createElement)(b,{block:n,insertedBlock:v,setInsertedBlock:_}),(0,c.createElement)(Ww,{clientIds:E},(({draggable:s,onDragStart:d,onDragEnd:m})=>(0,c.createElement)(jw,{ref:p,className:y,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:l,level:i,draggable:s,onDragStart:d,onDragEnd:m,isExpanded:a,...u}))))}));var qw=Kw;function Zw(e,t){const n=()=>{const n=t.current?.querySelector(`[role=row][data-block="${e}"]`);return n?da.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}var Yw=(0,c.memo)((function e({block:{clientId:t},isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:s,rowCount:u,siblingBlockCount:g,showBlockMovers:h,path:b,isExpanded:_,selectedClientIds:k,isSyncedBranch:y}){const E=(0,c.useRef)(null),w=(0,c.useRef)(null),[S,C]=(0,c.useState)(!1),{isLocked:x,canEdit:B}=Qy(t),I=o&&k[0]===t,T=o&&k[k.length-1]===t,{toggleBlockHighlight:M}=(0,f.useDispatch)(Jo),P=Iy(t),N=P?.name||P?.title||(0,v.__)("Untitled"),L=(0,f.useSelect)((e=>e(Jo).getBlock(t)),[t]),R=(0,f.useSelect)((e=>e(Jo).getBlockName(t)),[t]),A=(0,f.useSelect)((e=>e(Jo).getBlockEditingMode(t)),[t]),D=(0,a.hasBlockSupport)(R,"__experimentalToolbar",!0)&&"default"===A,O=`list-view-block-select-button__${(0,p.useInstanceId)(e)}`,z=((e,t,n)=>(0,v.sprintf)((0,v.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(i,g,s),V=x?(0,v.sprintf)((0,v.__)("%s (locked)"),N):N,F=(0,v.sprintf)((0,v.__)("Options for %s"),N),{expand:H,collapse:G,BlockSettingsMenu:U,listViewInstanceId:$,expandedState:j,setInsertedBlock:W,treeGridElementRef:K}=Sw(),q=h&&g>0,Z=d()("block-editor-list-view-block__mover-cell",{"is-visible":S||o}),Y=d()("block-editor-list-view-block__menu-cell",{"is-visible":S||I}),X=(0,c.useCallback)((()=>{C(!0),M(t,!0)}),[t,C,M]),Q=(0,c.useCallback)((()=>{C(!1),M(t,!1)}),[t,C,M]),J=(0,c.useCallback)((e=>{l(e,t),e.preventDefault()}),[t,l]),ee=(0,c.useCallback)(((e,t)=>{t&&l(void 0,e,null,null),Zw(e,K)}),[l,K]),te=(0,c.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?G(t):!1===_&&H(t)}),[t,H,G,_]);let ne;q?ne=2:D||(ne=3);const oe=d()({"is-selected":o,"is-first-selected":I,"is-last-selected":T,"is-branch-selected":r,"is-synced-branch":y,"is-dragging":n,"has-single-cell":!D,"is-synced":P?.isSynced}),re=k.includes(t)?k:[t];!function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,c.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,da.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const l=n.current.getBoundingClientRect(),i=t.getBoundingClientRect();(l.top<i.top||l.bottom>i.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:o,rowItemRef:w,selectedClientIds:k});const le=o&&1===k.length;return(0,c.createElement)(Tw,{className:oe,onKeyDown:e=>{e.keyCode===Pd.ESCAPE&&!e.defaultPrevented&&k.length>0&&(e.stopPropagation(),e.preventDefault(),l(e,void 0))},onMouseEnter:X,onMouseLeave:Q,onFocus:X,onBlur:Q,level:s,position:i,rowCount:u,path:b,id:`list-view-${$}-block-${t}`,"data-block":t,"data-expanded":B?_:void 0,ref:w},(0,c.createElement)(m.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:ne,ref:E,"aria-selected":!!o},(({ref:e,tabIndex:t,onFocus:n})=>(0,c.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,c.createElement)(qw,{block:L,onClick:J,onToggleExpanded:te,isSelected:o,position:i,siblingBlockCount:g,level:s,ref:e,tabIndex:le?0:t,onFocus:n,isExpanded:B?_:void 0,selectedClientIds:k,ariaLabel:V,ariaDescribedBy:O,updateFocusAndSelection:ee}),(0,c.createElement)(Cw,{id:O},z)))),q&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalTreeGridCell,{className:Z,withoutGridItem:!0},(0,c.createElement)(m.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,c.createElement)(Ow,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))),(0,c.createElement)(m.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,c.createElement)(zw,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))))),D&&U&&(0,c.createElement)(m.__experimentalTreeGridCell,{className:Y,"aria-selected":!!o},(({ref:e,tabIndex:t,onFocus:n})=>(0,c.createElement)(U,{clientIds:re,block:L,icon:_a,label:F,toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onFocus:n},disableOpenOnArrowDown:!0,expand:H,expandedState:j,setInsertedBlock:W,__experimentalSelectBlock:ee}))))}));function Xw(e,t,n,o){var r;const l=n?.includes(e.clientId);if(l)return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(Qw(t,n,o),0):1}const Qw=(e,t,n)=>(o,r)=>{var l;const i=t?.includes(r.clientId);if(i)return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+Xw(r,e,t,n):o+1},Jw=()=>{};var eS=(0,c.memo)((function e(t){const{blocks:n,selectBlock:o=Jw,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchDragged:s=!1,isBranchSelected:u=!1,listPosition:d=0,fixedListWindow:p,isExpanded:g,parentId:h,shouldShowInnerBlocks:b=!0,isSyncedBranch:v=!1,showAppender:_=!0}=t,k=Iy(h),y=v||!!k?.isSynced,E=(0,f.useSelect)((e=>!h||e(Jo).canEditBlock(h)),[h]),{expandedState:w,draggedClientIds:S}=Sw();if(!E)return null;const C=_&&1===i,x=n.filter(Boolean),B=x.length,I=C?B+1:B;let T=d;return(0,c.createElement)(c.Fragment,null,x.map(((t,n)=>{var d;const{clientId:m,innerBlocks:h}=t;n>0&&(T+=Xw(x[n-1],w,S,g));const{itemInView:v}=p,_=v(T),k=n+1,E=a.length>0?`${a}_${k}`:`${k}`,C=!!h?.length,M=C&&b?null!==(d=w[m])&&void 0!==d?d:g:void 0,P=!!S?.includes(m),N=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(m,l),L=u||N&&C,R=P||_||s||N&&m===l[0];return(0,c.createElement)(f.AsyncModeProvider,{key:m,value:!N},R&&(0,c.createElement)(Yw,{block:t,selectBlock:o,isSelected:N,isBranchSelected:L,isDragged:P||s,level:i,position:k,rowCount:I,siblingBlockCount:B,showBlockMovers:r,path:E,isExpanded:M,listPosition:T,selectedClientIds:l,isSyncedBranch:y}),!R&&(0,c.createElement)("tr",null,(0,c.createElement)("td",{className:"block-editor-list-view-placeholder"})),C&&M&&(0,c.createElement)(e,{parentId:m,blocks:h,selectBlock:o,showBlockMovers:r,level:i+1,path:E,listPosition:T+1,fixedListWindow:p,isBranchSelected:L,isBranchDragged:P||s,selectedClientIds:l,isExpanded:g,isSyncedBranch:y}))})),C&&(0,c.createElement)(m.__experimentalTreeGridRow,{level:i,setSize:I,positionInSet:I,isExpanded:!0},(0,c.createElement)(m.__experimentalTreeGridCell,null,(e=>(0,c.createElement)(xw,{clientId:h,nestingLevel:i,blockCount:B,...e})))))}));function tS({listViewRef:e,blockDropTarget:t}){const{rootClientId:n,clientId:o,dropPosition:r}=t||{},[l,i]=(0,c.useMemo)((()=>{if(!e.current)return[];return[n?e.current.querySelector(`[data-block="${n}"]`):void 0,o?e.current.querySelector(`[data-block="${o}"]`):void 0]}),[n,o]),a=i||l,s=(0,v.isRTL)(),u=(0,c.useCallback)((e=>{if(!l)return 0;const t=l.querySelector(".block-editor-block-icon").getBoundingClientRect();return s?e.right-t.left:t.right-e.left}),[l,s]),d=(0,c.useCallback)(((e,t)=>{if(!a)return 0;let n=a.offsetWidth;const o=(0,da.getScrollContainer)(a,"horizontal"),r=a.ownerDocument,l=o===r.body||o===r.documentElement;if(o&&!l){const r=o.getBoundingClientRect(),l=(0,v.isRTL)()?r.right-e.right:e.left-r.left,i=o.clientWidth;if(i<n+l&&(n=i-l),!s&&e.left+t<r.left)return n-=r.left-e.left,n;if(s&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[s,a]),p=(0,c.useMemo)((()=>{if(!a)return{};const e=a.getBoundingClientRect(),t=u(e);return{width:d(e,t)}}),[u,d,a]),f=(0,c.useMemo)((()=>{if(a&&("top"===r||"bottom"===r||"inside"===r))return{contextElement:a,getBoundingClientRect(){const e=a.getBoundingClientRect(),t=u(e);let n=s?e.left:e.left+t,o=0,l=0;const i=(0,da.getScrollContainer)(a,"horizontal"),c=a.ownerDocument,p=i===c.body||i===c.documentElement;if(i&&!p){const e=i.getBoundingClientRect(),t=s?i.offsetWidth-i.clientWidth:0;n<e.left+t&&(n=e.left+t)}"top"===r?(o=e.top,l=e.top):(o=e.bottom,l=e.bottom);const m=d(e,t),f=l-o;return new window.DOMRect(n,o,m,f)}}}),[a,r,u,d,s]);return a?(0,c.createElement)(m.Popover,{animate:!1,anchor:f,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,c.createElement)("div",{style:p,className:"block-editor-list-view-drop-indicator__line"})):null}function nS(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,f.useDispatch)(Jo),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getSelectedBlockClientIds:i,hasMultiSelection:s,hasSelectedBlock:u}=(0,f.useSelect)(Jo),{getBlockType:d}=(0,f.useSelect)(a.store);return{updateBlockSelection:(0,c.useCallback)((async(a,c,p,m)=>{if(!a?.shiftKey&&a?.keyCode!==Pd.ESCAPE)return void n(c,m);a.preventDefault();const f="keydown"===a.type&&a.keyCode===Pd.ESCAPE,g="keydown"===a.type&&(a.keyCode===Pd.UP||a.keyCode===Pd.DOWN||a.keyCode===Pd.HOME||a.keyCode===Pd.END);if(!g&&!u()&&!s())return void n(c,null);const h=i(),b=[...r(c),c];if((f||g&&!h.some((e=>b.includes(e))))&&await e(),!f){let e=l(),n=c;g&&(u()||s()||(e=c),p&&(n=p));const o=r(e),i=r(n),{start:a,end:d}=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]}}(e,n,o,i);await t(a,d,null)}const _=i();if((a.keyCode===Pd.HOME||a.keyCode===Pd.END)&&_.length>1)return;const k=h.filter((e=>!_.includes(e)));let y;if(1===k.length){const e=d(o(k[0]))?.title;e&&(y=(0,v.sprintf)((0,v.__)("%s deselected."),e))}else k.length>1&&(y=(0,v.sprintf)((0,v.__)("%s blocks deselected."),k.length));y&&(0,Ln.speak)(y,"assertive")}),[e,o,d,r,l,i,s,u,t,n])}}const oS=28;function rS(e,t){const n=e[t+1];return n&&n.isDraggedBlock?rS(e,t+1):n}const lS=["top","bottom"];function iS(e,t,n=!1){let o,r,l,i,a;for(let n=0;n<e.length;n++){const s=e[n];if(s.isDraggedBlock)continue;const c=s.element.getBoundingClientRect(),[u,d]=th(t,c,lS),p=nh(t,c);if(void 0===l||u<l||p){l=u;const t=e.indexOf(s),n=e[t-1];if("top"===d&&n&&n.rootClientId===s.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",i=n.element.getBoundingClientRect(),a=t-1):(r=s,o=d,i=c,a=t),p)break}}if(!r)return;const s=function(e,t){const n=[];let o=e;for(;o;)n.push({...o}),o=t.find((e=>e.clientId===o.rootClientId));return n}(r,e),c="bottom"===o;if(c&&r.canInsertDraggedBlocksAsChild&&(r.innerBlockCount>0&&r.isExpanded||function(e,t,n=1,o=!1){const r=o?t.right-n*oS:t.left+n*oS;return(o?e.x<r-oS:e.x>r+oS)&&e.y<t.bottom}(t,i,s.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,o=!1){const r=o?t.right-n*oS:t.left+n*oS;return o?e.x>r:e.x<r}(t,i,s.length,n)){const l=rS(e,a),c=r.nestingLevel,u=l?l.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*oS:t.left+n*oS,l=o?r-e.x:e.x-r,i=Math.round(l/oS);return Math.abs(i)}(t,i,s.length,n),p=Math.max(Math.min(d,c-u),0);if(s[p]){let t=r.blockIndex;if(s[p].nestingLevel===l?.nestingLevel)t=l?.blockIndex;else for(let n=a;n>=0;n--){const o=e[n];if(o.rootClientId===s[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:s[p].rootClientId,clientId:r.clientId,blockIndex:t,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+u,dropPosition:o}}const aS="align",sS="__experimentalBorder",cS="color",uS="customClassName",dS="typography.__experimentalFontFamily",pS="typography.fontSize",mS="layout",fS=[...["typography.lineHeight",pS,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",dS,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing"],sS,cS,"spacing"];const gS={align:e=>(0,a.hasBlockSupport)(e,aS),borderColor:e=>function(e,t="any"){if("web"!==c.Platform.OS)return!1;const n=(0,a.getBlockSupport)(e,sS);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,a.getBlockSupport)(e,cS);return t&&!1!==t.background},textColor:e=>{const t=(0,a.getBlockSupport)(e,cS);return t&&!1!==t.text},gradient:e=>{const t=(0,a.getBlockSupport)(e,cS);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,a.hasBlockSupport)(e,uS,!0),fontFamily:e=>(0,a.hasBlockSupport)(e,dS),fontSize:e=>(0,a.hasBlockSupport)(e,pS),layout:e=>(0,a.hasBlockSupport)(e,mS),style:e=>fS.some((t=>(0,a.hasBlockSupport)(e,t)))};function hS(e,t){return Object.entries(gS).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function bS(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,hS(t[o],e[o])),bS(e[o].innerBlocks,t[o].innerBlocks,n)}function vS(){const e=(0,f.useRegistry)(),{updateBlockAttributes:t}=(0,f.useDispatch)(Jo),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,f.useDispatch)(Qm.store);return(0,c.useCallback)((async l=>{let i="";try{if(!window.navigator.clipboard)return void r((0,v.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,v.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,a.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,v.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,a.parse)(i);if(1===s.length?e.batch((()=>{bS(l,l.map((()=>s[0])),t)})):e.batch((()=>{bS(l,s,t)})),1===l.length){const e=(0,a.getBlockType)(l[0].name)?.title;n((0,v.sprintf)((0,v.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,v.sprintf)((0,v.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function _S({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:l,canMoveBlocks:i,canRemoveBlocks:s}=(0,f.useSelect)(Jo),{getDefaultBlockName:c,getGroupingBlockName:u}=(0,f.useSelect)(a.store),d=l(e),p=r(e[0]),m=d.every((e=>!!e&&((0,a.hasBlockSupport)(e.name,"color")||(0,a.hasBlockSupport)(e.name,"typography")))),g=d.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,p))),h=o(c(),p),b=i(e,p),v=s(e,p),{removeBlocks:_,replaceBlocks:k,duplicateBlocks:y,insertAfterBlock:E,insertBeforeBlock:w,flashBlock:S,setBlockMovingClientId:C,setNavigationMode:x,selectBlock:B}=(0,f.useDispatch)(Jo),I=mw(),T=vS();return t({canCopyStyles:m,canDuplicate:g,canInsertDefaultBlock:h,canMove:b,canRemove:v,rootClientId:p,blocks:d,onDuplicate(){return y(e,n)},onRemove(){return _(e,n)},onInsertBefore(){const t=Array.isArray(e)?e[0]:t;w(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;E(t)},onMoveTo(){x(!0),B(e[0]),C(e[0])},onGroup(){if(!d.length)return;const t=u(),n=(0,a.switchToBlockType)(d,t);n&&k(e,n)},onUngroup(){if(!d.length)return;const t=d[0].innerBlocks;t.length&&k(e,t)},onCopy(){const e=d.map((({clientId:e})=>e));1===d.length&&S(e[0]),I("copy",e)},async onPasteStyles(){await T(d)}})}var kS=(0,p.compose)((0,f.withSelect)(((e,{clientId:t})=>{const n=e(Jo).getBlock(t);return{block:n,shouldRender:n&&"core/html"===n.name}})),(0,f.withDispatch)(((e,{block:t})=>({onClick:()=>e(Jo).replaceBlocks(t.clientId,(0,a.rawHandler)({HTML:(0,a.getBlockContent)(t)}))}))))((function({shouldRender:e,onClick:t,small:n}){if(!e)return null;const o=(0,v.__)("Convert to Blocks");return(0,c.createElement)(m.MenuItem,{onClick:t},!n&&o)}));const{Fill:yS,Slot:ES}=(0,m.createSlotFill)("__unstableBlockSettingsMenuFirstItem");yS.Slot=ES;var wS=yS;const{clearTimeout:SS,setTimeout:CS}=window,xS=200;function BS({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=xS}){const{getSelectedBlockClientId:r,getBlockRootClientId:l}=(0,f.useSelect)(Jo),{toggleBlockHighlight:i}=(0,f.useDispatch)(Jo),a=(0,c.useRef)(),s=(0,f.useSelect)((e=>e(Jo).getSettings().isDistractionFree),[]),u=e=>{if(e&&s)return;const t=r(),o=n?l(t):t;i(o,e)},d=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},p=()=>{const e=a.current;e&&SS&&SS(e)};return(0,c.useEffect)((()=>()=>{u(!1),p()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),p(),u(!0)},debouncedHideGestures:e=>{e&&e.stopPropagation(),p(),a.current=CS((()=>{d()&&u(!1)}),o)}}}function IS({ref:e,highlightParent:t=!1,debounceTimeout:n=xS}){const[o,r]=(0,c.useState)(!1),{debouncedShowGestures:l,debouncedHideGestures:i}=BS({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),a=(0,c.useRef)(!1),s=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,c.useEffect)((()=>{const t=e.current,n=()=>{s()&&(r(!0),l())},o=()=>{s()||(r(!1),i())};return t&&!a.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",o,!0),a.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",o))}}),[e,a,r,l,i]),{onMouseMove:l,onMouseLeave:i}}const TS={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function MS({blocks:e,onCopy:t,label:n}){const o=(0,p.useCopyToClipboard)((()=>(0,a.serialize)(e)),t),r=e.length>1?(0,v.__)("Copy blocks"):(0,v.__)("Copy"),l=n||r;return(0,c.createElement)(m.MenuItem,{ref:o},l)}function PS({block:e,clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}){const i=e?.clientId,s=Array.isArray(t)?t:[t],u=s.length,d=s[0],{firstParentClientId:g,onlyBlock:h,parentBlockType:b,previousBlockClientId:_,selectedBlockClientIds:k}=(0,f.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:l,getBlockAttributes:i}=e(Jo),{getActiveBlockVariation:s}=e(a.store),c=o(d),u=c&&n(c);return{firstParentClientId:c,onlyBlock:1===t(c),parentBlockType:c&&(s(u,i(c))||(0,a.getBlockType)(u)),previousBlockClientId:r(d),selectedBlockClientIds:l()}}),[d]),{getBlockOrder:y,getSelectedBlockClientIds:E}=(0,f.useSelect)(Jo),w=(0,f.useSelect)((e=>Xo(e(Jo)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:S}=Xo((0,f.useDispatch)(Jo)),C=(0,f.useSelect)((e=>{const{getShortcutRepresentation:t}=e(lp.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")}}),[]),x=(0,lp.__unstableUseShortcutEventMatch)(),{selectBlock:B}=(0,f.useDispatch)(Jo),I=k.length>0,T=(0,c.useCallback)((async e=>{if(n){const t=await e;t&&t[0]&&n(t[0],!1)}}),[n]),M=(0,c.useCallback)((()=>{if(n){let e=_||g;e||(e=y()[0]);const t=I&&0===E().length;n(e,t)}}),[n,_,g,y,I,E]),P=1===u?(0,v.__)("Delete"):(0,v.__)("Delete blocks"),N=(0,c.useRef)(),L=IS({ref:N,highlightParent:!0}),R=k?.includes(g),A=i?w===i||!1:void 0,D=(0,c.useCallback)((e=>{e&&w!==i?S(i):!e&&w&&w===i&&S(void 0)}),[i,w,S]);return(0,c.createElement)(_S,{clientIds:t,__experimentalUpdateSelection:!n},(({canCopyStyles:e,canDuplicate:n,canInsertDefaultBlock:i,canMove:a,canRemove:s,onDuplicate:f,onInsertAfter:_,onInsertBefore:k,onRemove:y,onCopy:E,onPasteStyles:w,onMoveTo:I,blocks:O})=>(0,c.createElement)(m.DropdownMenu,{icon:_a,label:(0,v.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:TS,open:A,onToggle:D,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(x("core/block-editor/remove",e)&&s?(e.preventDefault(),M(y())):x("core/block-editor/duplicate",e)&&n?(e.preventDefault(),T(f())):x("core/block-editor/insert-after",e)&&i?(e.preventDefault(),S(void 0),_()):x("core/block-editor/insert-before",e)&&i&&(e.preventDefault(),S(void 0),k()))}},...l},(({onClose:l})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(wS.Slot,{fillProps:{onClose:l}}),!R&&!!g&&(0,c.createElement)(m.MenuItem,{...L,ref:N,icon:(0,c.createElement)(ep,{icon:b.icon}),onClick:()=>B(g)},(0,v.sprintf)((0,v.__)("Select parent block (%s)"),b.title)),1===u&&(0,c.createElement)(kS,{clientId:d}),(0,c.createElement)(MS,{blocks:O,onCopy:E}),n&&(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(l,f,T),shortcut:C.duplicate},(0,v.__)("Duplicate")),i&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(l,k),shortcut:C.insertBefore},(0,v.__)("Add before")),(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(l,_),shortcut:C.insertAfter},(0,v.__)("Add after")))),e&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(MS,{blocks:O,onCopy:E,label:(0,v.__)("Copy styles")}),(0,c.createElement)(m.MenuItem,{onClick:w},(0,v.__)("Paste styles"))),(0,c.createElement)(fE.Slot,{fillProps:{onClose:l,canMove:a,onMoveTo:I,onlyBlock:h,count:u,firstBlockClientId:d},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):c.Children.map((e=>(0,c.cloneElement)(e,{onClose:l}))),s&&(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{onClick:(0,p.pipe)(l,y,M),shortcut:C.remove},P)))))))}var NS=PS;const LS=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const RS=(0,c.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:l=!1,showAppender:i=!1,blockSettingsMenu:a=PS,rootClientId:s,description:u,onSelect:d,additionalBlockContent:g},h){n&&$()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const b=(0,p.useInstanceId)(e),{clientIdsTree:_,draggedClientIds:k,selectedClientIds:y}=function({blocks:e,rootClientId:t}){return(0,f.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:l}=Xo(n(Jo));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:l(t)}}),[e,t])}({blocks:n,rootClientId:s}),{getBlock:E}=(0,f.useSelect)(Jo),{visibleBlockCount:w,shouldShowInnerBlocks:S}=(0,f.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(Jo),r=k?.length>0?n(k).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[k]),{updateBlockSelection:C}=nS(),[x,B]=(0,c.useReducer)(LS,{}),{ref:I,target:T}=function({dropZoneElement:e}){const{getBlockRootClientId:t,getBlockIndex:n,getBlockCount:o,getDraggedBlockClientIds:r,canInsertBlocks:l}=(0,f.useSelect)(Jo),[i,a]=(0,c.useState)(),{rootClientId:s,blockIndex:u}=i||{},d=eh(s,u),m=(0,v.isRTL)(),g=r(),h=(0,p.useThrottle)((0,c.useCallback)(((e,r)=>{const i={x:e.clientX,y:e.clientY},s=!!g?.length,c=iS(Array.from(r.querySelectorAll("[data-block]")).map((e=>{const r=e.dataset.block,i="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=t(r);return{clientId:r,isExpanded:i,rootClientId:u,blockIndex:n(r),element:e,nestingLevel:c||void 0,isDraggedBlock:!!s&&a,innerBlockCount:o(r),canInsertDraggedBlocksAsSibling:!s||l(g,u),canInsertDraggedBlocksAsChild:!s||l(g,r)}})),i,m);c&&a(c)}),[l,g,o,n,t,m]),200);return{ref:(0,p.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){i&&d(e)},onDragLeave(){h.cancel(),a(null)},onDragOver(e){h(e,e.currentTarget)},onDragEnd(){h.cancel(),a(null)}}),target:i}}({dropZoneElement:o}),M=(0,c.useRef)(),P=(0,p.useMergeRefs)([M,I,h]),[N,L]=(0,c.useState)(null),{setSelectedTreeId:R}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,c.useState)(null),{selectedBlockParentClientIds:r}=(0,f.useSelect)((t=>{const{getBlockParents:n}=t(Jo);return{selectedBlockParentClientIds:n(e,!1)}}),[e]),l=Array.isArray(r)&&r.length?r:null;return(0,c.useEffect)((()=>{n!==e&&l&&t({type:"expand",clientIds:r})}),[e]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:y[0],setExpandedState:B}),A=(0,c.useCallback)(((e,t,n)=>{C(e,t,null,n),R(t),d&&d(E(t))}),[R,C,d,E]);(0,c.useEffect)((()=>{y?.length&&Zw(y[0],M)}),[]);const D=(0,c.useCallback)((e=>{e&&B({type:"expand",clientIds:[e]})}),[B]),O=(0,c.useCallback)((e=>{e&&B({type:"collapse",clientIds:[e]})}),[B]),z=(0,c.useCallback)((e=>{D(e?.dataset?.block)}),[D]),V=(0,c.useCallback)((e=>{O(e?.dataset?.block)}),[O]),F=(0,c.useCallback)(((e,t,n)=>{e.shiftKey&&C(e,t?.dataset?.block,n?.dataset?.block)}),[C]),H=(0,c.useMemo)((()=>({draggedClientIds:k,expandedState:x,expand:D,collapse:O,BlockSettingsMenu:a,listViewInstanceId:b,AdditionalBlockContent:g,insertedBlock:N,setInsertedBlock:L,treeGridElementRef:M})),[k,x,D,O,a,b,g,N,L]),[G]=(0,p.__experimentalUseFixedWindowList)(M,36,w,{expandedState:x,useWindowing:!0,windowOverscan:40});return _.length||i?(0,c.createElement)(f.AsyncModeProvider,{value:!0},(0,c.createElement)(tS,{listViewRef:M,blockDropTarget:T}),(0,c.createElement)(m.__experimentalTreeGrid,{id:t,className:"block-editor-list-view-tree","aria-label":(0,v.__)("Block navigation structure"),ref:P,onCollapseRow:V,onExpandRow:z,onFocusRow:F,applicationAriaLabel:(0,v.__)("Block navigation structure"),"aria-description":u},(0,c.createElement)(ww.Provider,{value:H},(0,c.createElement)(eS,{blocks:_,parentId:s,selectBlock:A,showBlockMovers:r,fixedListWindow:G,selectedClientIds:y,isExpanded:l,shouldShowInnerBlocks:S,showAppender:i})))):null}));var AS=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(RS,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function DS({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,c.createElement)(m.Button,{...r,ref:o,icon:Ew,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,v.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}var OS=(0,c.forwardRef)((function({isDisabled:e,...t},n){$()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,f.useSelect)((e=>!!e(Jo).getBlockCount()),[])&&!e;return(0,c.createElement)(m.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,c.createElement)(DS,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,c.createElement)("div",{className:"block-editor-block-navigation__container"},(0,c.createElement)("p",{className:"block-editor-block-navigation__label"},(0,v.__)("List view")),(0,c.createElement)(AS,null))})}));function zS(e,t,n){const o=new(j_())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function VS(e){return e?.find((e=>e.isDefault))}function FS({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,a.getBlockType)(e.name)?.example,l=zS(n,o,t),i=(0,c.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:l+" block-editor-block-styles__block-preview-container"},example:r})),[e,l]);return(0,c.createElement)(Om,{item:i})}function HS({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:l}=(0,f.useSelect)((t=>{const{getBlock:n}=t(Jo),o=n(e);if(!o)return{};const r=(0,a.getBlockType)(o.name),{getBlockStyles:l}=t(a.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:i}=(0,f.useDispatch)(Jo),s=function(e){return e&&0!==e.length?VS(e)?e:[{name:"default",label:(0,v._x)("Default","block style"),isDefault:!0},...e]:[]}(n),u=function(e,t){for(const n of new(j_())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=e?.find((({name:e})=>e===t));if(o)return o}return VS(e)}(s,l),d=function(e,t){return(0,c.useMemo)((()=>{const n=t?.example,o=t?.name;return n&&o?(0,a.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,a.cloneBlock)(e):void 0}),[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=zS(l,u,n);i(e,{className:o}),t()},stylesToRender:s,activeStyle:u,genericPreviewBlock:d,className:l}}const GS=()=>{};function US({clientId:e,onSwitch:t=GS,onHoverClassName:n=GS}){const{onSelect:o,stylesToRender:r,activeStyle:l,genericPreviewBlock:i,className:a}=HS({clientId:e,onSwitch:t}),[s,u]=(0,c.useState)(null),f=(0,p.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const g=(0,p.debounce)(u,250),h=e=>{var t;s!==e?(g(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):g.cancel()};return(0,c.createElement)("div",{className:"block-editor-block-styles"},(0,c.createElement)("div",{className:"block-editor-block-styles__variants"},r.map((e=>{const t=e.label||e.name;return(0,c.createElement)(m.Button,{__next40pxDefaultSize:!0,className:d()("block-editor-block-styles__item",{"is-active":l.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>h(e),onFocus:()=>h(e),onMouseLeave:()=>h(null),onBlur:()=>h(null),onClick:()=>(e=>{o(e),n(null),u(null),g.cancel()})(e),"aria-current":l.name===e.name},(0,c.createElement)(m.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),s&&!f&&(0,c.createElement)(m.Popover,{placement:"left-start",offset:20,focusOnMount:!1},(0,c.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>h(null)},(0,c.createElement)(FS,{activeStyle:l,className:a,genericPreviewBlock:i,style:s}))))}var $S=US;US.Slot=()=>($()("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);const jS={0:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})),1:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),2:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})),3:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})),4:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),5:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})),6:(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"}))};function WS({level:e}){return jS[e]?(0,c.createElement)(m.Icon,{icon:jS[e]}):null}const KS=[1,2,3,4,5,6],qS={className:"block-library-heading-level-dropdown"};function ZS({options:e=KS,value:t,onChange:n}){return(0,c.createElement)(m.ToolbarDropdownMenu,{popoverProps:qS,icon:(0,c.createElement)(WS,{level:t}),label:(0,v.__)("Change level"),controls:e.map((e=>{{const o=e===t;return{icon:(0,c.createElement)(WS,{level:e,isPressed:o}),label:0===e?(0,v.__)("Paragraph"):(0,v.sprintf)((0,v.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}}))})}var YS=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));var XS=function({icon:e=YS,label:t=(0,v.__)("Choose variation"),instructions:n=(0,v.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:l}){const i=d()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,c.createElement)(m.Placeholder,{icon:e,label:t,instructions:n,className:i},(0,c.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,v.__)("Block variations")},o.map((e=>(0,c.createElement)("li",{key:e.name},(0,c.createElement)(m.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,c.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),l&&(0,c.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,c.createElement)(m.Button,{variant:"link",onClick:()=>r()},(0,v.__)("Skip"))))};var QS=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"}));const JS="carousel",eC="grid",tC=({onBlockPatternSelect:e})=>(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,c.createElement)(m.Button,{variant:"primary",onClick:e},(0,v.__)("Choose"))),nC=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,c.createElement)(m.Button,{icon:Qd,label:(0,v.__)("Previous pattern"),onClick:e,disabled:0===n}),(0,c.createElement)(m.Button,{icon:Xd,label:(0,v.__)("Next pattern"),onClick:t,disabled:n===o-1}));var oC=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l,onBlockPatternSelect:i})=>{const a=e===JS,s=(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,c.createElement)(m.Button,{icon:Ti,label:(0,v.__)("Carousel view"),onClick:()=>t(JS),isPressed:a}),(0,c.createElement)(m.Button,{icon:QS,label:(0,v.__)("Grid view"),onClick:()=>t(eC),isPressed:e===eC}));return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},a&&(0,c.createElement)(nC,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l}),s,a&&(0,c.createElement)(tC,{onBlockPatternSelect:i}))};var rC=function(e,t,n){return(0,f.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Jo),a=r(e);return n?i(a).filter(n):l(t,a)}),[e,t,n])};const lC=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const l=(0,m.__unstableUseCompositeState)(),i="block-editor-block-pattern-setup__container";if(e===JS){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,c.createElement)("div",{className:i},(0,c.createElement)("ul",{className:"carousel-container"},n.map(((t,n)=>(0,c.createElement)(aC,{className:e.get(n)||"",key:t.name,pattern:t}))))))}return(0,c.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,c.createElement)(m.__unstableComposite,{...l,role:"listbox",className:i,"aria-label":(0,v.__)("Patterns list")},n.map((e=>(0,c.createElement)(iC,{key:e.name,pattern:e,onSelect:o,composite:l,showTitles:r})))))};function iC({pattern:e,onSelect:t,composite:n,showTitles:o}){const r="block-editor-block-pattern-setup-list",{blocks:l,description:i,viewportWidth:a=700}=e,s=(0,p.useInstanceId)(iC,`${r}__item-description`);return(0,c.createElement)("div",{className:`${r}__list-item`,"aria-label":e.title,"aria-describedby":e.description?s:void 0},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,className:`${r}__item`,onClick:()=>t(l)},(0,c.createElement)(Am,{blocks:l,viewportWidth:a}),o&&(0,c.createElement)("div",{className:`${r}__item-title`},e.title),!!i&&(0,c.createElement)(m.VisuallyHidden,{id:s},i)))}function aC({className:e,pattern:t,minHeight:n}){const{blocks:o,title:r,description:l}=t,i=(0,p.useInstanceId)(aC,"block-editor-block-pattern-setup-list__item-description");return(0,c.createElement)("li",{className:`pattern-slide ${e}`,"aria-label":r,"aria-describedby":l?i:void 0},(0,c.createElement)(Am,{blocks:o,minHeight:n}),!!l&&(0,c.createElement)(m.VisuallyHidden,{id:i},l))}var sC=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=JS,showTitles:l=!1})=>{const[i,s]=(0,c.useState)(r),[u,d]=(0,c.useState)(0),{replaceBlock:p}=(0,f.useDispatch)(Jo),m=rC(e,t,n);if(!m?.length)return null;const g=o||(t=>{const n=t.map((e=>(0,a.cloneBlock)(e)));p(e,n)});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,c.createElement)(lC,{viewMode:i,activeSlide:u,patterns:m,onBlockPatternSelect:g,showTitles:l}),(0,c.createElement)(oC,{viewMode:i,setViewMode:s,activeSlide:u,totalSlides:m.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{g(m[u].blocks)}})))};function cC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,c.createElement)("fieldset",{className:e},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Transform to variation")),o.map((e=>(0,c.createElement)(m.Button,{key:e.name,icon:(0,c.createElement)(ep,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,v.sprintf)((0,v.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0}))))}function uC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,c.createElement)(m.DropdownMenu,{className:e,label:(0,v.__)("Transform to variation"),text:(0,v.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:Pw,toggleProps:{iconPosition:"right"}},(()=>(0,c.createElement)("div",{className:`${e}__container`},(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItemsChoice,{choices:r,value:n,onSelect:t})))))}var dC=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,f.useDispatch)(Jo),{activeBlockVariation:n,variations:o}=(0,f.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(a.store),{getBlockName:r,getBlockAttributes:l}=t(Jo),i=e&&r(e);return{activeBlockVariation:n(i,l(e)),variations:i&&o(i,"transform")}}),[e]),r=n?.name,l=(0,c.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===o.length)}),[o]);if(!o?.length)return null;const i=l?cC:uC;return(0,c.createElement)(i,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},pC=(0,p.createHigherOrderComponent)((e=>t=>{const n=bl("color.palette"),o=!bl("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,i=r&&r.length>0||!l;return(0,c.createElement)(e,{...t,colors:r,disableCustomColors:l,hasColorsToChoose:i})}),"withColorContext"),mC=pC(m.ColorPalette);function fC({onChange:e,value:t,...n}){return(0,c.createElement)(Tv,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var gC=window.wp.date;const hC=new Date(2022,0,25);function bC({format:e,defaultFormat:t,onChange:n}){return(0,c.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,c.createElement)(m.VisuallyHidden,{as:"legend"},(0,v.__)("Date format")),(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Default format"),help:`${(0,v.__)("Example:")} ${(0,gC.dateI18n)(t,hC)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,c.createElement)(vC,{format:e,onChange:n}))}function vC({format:e,onChange:t}){var n;const o=[...new Set(["Y-m-d",(0,v._x)("n/j/Y","short date format"),(0,v._x)("n/j/Y g:i A","short date format with time"),(0,v._x)("M j, Y","medium date format"),(0,v._x)("M j, Y g:i A","medium date format with time"),(0,v._x)("F j, Y","long date format"),(0,v._x)("M j","short date format without the year")])],r=o.map(((e,t)=>({key:`suggested-${t}`,name:(0,gC.dateI18n)(e,hC),format:e}))),l={key:"custom",name:(0,v.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,v.__)("Enter your own date format")},[i,a]=(0,c.useState)((()=>!!e&&!o.includes(e)));return(0,c.createElement)(m.__experimentalVStack,null,(0,c.createElement)(m.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,v.__)("Choose a format"),options:[...r,l],value:i?l:null!==(n=r.find((t=>t.format===e)))&&void 0!==n?n:l,onChange:({selectedItem:e})=>{e===l?a(!0):(a(!1),t(e.format))}}),i&&(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Custom format"),hideLabelFromVision:!0,help:(0,c.createInterpolateElement)((0,v.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,c.createElement)(m.ExternalLink,{href:(0,v.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)}))}const _C=({setting:e,children:t,panelId:n,...o})=>(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter},t),kC=({colorValue:e,label:t})=>(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(m.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,c.createElement)(m.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t)),yC=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,l={onClick:t,className:d()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,c.createElement)(m.Button,{...l},(0,c.createElement)(kC,{colorValue:o,label:r}))};function EC({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:l,__experimentalIsRenderedInSidebar:i,...a}){let s;return i&&(s={placement:"left-start",offset:36,shift:!0}),(0,c.createElement)(c.Fragment,null,l.map(((l,u)=>{var d;const p={clearable:!1,colorValue:l.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:l.gradientValue,gradients:r,label:l.label,onColorChange:l.onColorChange,onGradientChange:l.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...l},f={colorValue:null!==(d=l.gradientValue)&&void 0!==d?d:l.colorValue,label:l.label};return l&&(0,c.createElement)(_C,{key:u,setting:l,...a},(0,c.createElement)(m.Dropdown,{popoverProps:s,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:yC(f),renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,c.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,c.createElement)(Tv,{...p})))}))})))}const wC=["colors","disableCustomColors","gradients","disableCustomGradients"],SC=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:l,settings:i,title:a,showTitle:s=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:g})=>{const h=(0,p.useInstanceId)(SC),{batch:b}=(0,f.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!i?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,c.createElement)(m.__experimentalToolsPanel,{className:d()("block-editor-panel-color-gradient-settings",e),label:s?a:void 0,resetAll:()=>{b((()=>{i.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,c.createElement)(EC,{settings:i,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:u,enableAlpha:g}),!!l&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalSpacer,{marginY:4})," ",l)):null},CC=e=>{const t=Ob();return(0,c.createElement)(SC,{...t,...e})};var xC=e=>wC.every((t=>e.hasOwnProperty(t)))?(0,c.createElement)(SC,{...e}):(0,c.createElement)(CC,{...e});const BC=(0,c.createContext)({}),IC=()=>(0,c.useContext)(BC);function TC({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:l,children:i}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,c.useState)(),[l,i]=(0,c.useState)(),[a,u]=(0,c.useState)({x:0,y:0}),[d,p]=(0,c.useState)(100),[m,f]=(0,c.useState)(0),g=t/n,[h,b]=(0,c.useState)(g),v=(0,c.useCallback)((()=>{const t=(m+90)%360;let n=g;if(m%180==90&&(n=1/g),0===t)return r(),f(t),b(g),void u((e=>({x:-e.y*n,y:e.x*n})));const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let l=0,i=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(l=o.width),270!==t&&180!==t||(i=o.height);const a=o.getContext("2d");a.translate(l,i),a.rotate(t*Math.PI/180),a.drawImage(e.target,0,0),o.toBlob((e=>{r(URL.createObjectURL(e)),f(t),b(o.width/o.height),u((e=>({x:-e.y*n,y:e.x*n})))}))};const l=(0,s.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof l&&(o.crossOrigin=l)}),[m,g,e]);return(0,c.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:l,setCrop:i,position:a,setPosition:u,zoom:d,setZoom:p,rotation:m,setRotation:f,rotateClockwise:v,aspect:h,setAspect:b,defaultAspect:g})),[o,l,a,d,m,v,h,g])}({url:t,naturalWidth:n,naturalHeight:o}),u=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:l}){const{createErrorNotice:i}=(0,f.useDispatch)(Qm.store),[a,s]=(0,c.useState)(!1),u=(0,c.useCallback)((()=>{s(!1),l()}),[l]),d=(0,c.useCallback)((()=>{s(!0);const a=[];t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),JE()({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{r({id:e.id,url:e.source_url})})).catch((e=>{i((0,v.sprintf)((0,v.__)("Could not edit image. %s"),(0,da.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{s(!1),l()}))}),[e,t,o,n,r,i,l]);return(0,c.useMemo)((()=>({isInProgress:a,apply:d,cancel:u})),[a,d,u])}({id:e,url:t,onSaveImage:l,onFinishEditing:r,...a}),d=(0,c.useMemo)((()=>({...a,...u})),[a,u]);return(0,c.createElement)(BC.Provider,{value:d},i)} + */,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}},7191:(e,t,n)=>{"use strict";var o=n(2213),r=n(1087);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},2775:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}};e.exports=n(),e.exports.createColors=n},4465:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8036:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n(4465);const r=o(n(4529)),l=o(n(3576));e.exports=(0,l.default)(r.default)},5525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prefixWrapCSSSelector=t.prefixWrapCSSRule=void 0;const o=n(3467);t.prefixWrapCSSRule=(e,n,r,l,i)=>{const s=e.selector.split(",").filter((e=>!(0,o.cssRuleMatchesPrefixSelector)({selector:e},l)));0!==s.length&&(e.selector=s.map((o=>(0,t.prefixWrapCSSSelector)(o,e,n,r,l,i))).filter(o.isValidCSSSelector).join(", "))};t.prefixWrapCSSSelector=(e,t,n,r,l,i)=>{const s=(0,o.cleanSelector)(e);return""===s?null:null!==n&&s.startsWith(n,0)||(0,o.isKeyframes)(t)||r.some((e=>s.match(e)))?s:(0,o.isNotRootTag)(s)?l+" "+s:i?l+" ."+s:s.replace(/^(body|html|:root)/,l)}},3467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cssRuleMatchesPrefixSelector=t.isNotRootTag=t.isKeyframes=t.cleanSelector=t.isValidCSSSelector=void 0;const n=/(^\s*|\s*$)/g,o=/^(body|html|:root).*$/;t.isValidCSSSelector=e=>null!==e;t.cleanSelector=e=>e.replace(n,"");t.isKeyframes=e=>{const{parent:t}=e,n=t;return void 0!==t&&"atrule"===n.type&&void 0!==n.name&&null!==n.name.match(/keyframes$/)};t.isNotRootTag=e=>!e.match(o);t.cssRuleMatchesPrefixSelector=(e,t)=>{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${n}$`).test(e.selector)}},9411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldIncludeFilePath=void 0;t.shouldIncludeFilePath=(e,t,n)=>t.length>0?null!=e&&t.some((t=>e.match(t))):!(n.length>0)||!(null!=e&&n.some((t=>e.match(t))))},8061:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv7PluginGenerator=void 0;const i=l(n(1311));t.asPostCSSv7PluginGenerator=e=>e.plugin(i.PLUGIN_NAME,((e,t)=>new i.default(e,t).prefix()))},2888:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv8PluginGenerator=t.isPostCSSv8=void 0;const i=l(n(1311));t.isPostCSSv8=e=>void 0!==e.Root;t.asPostCSSv8PluginGenerator=()=>(e,t)=>{const n=new i.default(e,t);return{postcssPlugin:i.PLUGIN_NAME,Once(e){n.prefixRoot(e)}}}},3576:(e,t,n)=>{"use strict";const o=n(2888),r=n(8061);e.exports=e=>(0,o.isPostCSSv8)(e)?(0,o.asPostCSSv8PluginGenerator)():(0,r.asPostCSSv7PluginGenerator)(e)},1311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLUGIN_NAME=void 0;const o=n(5525),r=n(9411);t.PLUGIN_NAME="postcss-prefixwrap";t.default=class{blacklist;ignoredSelectors;isPrefixSelector;prefixRootTags;prefixSelector;whitelist;nested;constructor(e,t={}){this.blacklist=t.blacklist??[],this.ignoredSelectors=t.ignoredSelectors??[],this.isPrefixSelector=new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`),this.prefixRootTags=t.prefixRootTags??!1,this.prefixSelector=e,this.whitelist=t.whitelist??[],this.nested=t.nested??null}prefixRoot(e){(0,r.shouldIncludeFilePath)(e.source?.input?.file,this.whitelist,this.blacklist)&&e.walkRules((e=>{(0,o.prefixWrapCSSRule)(e,this.nested,this.ignoredSelectors,this.prefixSelector,this.prefixRootTags)}))}prefix(){return e=>{this.prefixRoot(e)}}}},5404:(e,t,n)=>{const o=n(1544);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const r=o(n.value);let l=!1;r.walk((n=>{if("function"!==n.type||"url"!==n.value)return;const o=n.nodes[0].value,r=new URL(o,e.rootUrl);return r.pathname===o&&t.skipHostRelativeUrls||(n.nodes[0].value=r.toString(),l=!0),!1})),l&&(n.value=o.stringify(r))}}},e.exports.postcss=!0},1544:(e,t,n)=>{var o=n(8491),r=n(3815),l=n(4725);function i(e){return this instanceof i?(this.nodes=o(e),this):new i(e)}i.prototype.toString=function(){return Array.isArray(this.nodes)?l(this.nodes):""},i.prototype.walk=function(e,t){return r(this.nodes,e,t),this},i.unit=n(1524),i.walk=r,i.stringify=l,e.exports=i},8491:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),r='"'.charCodeAt(0),l="\\".charCodeAt(0),i="/".charCodeAt(0),s=",".charCodeAt(0),a=":".charCodeAt(0),c="*".charCodeAt(0),u="u".charCodeAt(0),d="U".charCodeAt(0),p="+".charCodeAt(0),m=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var h,g,f,b,v,k,_,y,E,w=[],S=e,C=0,x=S.charCodeAt(C),B=S.length,I=[{nodes:w}],T=0,M="",P="",R="";C<B;)if(x<=32){h=C;do{h+=1,x=S.charCodeAt(h)}while(x<=32);b=S.slice(C,h),f=w[w.length-1],x===n&&T?R=b:f&&"div"===f.type?(f.after=b,f.sourceEndIndex+=b.length):x===s||x===a||x===i&&S.charCodeAt(h+1)!==c&&(!E||E&&"function"===E.type&&"calc"!==E.value)?P=b:w.push({type:"space",sourceIndex:C,sourceEndIndex:h,value:b}),C=h}else if(x===o||x===r){h=C,b={type:"string",sourceIndex:C,quote:g=x===o?"'":'"'};do{if(v=!1,~(h=S.indexOf(g,h+1)))for(k=h;S.charCodeAt(k-1)===l;)k-=1,v=!v;else h=(S+=g).length-1,b.unclosed=!0}while(v);b.value=S.slice(C+1,h),b.sourceEndIndex=b.unclosed?h:h+1,w.push(b),C=h+1,x=S.charCodeAt(C)}else if(x===i&&S.charCodeAt(C+1)===c)b={type:"comment",sourceIndex:C,sourceEndIndex:(h=S.indexOf("*/",C))+2},-1===h&&(b.unclosed=!0,h=S.length,b.sourceEndIndex=h),b.value=S.slice(C+2,h),w.push(b),C=h+2,x=S.charCodeAt(C);else if(x!==i&&x!==c||!E||"function"!==E.type||"calc"!==E.value)if(x===i||x===s||x===a)b=S[C],w.push({type:"div",sourceIndex:C-P.length,sourceEndIndex:C+b.length,value:b,before:P,after:""}),P="",C+=1,x=S.charCodeAt(C);else if(t===x){h=C;do{h+=1,x=S.charCodeAt(h)}while(x<=32);if(y=C,b={type:"function",sourceIndex:C-M.length,value:M,before:S.slice(y+1,h)},C=h,"url"===M&&x!==o&&x!==r){h-=1;do{if(v=!1,~(h=S.indexOf(")",h+1)))for(k=h;S.charCodeAt(k-1)===l;)k-=1,v=!v;else h=(S+=")").length-1,b.unclosed=!0}while(v);_=h;do{_-=1,x=S.charCodeAt(_)}while(x<=32);y<_?(b.nodes=C!==_+1?[{type:"word",sourceIndex:C,sourceEndIndex:_+1,value:S.slice(C,_+1)}]:[],b.unclosed&&_+1!==h?(b.after="",b.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:h,value:S.slice(_+1,h)})):(b.after=S.slice(_+1,h),b.sourceEndIndex=h)):(b.after="",b.nodes=[]),C=h+1,b.sourceEndIndex=b.unclosed?h:C,x=S.charCodeAt(C),w.push(b)}else T+=1,b.after="",b.sourceEndIndex=C+1,w.push(b),I.push(b),w=b.nodes=[],E=b;M=""}else if(n===x&&T)C+=1,x=S.charCodeAt(C),E.after=R,E.sourceEndIndex+=R.length,R="",T-=1,I[I.length-1].sourceEndIndex=C,I.pop(),w=(E=I[T]).nodes;else{h=C;do{x===l&&(h+=1),h+=1,x=S.charCodeAt(h)}while(h<B&&!(x<=32||x===o||x===r||x===s||x===a||x===i||x===t||x===c&&E&&"function"===E.type&&"calc"===E.value||x===i&&"function"===E.type&&"calc"===E.value||x===n&&T));b=S.slice(C,h),t===x?M=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||p!==b.charCodeAt(1)||!m.test(b.slice(2))?w.push({type:"word",sourceIndex:C,sourceEndIndex:h,value:b}):w.push({type:"unicode-range",sourceIndex:C,sourceEndIndex:h,value:b}),C=h}else b=S[C],w.push({type:"word",sourceIndex:C-P.length,sourceEndIndex:C+b.length,value:b}),C+=1,x=S.charCodeAt(C);for(C=I.length-1;C;C-=1)I[C].unclosed=!0,I[C].sourceEndIndex=S.length;return I[0].nodes}},4725:e=>{function t(e,t){var o,r,l=e.type,i=e.value;return t&&void 0!==(r=t(e))?r:"word"===l||"space"===l?i:"string"===l?(o=e.quote||"")+i+(e.unclosed?"":o):"comment"===l?"/*"+i+(e.unclosed?"":"*/"):"div"===l?(e.before||"")+i+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==l?o:i+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):i}function n(e,n){var o,r;if(Array.isArray(e)){for(o="",r=e.length-1;~r;r-=1)o=t(e[r],n)+o;return o}return t(e,n)}e.exports=n},1524:e=>{var t="-".charCodeAt(0),n="+".charCodeAt(0),o=".".charCodeAt(0),r="e".charCodeAt(0),l="E".charCodeAt(0);e.exports=function(e){var i,s,a,c=0,u=e.length;if(0===u||!function(e){var r,l=e.charCodeAt(0);if(l===n||l===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var i=e.charCodeAt(2);return r===o&&i>=48&&i<=57}return l===o?(r=e.charCodeAt(1))>=48&&r<=57:l>=48&&l<=57}(e))return!1;for((i=e.charCodeAt(c))!==n&&i!==t||c++;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;if(i=e.charCodeAt(c),s=e.charCodeAt(c+1),i===o&&s>=48&&s<=57)for(c+=2;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;if(i=e.charCodeAt(c),s=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(i===r||i===l)&&(s>=48&&s<=57||(s===n||s===t)&&a>=48&&a<=57))for(c+=s===n||s===t?3:2;c<u&&!((i=e.charCodeAt(c))<48||i>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},3815:e=>{e.exports=function e(t,n,o){var r,l,i,s;for(r=0,l=t.length;r<l;r+=1)i=t[r],o||(s=n(i,r,t)),!1!==s&&"function"===i.type&&Array.isArray(i.nodes)&&e(i.nodes,n,o),o&&n(i,r,t)}},1326:(e,t,n)=>{"use strict";let o=n(683);class r extends o{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=r,r.default=r,o.registerAtRule(r)},6589:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},683:(e,t,n)=>{"use strict";let o,r,l,i,{isClean:s,my:a}=n(1381),c=n(1516),u=n(6589),d=n(7490);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function m(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)m(t)}class h extends d{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]<this.proxyOf.nodes.length&&(t=this.indexes[o],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[o]+=1;return delete this.indexes[o],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,o=this.index(e),r=this.normalize(t,this.proxyOf.nodes[o]).reverse();o=this.index(e);for(let e of r)this.proxyOf.nodes.splice(o+1,0,e);for(let e in this.indexes)n=this.indexes[e],o<n&&(this.indexes[e]=n+r.length);return this.markDirty(),this}insertBefore(e,t){let n,o=this.index(e),r=0===o&&"prepend",l=this.normalize(t,this.proxyOf.nodes[o],r).reverse();o=this.index(e);for(let e of l)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+l.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(o(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c(e)]}else if(e.selector)e=[new r(e)];else if(e.name)e=[new l(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new u(e)]}return e.map((e=>(e[a]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&m(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)})):this.walk(((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)})):this.walk(((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)})):this.walk(((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}h.registerParse=e=>{o=e},h.registerRule=e=>{r=e},h.registerAtRule=e=>{l=e},h.registerRoot=e=>{i=e},e.exports=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,l.prototype):"rule"===e.type?Object.setPrototypeOf(e,r.prototype):"decl"===e.type?Object.setPrototypeOf(e,c.prototype):"comment"===e.type?Object.setPrototypeOf(e,u.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[a]=!0,e.nodes&&e.nodes.forEach((e=>{h.rebuild(e)}))}},356:(e,t,n)=>{"use strict";let o=n(2775),r=n(9746);class l extends Error{constructor(e,t,n,o,r,i){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,l)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=o.isColorSupported),r&&e&&(t=r(t));let n,l,i=t.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,i.length),c=String(a).length;if(e){let{bold:e,gray:t,red:r}=o.createColors(!0);n=t=>e(r(t)),l=e=>t(e)}else n=l=e=>e;return i.slice(s,a).map(((e,t)=>{let o=s+1+t,r=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=l(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+l(r)+e+"\n "+t+n("^")}return" "+l(r)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=l,l.default=l},1516:(e,t,n)=>{"use strict";let o=n(7490);class r extends o{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=r,r.default=r},271:(e,t,n)=>{"use strict";let o,r,l=n(683);class i extends l{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}i.registerLazyResult=e=>{o=e},i.registerProcessor=e=>{r=e},e.exports=i,i.default=i},8940:(e,t,n)=>{"use strict";let o=n(1516),r=n(5696),l=n(6589),i=n(1326),s=n(5380),a=n(9434),c=n(4092);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:n,...d}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:s.prototype};n.map&&(n.map={...n.map,__proto__:r.prototype}),t.push(n)}}if(d.nodes&&(d.nodes=e.nodes.map((e=>u(e,t)))),d.source){let{inputId:e,...n}=d.source;d.source=n,null!=e&&(d.source.input=t[e])}if("root"===d.type)return new a(d);if("decl"===d.type)return new o(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new l(d);if("atrule"===d.type)return new i(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5380:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{fileURLToPath:l,pathToFileURL:i}=n(2739),{isAbsolute:s,resolve:a}=n(197),{nanoid:c}=n(5042),u=n(9746),d=n(356),p=n(5696),m=Symbol("fromOffsetCache"),h=Boolean(o&&r),g=Boolean(a&&s);class f{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!g||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=a(t.from)),g&&h){let e=new p(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+c(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,o={}){let r,l,s;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof e.offset){let o=this.fromOffset(e.offset);t=o.line,n=o.col}else t=e.line,n=e.column;if("number"==typeof o.offset){let e=this.fromOffset(o.offset);l=e.line,s=e.col}else l=o.line,s=o.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,l,s);return r=a?new d(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,o.plugin):new d(e,void 0===l?t:{column:n,line:t},void 0===l?n:{column:s,line:l},this.css,this.file,o.plugin),r.input={column:n,endColumn:s,endLine:l,line:t,source:this.css},this.file&&(i&&(r.input.url=i(this.file).toString()),r.input.file=this.file),r}fromOffset(e){let t,n;if(this[m])n=this[m];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let o=0,r=e.length;o<r;o++)n[o]=t,t+=e[o].length+1;this[m]=n}t=n[n.length-1];let o=0;if(e>=t)o=n.length-1;else{let t,r=n.length-2;for(;o<r;)if(t=o+(r-o>>1),e<n[t])r=t-1;else{if(!(e>=n[t+1])){o=t;break}o=t+1}}return{col:e-n[o]+1,line:o+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,o){if(!this.map)return!1;let r,a,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(r=c.originalPositionFor({column:o,line:n})),a=s(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let d={column:u.column,endColumn:r&&r.column,endLine:r&&r.line,line:u.line,url:a.toString()};if("file:"===a.protocol){if(!l)throw new Error("file: protocol is not available in this PostCSS build");d.file=l(a)}let p=c.sourceContentFor(u.source);return p&&(d.source=p),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}e.exports=f,f.default=f,u&&u.registerInput&&u.registerInput(f)},448:(e,t,n)=>{"use strict";let{isClean:o,my:r}=n(1381),l=n(1670),i=n(633),s=n(683),a=n(271),c=(n(3122),n(9055)),u=n(4295),d=n(9434);const p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},m={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},g=0;function f(e){return"object"==typeof e&&"function"==typeof e.then}function b(e){let t=!1,n=p[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,g,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,g,n+"Exit"]:[n,n+"Exit"]}function v(e){let t;return t="document"===e.type?["Document",g,"DocumentExit"]:"root"===e.type?["Root",g,"RootExit"]:b(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function k(e){return e[o]=!1,e.nodes&&e.nodes.forEach((e=>k(e))),e}let _={};class y{constructor(e,t,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof y||t instanceof c)o=k(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=u;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(t,n)}catch(e){this.processed=!0,this.error=e}o&&!o[r]&&s.rebuild(o)}else o=k(t);this.result=new c(e,o,n),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!m[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[n])if("object"==typeof t[n])for(let o in t[n])e(t,"*"===o?n:n+"-"+o.toLowerCase(),t[n][o]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];){e[o]=!0;let t=[v(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new l(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(f(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[o];)e[o]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,o]of e){let e;this.result.lastPlugin=n;try{e=o(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,l=t.iterator;for(;r=n.nodes[n.indexes[l]];)if(n.indexes[l]+=1,!r[o])return r[o]=!0,void e.push(v(r));t.iterator=0,delete n.indexes[l]}let l=t.events;for(;t.eventIndex<l.length;){let e=l[t.eventIndex];if(t.eventIndex+=1,e===g)return void(n.nodes&&n.nodes.length&&(n[o]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[o]=!0;let t=b(e);for(let n of t)if(n===g)e.nodes&&e.each((e=>{e[o]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}y.registerPostcss=e=>{_=e},e.exports=y,y.default=y,d.registerLazyResult(y),a.registerLazyResult(y)},7374:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let o=[],r="",l=!1,i=0,s=!1,a="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:s?n===a&&(s=!1):'"'===n||"'"===n?(s=!0,a=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(l=!0),l?(""!==r&&o.push(r.trim()),r="",l=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o}};e.exports=t,t.default=t},1670:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{dirname:l,relative:i,resolve:s,sep:a}=n(197),{pathToFileURL:c}=n(2739),u=n(5380),d=Boolean(o&&r),p=Boolean(l&&s&&i&&a);e.exports=class{constructor(e,t,n,o){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||l(e.file);!1===this.mapOpts.sourcesContent?(t=new o(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=r.fromSourceMap(e)}else this.map=new r({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new r({file:this.outputFile()});let e,t,n=1,o=1,l="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((r,s,a)=>{if(this.css+=r,s&&"end"!==a&&(i.generated.line=n,i.generated.column=o-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=l,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=r.match(/\n/g),e?(n+=e.length,t=r.lastIndexOf("\n"),o=r.length-t):o+=r.length,s&&"start"!==a){let e=s.parent||{raws:{}};("decl"===s.type||"atrule"===s.type&&!s.nodes)&&s===e.last&&!e.raws.semicolon||(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=n,i.generated.column=o-2,this.map.addMapping(i)):(i.source=l,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=o-1,this.map.addMapping(i)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?l(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=l(s(n,this.mapOpts.annotation)));let o=i(n,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let o=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(o,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===a&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},7661:(e,t,n)=>{"use strict";let o=n(1670),r=n(633),l=(n(3122),n(4295));const i=n(9055);class s{constructor(e,t,n){let l;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=r;this.result=new i(this._processor,l,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let c=new o(s,l,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=l;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}e.exports=s,s.default=s},7490:(e,t,n)=>{"use strict";let{isClean:o,my:r}=n(1381),l=n(356),i=n(346),s=n(633);function a(e,t){let n=new e.constructor;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;if("proxyCache"===o)continue;let r=e[o],l=typeof r;"parent"===o&&"object"===l?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===l&&null!==r&&(r=a(r)),n[o]=r)}return n}class c{constructor(e={}){this.raws={},this[o]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:o}=this.rangeBy(t);return this.source.input.error(e,{column:o.column,line:o.line},{column:n.column,line:n.line},t)}return new l(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[o]){this[o]=!1;let e=this;for(;e=e.parent;)e[o]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let o=(t=this.toString()).indexOf(e.word);-1!==o&&(n=this.positionInside(o,t))}return n}positionInside(e,t){let n=t||this.toString(),o=this.source.start.column,r=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(o=1,r+=1):o+=1;return{column:o,line:r}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let o=this.toString(),r=o.indexOf(e.word);-1!==r&&(t=this.positionInside(r,o),n=this.positionInside(r+e.word.length,o))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new i).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},o=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){let l=t.get(o.input);null==l&&(l=r,t.set(o.input,r),r++),n[e]={end:o.end,inputId:l,start:o.start}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}get proxyOf(){return this}}e.exports=c,c.default=c},4295:(e,t,n)=>{"use strict";let o=n(683),r=n(3937),l=n(5380);function i(e,t){let n=new l(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=i,i.default=i,o.registerParse(i)},3937:(e,t,n)=>{"use strict";let o=n(1516),r=n(2327),l=n(6589),i=n(1326),s=n(9434),a=n(4092);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,o,r=new i;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let l=!1,s=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(o=a.length-1,n=a[o];n&&"space"===n[0];)n=a[--o];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){l=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),l&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,o=0;for(let r=t-1;r>=0&&(n=e[r],"space"===n[0]||(o+=1,2!==o));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,o,r=0;for(let[l,i]of e.entries()){if(t=i,n=t[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return l}this.doubleColon(t)}o=t}return!1}comment(e){let t=new l;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=r(this.input)}decl(e,t){let n=new o;this.init(n,e[0][2]);let r,l=e[e.length-1];for(";"===l[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(l[3]||l[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],o=n[3]||n[2];if(o)return o}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,s=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let o=this.stringFrom(e,t);o=this.spacesFromEnd(e)+o," !important"!==o&&(n.raws.important=o);break}if("important"===r[1].toLowerCase()){let o=e.slice(0),r="";for(let e=t;e>0;e--){let t=o[e][0];if(0===r.trim().indexOf("!")&&"space"!==t)break;r=o.pop()[1]+r}0===r.trim().indexOf("!")&&(n.important=!0,n.raws.important=r,e=o)}if("space"!==r[0]&&"comment"!==r[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,o=!1,r=null,l=[],i=e[1].startsWith("--"),s=[],a=e;for(;a;){if(n=a[0],s.push(a),"("===n||"["===n)r||(r=a),l.push("("===n?")":"]");else if(i&&o&&"{"===n)r||(r=a),l.push("}");else if(0===l.length){if(";"===n){if(o)return void this.decl(s,i);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(o=!0)}else n===l[l.length-1]&&(l.pop(),0===l.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),l.length>0&&this.unclosedBracket(r),t&&o){if(!i)for(;s.length&&(a=s[s.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(s.pop());this.decl(s,i)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,o){let r,l,i,s,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],l=r[0],"space"!==l||e!==a-1||o?"comment"===l?(s=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",c[s]||c[i]||","===u.slice(-1)?d=!1:u+=r[1]):u+=r[1]:d=!1;if(!d){let o=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:o,value:u}}e[t]=u}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let o=t;o<e.length;o++)n+=e[o][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},4529:(e,t,n)=>{"use strict";let o=n(356),r=n(1516),l=n(448),i=n(683),s=n(9656),a=n(633),c=n(8940),u=n(271),d=n(5776),p=n(6589),m=n(1326),h=n(9055),g=n(5380),f=n(4295),b=n(7374),v=n(4092),k=n(9434),_=n(7490);function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}y.plugin=function(e,t){let n,o=!1;function r(...n){console&&console.warn&&!o&&(o=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...n);return r.postcssPlugin=e,r.postcssVersion=(new s).version,r}return Object.defineProperty(r,"postcss",{get:()=>(n||(n=r()),n)}),r.process=function(e,t,n){return y([r(n)]).process(e,t)},r},y.stringify=a,y.parse=f,y.fromJSON=c,y.list=b,y.comment=e=>new p(e),y.atRule=e=>new m(e),y.decl=e=>new r(e),y.rule=e=>new v(e),y.root=e=>new k(e),y.document=e=>new u(e),y.CssSyntaxError=o,y.Declaration=r,y.Container=i,y.Processor=s,y.Document=u,y.Comment=p,y.Warning=d,y.AtRule=m,y.Result=h,y.Input=g,y.Rule=v,y.Root=k,y.Node=_,l.registerPostcss(y),e.exports=y,y.default=y},5696:(e,t,n)=>{"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(1866),{existsSync:l,readFileSync:i}=n(9977),{dirname:s,join:a}=n(197);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,o=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new o(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),o=e.indexOf("*/",n);n>-1&&o>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,o)))}loadFile(e){if(this.root=s(e),l(e))return this.mapFile=e,i(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof o)return r.fromSourceMap(t).toString();if(t instanceof r)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=a(s(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},9656:(e,t,n)=>{"use strict";let o=n(7661),r=n(448),l=n(271),i=n(9434);class s{constructor(e=[]){this.version="8.4.35",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new r(this,e,t):new o(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=s,s.default=s,i.registerProcessor(s),l.registerProcessor(s)},9055:(e,t,n)=>{"use strict";let o=n(5776);class r{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new o(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}e.exports=r,r.default=r},9434:(e,t,n)=>{"use strict";let o,r,l=n(683);class i extends l{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new o(new r,this,e).stringify()}}i.registerLazyResult=e=>{o=e},i.registerProcessor=e=>{r=e},e.exports=i,i.default=i,l.registerRoot(i)},4092:(e,t,n)=>{"use strict";let o=n(683),r=n(7374);class l extends o{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return r.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}e.exports=l,l.default=l,o.registerRule(l)},346:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let r=(e.raws.between||"")+(t?";":"");this.builder(n+o+r,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let o=e.parent,r=0;for(;o&&"root"!==o.type;)r+=1,o=o.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)n+=t}return n}block(e,t){let n,o=this.raw(e,"between","beforeOpen");this.builder(t+o+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let o=0;o<e.nodes.length;o++){let r=e.nodes[o],l=this.raw(r,"before");l&&this.builder(l),this.stringify(r,t!==o||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=e.raws.important||" !important"),t&&(o+=";"),this.builder(o,e)}document(e){this.body(e)}raw(e,n,o){let r;if(o||(o=n),n&&(r=e.raws[n],void 0!==r))return r;let l=e.parent;if("before"===o){if(!l||"root"===l.type&&l.first===e)return"";if(l&&"document"===l.type)return""}if(!l)return t[o];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[o])return i.rawCache[o];if("before"===o||"after"===o)return this.beforeAfter(e,o);{let t="raw"+((s=o)[0].toUpperCase()+s.slice(1));this[t]?r=this[t](i,e):i.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var s;return void 0===r&&(r=t[o]),i.rawCache[o]=r,r}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let o=n.parent;if(o&&o!==e&&o.parent&&o.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},633:(e,t,n)=>{"use strict";let o=n(346);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},1381:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},2327:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),r="/".charCodeAt(0),l="\n".charCodeAt(0),i=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),p="(".charCodeAt(0),m=")".charCodeAt(0),h="{".charCodeAt(0),g="}".charCodeAt(0),f=";".charCodeAt(0),b="*".charCodeAt(0),v=":".charCodeAt(0),k="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,E=/.[\r\n"'(/\\]/,w=/[\da-f]/i;e.exports=function(e,S={}){let C,x,B,I,T,M,P,R,N,L,A=e.css.valueOf(),O=S.ignoreErrors,D=A.length,z=0,V=[],F=[];function H(t){throw e.error("Unclosed "+t,z)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&z>=D},nextToken:function(e){if(F.length)return F.pop();if(z>=D)return;let S=!!e&&e.ignoreUnclosed;switch(C=A.charCodeAt(z),C){case l:case i:case a:case c:case s:x=z;do{x+=1,C=A.charCodeAt(x)}while(C===i||C===l||C===a||C===c||C===s);L=["space",A.slice(z,x)],z=x-1;break;case u:case d:case h:case g:case v:case f:case m:{let e=String.fromCharCode(C);L=[e,e,z];break}case p:if(R=V.length?V.pop()[1]:"",N=A.charCodeAt(z+1),"url"===R&&N!==t&&N!==n&&N!==i&&N!==l&&N!==a&&N!==s&&N!==c){x=z;do{if(M=!1,x=A.indexOf(")",x+1),-1===x){if(O||S){x=z;break}H("bracket")}for(P=x;A.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);L=["brackets",A.slice(z,x+1),z,x],z=x}else x=A.indexOf(")",z+1),I=A.slice(z,x+1),-1===x||E.test(I)?L=["(","(",z]:(L=["brackets",I,z,x],z=x);break;case t:case n:B=C===t?"'":'"',x=z;do{if(M=!1,x=A.indexOf(B,x+1),-1===x){if(O||S){x=z+1;break}H("string")}for(P=x;A.charCodeAt(P-1)===o;)P-=1,M=!M}while(M);L=["string",A.slice(z,x+1),z,x],z=x;break;case k:_.lastIndex=z+1,_.test(A),x=0===_.lastIndex?A.length-1:_.lastIndex-2,L=["at-word",A.slice(z,x+1),z,x],z=x;break;case o:for(x=z,T=!0;A.charCodeAt(x+1)===o;)x+=1,T=!T;if(C=A.charCodeAt(x+1),T&&C!==r&&C!==i&&C!==l&&C!==a&&C!==c&&C!==s&&(x+=1,w.test(A.charAt(x)))){for(;w.test(A.charAt(x+1));)x+=1;A.charCodeAt(x+1)===i&&(x+=1)}L=["word",A.slice(z,x+1),z,x],z=x;break;default:C===r&&A.charCodeAt(z+1)===b?(x=A.indexOf("*/",z+2)+1,0===x&&(O||S?x=A.length:H("comment")),L=["comment",A.slice(z,x+1),z,x],z=x):(y.lastIndex=z+1,y.test(A),x=0===y.lastIndex?A.length-1:y.lastIndex-2,L=["word",A.slice(z,x+1),z,x],V.push(L),z=x)}return z++,L},position:function(){return z}}}},3122:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},5776:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},628:(e,t,n)=>{"use strict";var o=n(4067);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},5826:(e,t,n)=>{e.exports=n(628)()},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4462:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(1609),a=n(5826),c=n(4306),u=n(461),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},4132:(e,t,n)=>{"use strict";var o=n(4462);t.A=o.TextareaAutosize},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,"");function l(e){return t[e]}var i=function(e){return e.replace(o,l)};e.exports=i,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=i},1609:e=>{"use strict";e.exports=window.React},9746:()=>{},9977:()=>{},197:()=>{},1866:()=>{},2739:()=>{},5042:e=>{e.exports={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let o="",r=n;for(;r--;)o+=e[Math.random()*e.length|0];return o}}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>Tg,AlignmentToolbar:()=>Mg,Autocomplete:()=>lf,BlockAlignmentControl:()=>es,BlockAlignmentToolbar:()=>ts,BlockBreadcrumb:()=>mf,BlockCanvas:()=>WC,BlockColorsStyleSelector:()=>YC,BlockContextProvider:()=>ff,BlockControls:()=>Bl,BlockEdit:()=>yf,BlockEditorKeyboardShortcuts:()=>D_,BlockEditorProvider:()=>V_,BlockFormatControls:()=>xl,BlockIcon:()=>qh,BlockInspector:()=>XT,BlockList:()=>Xw,BlockMover:()=>bS,BlockNavigationDropdown:()=>Rx,BlockPreview:()=>Ty,BlockSelectionClearer:()=>H_,BlockSettingsMenu:()=>yC,BlockSettingsMenuControls:()=>jh,BlockStyles:()=>Ax,BlockTitle:()=>pf,BlockToolbar:()=>zC,BlockTools:()=>$C,BlockVerticalAlignmentControl:()=>pi,BlockVerticalAlignmentToolbar:()=>mi,ButtonBlockAppender:()=>uw,ButtonBlockerAppender:()=>cw,ColorPalette:()=>aB,ColorPaletteControl:()=>cB,ContrastChecker:()=>pd,CopyHandler:()=>JT,DefaultBlockAppender:()=>sw,FontSizePicker:()=>kg,HeadingLevelDropdown:()=>Fx,HeightControl:()=>Kp,InnerBlocks:()=>Gw,Inserter:()=>lw,InspectorAdvancedControls:()=>xs,InspectorControls:()=>Bs,JustifyContentControl:()=>fi,JustifyToolbar:()=>bi,LineHeightControl:()=>Vd,MediaPlaceholder:()=>cI,MediaReplaceFlow:()=>ec,MediaUpload:()=>Gs,MediaUploadCheck:()=>Us,MultiSelectScrollIntoView:()=>nM,NavigableToolbar:()=>NC,ObserveTyping:()=>Ww,PanelColorSettings:()=>uI,PlainText:()=>YI,RecursionProvider:()=>cM,ReusableBlocksRenameHint:()=>CM,RichText:()=>KI,RichTextShortcut:()=>JI,RichTextToolbarButton:()=>eT,SETTINGS_DEFAULTS:()=>I,SkipToSelectedBlock:()=>bT,ToolSelector:()=>oT,Typewriter:()=>sM,URLInput:()=>ta,URLInputButton:()=>sT,URLPopover:()=>lI,Warning:()=>wf,WritingFlow:()=>sy,__experimentalBlockAlignmentMatrixControl:()=>uf,__experimentalBlockFullHeightAligmentControl:()=>af,__experimentalBlockPatternSetup:()=>nB,__experimentalBlockPatternsList:()=>rE,__experimentalBlockVariationPicker:()=>Gx,__experimentalBlockVariationTransforms:()=>iB,__experimentalBorderRadiusControl:()=>cu,__experimentalColorGradientControl:()=>Xu,__experimentalColorGradientSettingsDropdown:()=>bB,__experimentalDateFormatPicker:()=>pB,__experimentalDuotoneControl:()=>Fm,__experimentalFontAppearanceControl:()=>Dd,__experimentalFontFamilyControl:()=>Nd,__experimentalGetBorderClassesAndStyles:()=>rg,__experimentalGetColorClassesAndStyles:()=>sg,__experimentalGetElementClassName:()=>BM,__experimentalGetGapCSSValue:()=>oi,__experimentalGetGradientClass:()=>Gu,__experimentalGetGradientObjectByGradientValue:()=>$u,__experimentalGetShadowClassesAndStyles:()=>ig,__experimentalGetSpacingClassesAndStyles:()=>cg,__experimentalImageEditor:()=>QB,__experimentalImageSizeControl:()=>tI,__experimentalImageURLInputUI:()=>hT,__experimentalInspectorPopoverHeader:()=>hM,__experimentalLetterSpacingControl:()=>Fd,__experimentalLibrary:()=>tM,__experimentalLinkControl:()=>Xa,__experimentalLinkControlSearchInput:()=>Ra,__experimentalLinkControlSearchItem:()=>ba,__experimentalLinkControlSearchResults:()=>Sa,__experimentalListView:()=>Mx,__experimentalPanelColorGradientSettings:()=>yB,__experimentalPreviewOptions:()=>gT,__experimentalPublishDateTimePicker:()=>gM,__experimentalRecursionProvider:()=>dM,__experimentalResponsiveBlockControl:()=>QI,__experimentalSpacingSizesControl:()=>jp,__experimentalTextDecorationControl:()=>Yd,__experimentalTextTransformControl:()=>Wd,__experimentalUnitControl:()=>rT,__experimentalUseBlockOverlayActive:()=>hf,__experimentalUseBlockPreview:()=>My,__experimentalUseBorderProps:()=>lg,__experimentalUseColorProps:()=>ag,__experimentalUseCustomSides:()=>Bm,__experimentalUseGradient:()=>Wu,__experimentalUseHasRecursion:()=>pM,__experimentalUseMultipleOriginColorsAndGradients:()=>qc,__experimentalUseResizeCanvas:()=>fT,__experimentalWritingModeControl:()=>ep,__unstableBlockNameContext:()=>TC,__unstableBlockSettingsMenuFirstItem:()=>gC,__unstableBlockToolbarLastItem:()=>QS,__unstableEditorStyles:()=>wy,__unstableIframe:()=>py,__unstableInserterMenuExtension:()=>WE,__unstableRichTextInputEvent:()=>tT,__unstableUseBlockSelectionClearer:()=>F_,__unstableUseClipboardHandler:()=>QT,__unstableUseMouseMoveTypingReset:()=>$w,__unstableUseTypewriter:()=>iM,__unstableUseTypingObserver:()=>jw,createCustomColorsHOC:()=>bg,getColorClassName:()=>Zc,getColorObjectByAttributeValues:()=>Wc,getColorObjectByColorValue:()=>Kc,getComputedFluidTypographyValue:()=>Ur,getCustomValueFromPreset:()=>Ql,getFontSize:()=>Ep,getFontSizeClass:()=>Sp,getFontSizeObjectByValue:()=>wp,getGradientSlugByValue:()=>ju,getGradientValueBySlug:()=>Uu,getPxFromCssUnit:()=>IM,getSpacingPresetCssVar:()=>ei,getTypographyClassesAndStyles:()=>ug,isValueSpacingPreset:()=>Xl,privateApis:()=>HR,store:()=>Nr,storeConfig:()=>Rr,transformStyles:()=>yy,useBlockCommands:()=>wM,useBlockDisplayInformation:()=>ih,useBlockEditContext:()=>y,useBlockEditingMode:()=>ns,useBlockProps:()=>y_,useCachedTruthy:()=>dg,useHasRecursion:()=>uM,useInnerBlocksProps:()=>Hw,useSetting:()=>Or,useSettings:()=>Ar,withColorContext:()=>sB,withColors:()=>vg,withFontSizes:()=>Eg});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>dn,__experimentalGetAllowedBlocks:()=>Ht,__experimentalGetAllowedPatterns:()=>Wt,__experimentalGetBlockListSettingsForBlocks:()=>Jt,__experimentalGetDirectInsertBlock:()=>Ut,__experimentalGetGlobalBlocksByName:()=>ye,__experimentalGetLastBlockAttributeChanges:()=>nn,__experimentalGetParsedPattern:()=>$t,__experimentalGetPatternTransformItems:()=>qt,__experimentalGetPatternsByBlockTypes:()=>Zt,__experimentalGetReusableBlockTitle:()=>en,__unstableGetBlockWithoutInnerBlocks:()=>me,__unstableGetClientIdWithClientIdsTree:()=>ge,__unstableGetClientIdsTree:()=>fe,__unstableGetContentLockingParent:()=>gn,__unstableGetEditorMode:()=>ln,__unstableGetSelectedBlocksWithPartialSelection:()=>nt,__unstableGetTemporarilyEditingAsBlocks:()=>fn,__unstableGetTemporarilyEditingFocusModeToRevert:()=>bn,__unstableGetVisibleBlocks:()=>hn,__unstableHasActiveBlockOverlayActive:()=>vn,__unstableIsFullySelected:()=>Qe,__unstableIsLastBlockChangeIgnored:()=>tn,__unstableIsSelectionCollapsed:()=>Je,__unstableIsSelectionMergeable:()=>tt,__unstableIsWithinBlockOverlay:()=>kn,__unstableSelectionHasUnmergeableBlock:()=>et,areInnerBlocksControlled:()=>un,canEditBlock:()=>Pt,canInsertBlockType:()=>Ct,canInsertBlocks:()=>xt,canLockBlockType:()=>Rt,canMoveBlock:()=>Tt,canMoveBlocks:()=>Mt,canRemoveBlock:()=>Bt,canRemoveBlocks:()=>It,didAutomaticChange:()=>an,getAdjacentBlockClientId:()=>ze,getAllowedBlocks:()=>Ft,getBlock:()=>pe,getBlockAttributes:()=>de,getBlockCount:()=>Se,getBlockEditingMode:()=>_n,getBlockHierarchyRootClientId:()=>Oe,getBlockIndex:()=>rt,getBlockInsertionPoint:()=>kt,getBlockListSettings:()=>Yt,getBlockMode:()=>pt,getBlockName:()=>ce,getBlockNamesByClientId:()=>we,getBlockOrder:()=>ot,getBlockParents:()=>Le,getBlockParentsByBlockName:()=>Ae,getBlockRootClientId:()=>Ne,getBlockSelectionEnd:()=>Ie,getBlockSelectionStart:()=>Be,getBlockTransformItems:()=>zt,getBlocks:()=>he,getBlocksByClientId:()=>Ee,getBlocksByName:()=>_e,getClientIdsOfDescendants:()=>be,getClientIdsWithDescendants:()=>ve,getDirectInsertBlock:()=>Gt,getDraggedBlockClientIds:()=>gt,getFirstMultiSelectedBlockClientId:()=>je,getGlobalBlockCount:()=>ke,getInserterItems:()=>Dt,getLastMultiSelectedBlockClientId:()=>We,getLowestCommonAncestorWithSelectedBlock:()=>De,getMultiSelectedBlockClientIds:()=>Ue,getMultiSelectedBlocks:()=>$e,getMultiSelectedBlocksEndClientId:()=>Xe,getMultiSelectedBlocksStartClientId:()=>Ye,getNextBlockClientId:()=>Fe,getPatternsByBlockTypes:()=>Kt,getPreviousBlockClientId:()=>Ve,getSelectedBlock:()=>Re,getSelectedBlockClientId:()=>Pe,getSelectedBlockClientIds:()=>Ge,getSelectedBlockCount:()=>Te,getSelectedBlocksInitialCaretPosition:()=>He,getSelectionEnd:()=>xe,getSelectionStart:()=>Ce,getSettings:()=>Xt,getTemplate:()=>Et,getTemplateLock:()=>wt,hasBlockMovingClientId:()=>sn,hasDraggedInnerBlock:()=>st,hasInserterItems:()=>Vt,hasMultiSelection:()=>ct,hasSelectedBlock:()=>Me,hasSelectedInnerBlock:()=>it,isAncestorBeingDragged:()=>bt,isAncestorMultiSelected:()=>qe,isBlockBeingDragged:()=>ft,isBlockHighlighted:()=>cn,isBlockInsertionPointVisible:()=>_t,isBlockMultiSelected:()=>Ze,isBlockSelected:()=>lt,isBlockValid:()=>ue,isBlockVisible:()=>mn,isBlockWithinSelection:()=>at,isCaretWithinFormattedText:()=>vt,isDraggingBlocks:()=>ht,isFirstMultiSelectedBlock:()=>Ke,isGroupable:()=>En,isLastBlockChangePersistent:()=>Qt,isMultiSelecting:()=>ut,isNavigationMode:()=>rn,isSelectionEnabled:()=>dt,isTyping:()=>mt,isUngroupable:()=>yn,isValidTemplate:()=>yt,wasBlockJustInserted:()=>pn});var t={};n.r(t),n.d(t,{__experimentalUpdateSettings:()=>Cn,clearBlockRemovalPrompt:()=>Mn,deleteStyleOverride:()=>Ln,ensureDefaultBlock:()=>Tn,hideBlockInterface:()=>xn,privateRemoveBlocks:()=>In,setBlockRemovalRules:()=>Pn,setLastFocus:()=>On,setOpenedBlockSettingsMenu:()=>Rn,setStyleOverride:()=>Nn,showBlockInterface:()=>Bn,startDragging:()=>zn,stopDragging:()=>Vn,stopEditingAsBlocks:()=>Dn,syncDerivedUpdates:()=>An});var r={};n.r(r),n.d(r,{getAllPatterns:()=>go,getBlockRemovalRules:()=>ao,getBlockSettings:()=>eo,getBlockWithoutAttributes:()=>oo,getEnabledBlockParents:()=>io,getEnabledClientIdsTree:()=>lo,getInserterMediaCategories:()=>mo,getLastFocus:()=>fo,getLastInsertedBlocksClientIds:()=>no,getOpenedBlockSettingsMenu:()=>co,getRegisteredInserterMediaCategories:()=>po,getRemovalPromptData:()=>so,getStyleOverrides:()=>uo,hasAllowedPatterns:()=>ho,isBlockInterfaceHidden:()=>to,isBlockSubtreeDisabled:()=>ro,isDragging:()=>bo});var l={};n.r(l),n.d(l,{__unstableDeleteSelection:()=>Yo,__unstableExpandSelection:()=>Qo,__unstableMarkAutomaticChange:()=>br,__unstableMarkLastChangeAsPersistent:()=>gr,__unstableMarkNextChangeAsNotPersistent:()=>fr,__unstableSaveReusableBlock:()=>hr,__unstableSetEditorMode:()=>kr,__unstableSetTemporarilyEditingAsBlocks:()=>Ir,__unstableSplitSelection:()=>Xo,clearSelectedBlock:()=>Lo,duplicateBlocks:()=>yr,enterFormattedText:()=>ar,exitFormattedText:()=>cr,flashBlock:()=>Cr,hideInsertionPoint:()=>Ko,insertAfterBlock:()=>wr,insertBeforeBlock:()=>Er,insertBlock:()=>$o,insertBlocks:()=>jo,insertDefaultBlock:()=>dr,mergeBlocks:()=>Jo,moveBlockToPosition:()=>Uo,moveBlocksDown:()=>Fo,moveBlocksToPosition:()=>Go,moveBlocksUp:()=>Ho,multiSelect:()=>No,receiveBlocks:()=>Co,registerInserterMediaCategory:()=>Tr,removeBlock:()=>tr,removeBlocks:()=>er,replaceBlock:()=>zo,replaceBlocks:()=>Do,replaceInnerBlocks:()=>nr,resetBlocks:()=>Eo,resetSelection:()=>So,selectBlock:()=>Io,selectNextBlock:()=>Mo,selectPreviousBlock:()=>To,selectionChange:()=>ur,setBlockEditingMode:()=>Mr,setBlockMovingClientId:()=>_r,setBlockVisibility:()=>Br,setHasControlledInnerBlocks:()=>xr,setNavigationMode:()=>vr,setTemplateValidity:()=>Zo,showInsertionPoint:()=>Wo,startDraggingBlocks:()=>ir,startMultiSelect:()=>Po,startTyping:()=>rr,stopDraggingBlocks:()=>sr,stopMultiSelect:()=>Ro,stopTyping:()=>lr,synchronizeTemplate:()=>qo,toggleBlockHighlight:()=>Sr,toggleBlockMode:()=>or,toggleSelection:()=>Ao,unsetBlockEditingMode:()=>Pr,updateBlock:()=>Bo,updateBlockAttributes:()=>xo,updateBlockListSettings:()=>pr,updateSettings:()=>mr,validateBlocksToTemplate:()=>wo});var i={};n.r(i),n.d(i,{AdvancedPanel:()=>KM,BorderPanel:()=>Bu,ColorPanel:()=>dd,DimensionsPanel:()=>mm,FiltersPanel:()=>Jm,GlobalStylesContext:()=>ol,ImageSettingsPanel:()=>WM,TypographyPanel:()=>gp,areGlobalStyleConfigsEqual:()=>nl,getBlockCSSSelector:()=>$m,getGlobalStylesChanges:()=>tP,getLayoutStyles:()=>LM,useGlobalSetting:()=>sl,useGlobalStyle:()=>al,useGlobalStylesOutput:()=>$M,useGlobalStylesOutputWithConfig:()=>UM,useGlobalStylesReset:()=>il,useHasBorderPanel:()=>vu,useHasBorderPanelControls:()=>ku,useHasColorPanel:()=>Qu,useHasDimensionsPanel:()=>em,useHasFiltersPanel:()=>Km,useHasImageSettingsPanel:()=>jM,useHasTypographyPanel:()=>op,useSettingsForBlockElement:()=>cl});var s=n(1609),a=n.n(s);const c=window.wp.blocks,u=window.wp.element,d=window.wp.data,p=window.wp.compose,m=window.wp.hooks,h=Symbol("mayDisplayControls"),g=Symbol("mayDisplayParentControls"),f=Symbol("blockEditingMode"),b=Symbol("blockBindings"),v={name:"",isSelected:!1},k=(0,u.createContext)(v),{Provider:_}=k;function y(){return(0,u.useContext)(k)}const E=window.wp.deprecated;var w=n.n(E),S=n(7734),C=n.n(S);const x=window.wp.i18n,B={insertUsage:{}},I={alignWide:!1,supportsLayout:!0,colors:[{name:(0,x.__)("Black"),slug:"black",color:"#000000"},{name:(0,x.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,x.__)("White"),slug:"white",color:"#ffffff"},{name:(0,x.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,x.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,x.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,x.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,x.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,x.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,x.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,x.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,x.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,x._x)("Small","font size name"),size:13,slug:"small"},{name:(0,x._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,x._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,x._x)("Large","font size name"),size:36,slug:"large"},{name:(0,x._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,x.__)("Thumbnail")},{slug:"medium",name:(0,x.__)("Medium")},{slug:"large",name:(0,x.__)("Large")},{slug:"full",name:(0,x.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,x.__)("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,x.__)("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,x.__)("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,x.__)("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,x.__)("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,x.__)("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,x.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,x.__)("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,x.__)("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,x.__)("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,x.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,x.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function T(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function M(e,t,n,o=1){const r=[...e];return r.splice(t,o),T(r,e.slice(t,t+o),n)}const P=e=>e;function R(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),R(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function N(e,t=""){const n=[],o=[[t,e]];for(;o.length;){const[e,t]=o.shift();t.forEach((({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&o.push([r.clientId,t])}))}return n}function L(e,t=P){const n=[],o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n.push([r.clientId,t(r)])}return n}function A(e){return L(e,(e=>{const{attributes:t,...n}=e;return n}))}function O(e){return L(e,(e=>e.attributes))}function D(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&C()(e.clientIds,t.clientIds)&&function(e,t){return C()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function z(e,t){const n=e.tree,o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function V(e,t,n=!1){const o=e.tree,r=new Set([]),l=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){l.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)o.set(e,{...o.get(e)});for(const t of r)o.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>o.get(e)));for(const t of l)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const F=(0,p.pipe)(d.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,r)=>{const{name:l}=t.byClientId.get(r);"core/block"===l&&n.ref===e&&t.attributes.set(r,{...n,ref:o})}))}return e(t,n)}),(e=>(t={},n)=>{const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":o.tree=new Map(o.tree),z(o,n.blocks),V(o,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":o.tree=new Map(o.tree),o.tree.set(n.clientId,{...o.tree.get(n.clientId),...o.byClientId.get(n.clientId),attributes:o.attributes.get(n.clientId)}),V(o,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":o.tree=new Map(o.tree),n.clientIds.forEach((e=>{o.tree.set(e,{...o.tree.get(e),attributes:o.attributes.get(e)})})),V(o,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...o}=n.shift();n.push(...e),t[o.clientId]=!0}return t}(n.blocks);o.tree=new Map(o.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),z(o,n.blocks),V(o,n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!o.byClientId.get(t.parents.get(e))||r.push(t.parents.get(e));V(o,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents.get(r)||""!==t.parents.get(r)&&!o.byClientId.get(t.parents.get(r))||e.push(t.parents.get(r));o.tree=new Map(o.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{o.tree.delete(e)})),V(o,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=new Map(o.tree),V(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),V(o,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];o.attributes.forEach(((t,r)=>{"core/block"===o.byClientId.get(r).name&&t.ref===n.updatedId&&e.push(r)})),o.tree=new Map(o.tree),e.forEach((e=>{o.tree.set(e,{...o.byClientId.get(e),attributes:o.attributes.get(e),innerBlocks:o.tree.get(e).innerBlocks})})),V(o,e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order.get(o[r])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order.get(o[r])));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order.get(n.rootClientId)}));let l=r;if(n.blocks.length){l=e(l,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(l.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),l.order=r,l.tree=new Map(l.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&l.tree.set(n,t.tree.get(n))}))}return l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(A(n.blocks)),attributes:new Map(O(n.blocks)),order:R(n.blocks),parents:new Map(N(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),z(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,o=!1;return(r,l)=>{let i,s=e(r,l);var a;"SET_EXPLICIT_PERSISTENT"===l.type&&(n=l.isPersistentChange,i=null===(a=r.isPersistentChange)||void 0===a||a);if(void 0!==n)return i=n,i===s.isPersistentChange?s:{...s,isPersistentChange:i};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===l.type||o;var u;return r!==s||c?(s={...s,isPersistentChange:c?!o:!D(l,t)},t=l,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,s):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===l.type,i=null===(u=r?.isPersistentChange)||void 0===u||u,r.isPersistentChange===i?r:{...s,isPersistentChange:i})}}),(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(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return A(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...o}=t.updates;if(0===Object.values(o).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...o}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),A(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return O(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let o=!1;const r=new Map(e);for(const l of t.clientIds){var n;const i=Object.entries(t.uniqueByBlock?t.attributes[l]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===i.length)continue;let s=!1;const a=e.get(l),c={};i.forEach((([e,t])=>{a[e]!==t&&(s=!0,c[e]=t)})),o=o||s,s&&r.set(l,{...a,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),O(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const o=R(t.blocks),r=new Map(e);return o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(o[""])),r}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e.get(n)||[],r=R(t.blocks,n),{index:l=o.length}=t,i=new Map(e);return r.forEach(((e,t)=>{i.set(t,e)})),i.set(n,T(o,r.get(n),l)),i}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:l}=t,{index:i=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(l[0]),n=new Map(e);return n.set(r,M(e.get(r),t,i,l.length)),n}const s=new Map(e);return s.set(n,null!==(o=e.get(n)?.filter((e=>!l.includes(e))))&&void 0!==o?o:[]),s.set(r,T(e.get(r),l,i)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=e.get(o);if(!l.length||r===l[0])return e;const i=l.indexOf(r),s=new Map(e);return s.set(o,M(l,i,i-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],l=n[n.length-1],i=e.get(o);if(!i.length||l===i[i.length-1])return e;const s=i.indexOf(r),a=new Map(e);return a.set(o,M(i,s,s+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=R(t.blocks),r=new Map(e);return t.replacedClientIds.forEach((e=>{r.delete(e)})),o.forEach(((e,t)=>{""!==t&&r.set(t,e)})),r.forEach(((e,t)=>{const l=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,l)})),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,o)=>{var r;const l=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];l.length!==e.length&&n.set(o,l)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return N(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return N(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:o})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e});function H(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const G=(0,d.combineReducers)({blocks:F,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:o}=t;return{selectionStart:n,selectionEnd:o};case"MULTI_SELECT":const{start:r,end:l}=t;return r===e.selectionStart?.clientId&&l===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:l}};case"RESET_BLOCKS":const i=e?.selectionStart?.clientId,s=e?.selectionEnd?.clientId;if(!i&&!s)return e;if(!t.blocks.some((e=>e.clientId===i)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===s)))return{...e,selectionEnd:e.selectionStart}}const n=H(e.selectionStart,t),o=H(e.selectionEnd,t);return n===e.selectionStart&&o===e.selectionEnd?e:{selectionStart:n,selectionEnd:o}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){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(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...o}=e;return o}return e}return C()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:o,__unstableWithInserter:r,operation:l,nearestSide:i}=t,s={rootClientId:n,index:o,__unstableWithInserter:r,operation:l,nearestSide:i};return C()(e,s)?e:s}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=I,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...I,...t.settings}:{...e,...t.settings}:e},preferences:function(e=B,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let l=r;const i=(0,d.select)(c.store).getActiveBlockVariation(r,o);return i?.name&&(l+="/"+i.name),"core/block"===r&&(l+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1}}}}),e)}return e},lastBlockAttributesChange:function(e=null,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 e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null: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(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),o=t.meta?.source;return{clientIds:n,source:o};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,blockNamesForPrompt:o,messageType:r}=t;return{clientIds:e,selectPrevious:n,blockNamesForPrompt:o,messageType:r};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}});const U=function(e){return(t,n)=>{const o=e(t,n);return t?(o.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...o,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...o,automaticChangeStatus:"final"}:o.blocks===t.blocks&&o.selection===t.selection||"final"!==o.automaticChangeStatus&&o.selection!==t.selection?o:{...o,automaticChangeStatus:void 0}):o}}(G);var $={};function j(e){return[e]}function W(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 K(e,t){var n,o=t||j;function r(){n=new WeakMap}function l(){var t,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(t=function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has($)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set($,l)),s.get($)}(s=o.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!W(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),r=t.head;r;){if(W(r.args,i,1))return r!==t.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=t.head,r.prev=null,t.head.prev=r,t.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return l.getDependants=o,l.clear=r,r(),l}const Z=window.wp.primitives,q=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),Y=window.wp.richText,X=Symbol("selectBlockPatternsKey"),Q=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,J=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Q(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},ee=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[X]?.(e),t.blockPatterns],te=(e,t,n)=>(o,r)=>{let l,i;if("function"==typeof e?(l=e(o),i=e(r)):(l=o[e],i=r[e]),l>i)return"asc"===n?1:-1;if(i>l)return"asc"===n?-1:1;const s=t.findIndex((e=>e===o)),a=t.findIndex((e=>e===r));return s>a?1:a>s?-1:0};function ne(e,t,n="asc"){return e.concat().sort(te(t,e,n))}const oe="core/block-editor",re=window.wp.privateApis,{lock:le,unlock:ie}=(0,re.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),se=[],ae=new Set;function ce(e,t){const n=e.blocks.byClientId.get(t),o="core/social-link";if("web"!==u.Platform.OS&&n?.name===o){const n=e.blocks.attributes.get(t),{service:r}=null!=n?n:{};return r?`${o}-${r}`:o}return n?n.name:null}function ue(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function de(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function pe(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const me=K(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:de(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function he(e,t){const n=t&&un(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||se}const ge=K(((e,t)=>(w()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:fe(e,t)})),(e=>[e.blocks.order])),fe=K(((e,t="")=>(w()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),ot(e,t).map((t=>ge(e,t))))),(e=>[e.blocks.order])),be=K(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const o of t){const t=e.blocks.order.get(o);t&&n.push(...t)}let o=0;for(;o<n.length;){const t=n[o],r=e.blocks.order.get(t);r&&n.splice(o+1,0,...r),o++}return n}),(e=>[e.blocks.order])),ve=e=>be(e,""),ke=K(((e,t)=>{const n=ve(e);if(!t)return n.length;let o=0;for(const r of n){e.blocks.byClientId.get(r).name===t&&o++}return o}),(e=>[e.blocks.order,e.blocks.byClientId])),_e=K(((e,t)=>{if(!t)return se;const n=Array.isArray(t)?t:[t],o=ve(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:se}),(e=>[e.blocks.order,e.blocks.byClientId]));function ye(e,t){return w()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),_e(e,t)}const Ee=K(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>pe(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),we=K(((e,t)=>Ee(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>Ee(e,t)));function Se(e,t){return ot(e,t).length}function Ce(e){return e.selection.selectionStart}function xe(e){return e.selection.selectionEnd}function Be(e){return e.selection.selectionStart.clientId}function Ie(e){return e.selection.selectionEnd.clientId}function Te(e){const t=Ue(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Pe(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function Re(e){const t=Pe(e);return t?pe(e,t):null}function Ne(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const Le=K(((e,t,n=!1)=>{const o=[];let r=t;for(;r=e.blocks.parents.get(r);)o.push(r);return o.length?n?o:o.reverse():se}),(e=>[e.blocks.parents])),Ae=K(((e,t,n,o=!1)=>{const r=Le(e,t,o),l=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>l(ce(e,t))))}),(e=>[e.blocks.parents]));function Oe(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function De(e,t){const n=Pe(e),o=[...Le(e,t),t],r=[...Le(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 ze(e,t,n=1){if(void 0===t&&(t=Pe(e)),void 0===t&&(t=n<0?je(e):We(e)),!t)return null;const o=Ne(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r.get(o),i=l.indexOf(t)+1*n;return i<0||i===l.length?null:l[i]}function Ve(e,t){return ze(e,t,-1)}function Fe(e,t){return ze(e,t,1)}function He(e){return e.initialPosition}const Ge=K((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return se;if(t.clientId===n.clientId)return[t.clientId];const o=Ne(e,t.clientId);if(null===o)return se;const r=ot(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 Ue(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?se:Ge(e)}const $e=K((e=>{const t=Ue(e);return t.length?t.map((t=>pe(e,t))):se}),(e=>[...Ge.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function je(e){return Ue(e)[0]||null}function We(e){const t=Ue(e);return t[t.length-1]||null}function Ke(e,t){return je(e)===t}function Ze(e,t){return-1!==Ue(e).indexOf(t)}const qe=K(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Ne(e,n),o=Ze(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Qe(e){const t=Ce(e),n=xe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Je(e){const t=Ce(e),n=xe(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function et(e){return Ge(e).some((t=>{const n=ce(e,t);return!(0,c.getBlockType)(n).merge}))}function tt(e,t){const n=Ce(e),o=xe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const r=Ne(e,n.clientId);if(r!==Ne(e,o.clientId))return!1;const l=ot(e,r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const a=t?s.clientId:i.clientId,u=t?i.clientId:s.clientId,d=ce(e,a);if(!(0,c.getBlockType)(d).merge)return!1;const p=pe(e,u);if(p.name===d)return!0;const m=(0,c.switchToBlockType)(p,d);return m&&m.length}const nt=e=>{const t=Ce(e),n=xe(e);if(t.clientId===n.clientId)return se;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return se;const o=Ne(e,t.clientId);if(o!==Ne(e,n.clientId))return se;const r=ot(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId),[s,a]=l>i?[n,t]:[t,n],c=pe(e,s.clientId),u=pe(e,a.clientId),d=c.attributes[s.attributeKey],p=u.attributes[a.attributeKey];let m=(0,Y.create)({html:d}),h=(0,Y.create)({html:p});return m=(0,Y.remove)(m,0,s.offset),h=(0,Y.remove)(h,a.offset,h.text.length),[{...c,attributes:{...c.attributes,[s.attributeKey]:(0,Y.toHTMLString)({value:m})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,Y.toHTMLString)({value:h})}}]};function ot(e,t){return e.blocks.order.get(t||"")||se}function rt(e,t){return ot(e,Ne(e,t)).indexOf(t)}function lt(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function it(e,t,n=!1){return ot(e,t).some((t=>lt(e,t)||Ze(e,t)||n&&it(e,t,n)))}function st(e,t,n=!1){return ot(e,t).some((t=>ft(e,t)||n&&st(e,t,n)))}function at(e,t){if(!t)return!1;const n=Ue(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ct(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function ut(e){return e.isMultiSelecting}function dt(e){return e.isSelectionEnabled}function pt(e,t){return e.blocksMode[t]||"visual"}function mt(e){return e.isTyping}function ht(e){return!!e.draggedBlocks.length}function gt(e){return e.draggedBlocks}function ft(e,t){return e.draggedBlocks.includes(t)}function bt(e,t){if(!ht(e))return!1;return Le(e,t).some((t=>ft(e,t)))}function vt(){return w()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const kt=K((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=Ne(e,l)||void 0,n=rt(e,r.clientId)+1):n=ot(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function _t(e){return null!==e.insertionPoint}function yt(e){return e.template.isValid}function Et(e){return e.settings.template}function wt(e,t){var n,o;return t?null!==(n=Yt(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const St=(e,t,n=null)=>{let o;if(t&&"object"==typeof t?(o=t,t=o.name):o=(0,c.getBlockType)(t),!o)return!1;const{allowedBlockTypes:r}=Xt(e);if(!Q(r,t,!0))return!1;if(!!wt(e,n))return!1;if("disabled"===_n(e,null!=n?n:""))return!1;const l=Yt(e,n);if(n&&void 0===l)return!1;const i=ce(e,n),s=(0,c.getBlockType)(i),a=s?.allowedBlocks;let u=Q(a,t);if(!1!==u){const e=l?.allowedBlocks,n=Q(e,t);null!==n&&(u=n)}const d=o.parent,p=Q(d,i);let h=!0;const g=o.ancestor;if(g){h=[n,...Le(e,n)].some((t=>Q(g,ce(e,t))))}const f=h&&(null===u&&null===p||!0===u||!0===p);return f?(0,m.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,o,n,{getBlock:pe.bind(null,e),getBlockParentsByBlockName:Ae.bind(null,e)}):f},Ct=K(St,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function xt(e,t,n=null){return t.every((t=>Ct(e,ce(e,t),n)))}function Bt(e,t,n=null){const o=de(e,t);return null===o||(void 0!==o.lock?.remove?!o.lock.remove:!wt(e,n)&&"disabled"!==_n(e,n))}function It(e,t,n=null){return t.every((t=>Bt(e,t,n)))}function Tt(e,t,n=null){const o=de(e,t);return null===o||(void 0!==o.lock?.move?!o.lock.move:"all"!==wt(e,n)&&"disabled"!==_n(e,n))}function Mt(e,t,n=null){return t.every((t=>Tt(e,t,n)))}function Pt(e,t){const n=de(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Rt(e,t){return!!(0,c.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Nt(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Lt=(e,t,n)=>!!(0,c.hasBlockSupport)(t,"inserter",!0)&&St(e,t.name,n),At=(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}},Ot=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,c.hasBlockSupport)(n.name,"multiple",!0)||(r=Ee(e,ve(e)).some((({name:e})=>e===n.name)));const{time:l,count:i=0}=Nt(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:At(l,i)};if("transform"===t)return s;const a=(0,c.getBlockVariations)(n.name,"inserter");return{...s,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:a,example:n.example,utility:1}},Dt=K(((e,t=null)=>{const n=St(e,"core/block",t)?on(e).map((t=>{const n=t.wp_pattern_sync_status?q:{src:q,foreground:"var(--wp-block-synced-color)"},o=`core/block/${t.id}`,{time:r,count:l=0}=Nt(e,o)||{},i=At(r,l);return{id:o,name:"core/block",initialAttributes:{ref:t.id},title:t.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:i,content:t.content?.raw,syncStatus:t.wp_pattern_sync_status}})):[],o=Ot(e,{buildScope:"inserter"}),r=(0,c.getBlockTypes)().filter((n=>Lt(e,n,t))).map(o).reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((({isDefault:e})=>e))||t.push(n),o.length){const r=((e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=Nt(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:At(r,l)}})(e,n);t.push(...o.map(r))}return t}),[]),{core:l,noncore:i}=r.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...[...l,...i],...n]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,on(e),(0,c.getBlockTypes)()])),zt=K(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=Ot(e,{buildScope:"transform"}),l=(0,c.getBlockTypes)().filter((t=>Lt(e,t,n))).map(r),i=Object.fromEntries(Object.entries(l).map((([,e])=>[e.name,e]))),s=(0,c.getPossibleBlockTransformations)(o).reduce(((e,t)=>(i[t?.name]&&e.push(i[t.name]),e)),[]);return ne(s,(e=>i[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,c.getBlockTypes)()])),Vt=K(((e,t=null)=>{if((0,c.getBlockTypes)().some((n=>Lt(e,n,t))))return!0;return St(e,"core/block",t)&&on(e).length>0}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,on(e),(0,c.getBlockTypes)()])),Ft=K(((e,t=null)=>{if(!t)return;const n=(0,c.getBlockTypes)().filter((n=>Lt(e,n,t)));return St(e,"core/block",t)&&on(e).length>0&&n.push("core/block"),n}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,on(e),(0,c.getBlockTypes)()])),Ht=K(((e,t=null)=>(w()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Ft(e,t))),((e,t)=>[...Ft.getDependants(e,t)])),Gt=K(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.defaultBlock,o=e.blockListSettings[t]?.directInsert;return n&&o?"function"==typeof o?o(pe(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Ut=K(((e,t=null)=>(w()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Gt(e,t))),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),$t=(0,d.createRegistrySelector)((e=>K(((t,n)=>{const{getAllPatterns:o}=ie(e(oe)),r=o().find((({name:e})=>e===n));return r?{...r,blocks:(0,c.parse)(r.content,{__unstableSkipMigrationLogs:!0})}:null}),ee(e)))),jt=e=>(t,n)=>[...ee(e)(t),t.settings.allowedBlockTypes,t.settings.templateLock,t.blockListSettings[n],t.blocks.byClientId.get(n)],Wt=(0,d.createRegistrySelector)((e=>K(((t,n=null)=>{const{getAllPatterns:o,__experimentalGetParsedPattern:r}=ie(e(oe)),l=o(),{allowedBlockTypes:i}=Xt(t),s=l.filter((({inserter:e=!0})=>!!e)).map((({name:e})=>r(e))),a=s.filter((({blocks:e})=>J(e,i))),c=a.filter((({blocks:e})=>e.every((({name:e})=>Ct(t,e,n)))));return c}),jt(e)))),Kt=(0,d.createRegistrySelector)((e=>K(((t,n,o=null)=>{if(!n)return se;const r=e(oe).__experimentalGetAllowedPatterns(o),l=Array.isArray(n)?n:[n],i=r.filter((e=>e?.blockTypes?.some?.((e=>l.includes(e)))));return 0===i.length?se:i}),((t,n,o)=>jt(e)(t,o))))),Zt=(0,d.createRegistrySelector)((e=>(w()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(oe).getPatternsByBlockTypes))),qt=(0,d.createRegistrySelector)((e=>K(((t,n,o=null)=>{if(!n)return se;if(n.some((({clientId:e,innerBlocks:n})=>n.length||un(t,e))))return se;const r=Array.from(new Set(n.map((({name:e})=>e))));return e(oe).getPatternsByBlockTypes(r,o)}),((t,n,o)=>jt(e)(t,o)))));function Yt(e,t){return e.blockListSettings[t]}function Xt(e){return e.settings}function Qt(e){return e.blocks.isPersistentChange}const Jt=K(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),en=K(((e,t)=>{const n=on(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[on(e)]));function tn(e){return e.blocks.isIgnoredChange}function nn(e){return e.lastBlockAttributesChange}function on(e){var t;return null!==(t=e.settings.__experimentalReusableBlocks)&&void 0!==t?t:se}function rn(e){return"navigation"===e.editorMode}function ln(e){return e.editorMode}function sn(e){return e.hasBlockMovingClientId}function an(e){return!!e.automaticChangeStatus}function cn(e,t){return e.highlightedBlock===t}function un(e,t){return!!e.blocks.controlledInnerBlocks[t]}const dn=K(((e,t)=>{if(!t.length)return null;const n=Pe(e);if(t.includes(ce(e,n)))return n;const o=Ue(e),r=Ae(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function pn(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function mn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const hn=K((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?ae:t}),(e=>[e.blockVisibility])),gn=K(((e,t)=>{let n,o=t;for(;o=e.blocks.parents.get(o);)"core/block"!==ce(e,o)&&"contentOnly"!==wt(e,o)||(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function fn(e){return e.temporarilyEditingAsBlocks}function bn(e){return e.temporarilyEditingFocusModeRevert}function vn(e,t){if("default"!==_n(e,t))return!1;if(!Pt(e,t))return!0;const n=ln(e);if("zoom-out"===n&&t&&!Ne(e,t))return!0;const o=(0,c.hasBlockSupport)(ce(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&un(e,t))&&!lt(e,t)&&!it(e,t,!0)}function kn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(vn(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const _n=(0,d.createRegistrySelector)((e=>(t,n="")=>{const o=t.blockEditingModes.get(n);if(o)return o;if(!n)return"default";const r=Ne(t,n);if("contentOnly"===wt(t,r)){const o=ce(t,n);return e(c.store).__experimentalHasContentRoleAttribute(o)?"contentOnly":"disabled"}const l=_n(t,r);return"contentOnly"===l?"default":l})),yn=(0,d.createRegistrySelector)((e=>(t,n="")=>{const o=n||Pe(t);if(!o)return!1;const{getGroupingBlockName:r}=e(c.store),l=pe(t,o),i=r();return l&&(l.name===i||(0,c.getBlockType)(l.name)?.transforms?.ungroup)&&!!l.innerBlocks.length&&Bt(t,o)})),En=(0,d.createRegistrySelector)((e=>(t,n=se)=>{const{getGroupingBlockName:o}=e(c.store),r=o(),l=n?.length?n:Ge(t),i=l?.length?Ne(t,l[0]):void 0;return Ct(t,r,i)&&l.length&&It(t,l,i)})),wn=new WeakSet,Sn=["inserterMediaCategories","blockInspectorAnimation"];function Cn(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;if(t&&"web"===u.Platform.OS){o={};for(const t in e)Sn.includes(t)||(o[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:o,reset:n}}function xn(){return{type:"HIDE_BLOCK_INTERFACE"}}function Bn(){return{type:"SHOW_BLOCK_INTERFACE"}}const In=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:l})=>{if(!e||!e.length)return;var i;i=e,e=Array.isArray(i)?i:[i];const s=o.getBlockRootClientId(e[0]);if(!o.canRemoveBlocks(e,s))return;const a=!n&&o.getBlockRemovalRules();if(a){const n=new Set,l=[...e];let i="templates";for(;l.length;){const e=l.shift(),t=o.getBlockName(e);if(a[t]&&n.add(t),a["bindings/core/pattern-overrides"]){const r=o.getBlockParentsByBlockName(e,"core/block");if(r?.length>0)continue;const l=o.getBlockAttributes(e);l?.metadata?.bindings&&JSON.stringify(l.metadata.bindings).includes("core/pattern-overrides")&&(n.add(t),i="patternOverrides")}const r=o.getBlockOrder(e);l.push(...r)}if(n.size)return void r(function(e,t,n,o){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,blockNamesForPrompt:n,messageType:o}}(e,t,Array.from(n),i))}t&&r.selectPreviousBlock(e[0],t),l.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(Tn())}))},Tn=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Mn(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Pn(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Rn(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Nn(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Ln(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function An(e){return({dispatch:t,select:n,registry:o})=>{o.batch((()=>{t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:!1}),e(),t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:void 0});const o=n.getBlocks();wn.add(o)}))}}function On(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Dn(e){return({select:t,dispatch:n})=>{const o=t.__unstableGetTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:o}),n.__unstableSetTemporarilyEditingAsBlocks()}}function zn(){return{type:"START_DRAGGING"}}function Vn(){return{type:"STOP_DRAGGING"}}const Fn={user:"user",theme:"theme",directory:"directory"},Hn={full:"fully",unsynced:"unsynced"},Gn={name:"allPatterns",label:(0,x._x)("All","patterns")},Un={name:"myPatterns",label:(0,x.__)("My patterns")};function $n(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Fn.theme||!o&&!r)||(!(t!==Fn.directory||!o&&r)||(t===Fn.user&&e.type!==Fn.user||(n===Hn.full&&""!==e.syncStatus||!(n!==Hn.unsynced||"unsynced"===e.syncStatus||!o))))}function jn(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const o=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[o]=n,e}const Wn=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let l=e;return r.forEach((e=>{l=l?.[e]})),null!==(o=l)&&void 0!==o?o:n},Kn=["color","border","dimensions","typography","spacing"],Zn={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},qn={"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"},Yn=e=>qn[e]||e;const Xn=new WeakMap;function Qn(e){var t,n;return null!==(t=null!==(n=e.custom)&&void 0!==n?n:e.theme)&&void 0!==t?t:e.default}function Jn(e){return["default","theme","custom"].some((t=>e?.[t]?.length))}function eo(e,t,...n){const o=ce(e,t),r=[];if(t){let n=t;do{const t=ce(e,n);(0,c.hasBlockSupport)(t,"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(Kn.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l=(0,m.applyFilters)("blockEditor.useSetting.before",void 0,n,t,o);if(void 0!==l)return l;const i=Yn(n);for(const t of r){var s;const n=de(e,t);if(l=null!==(s=Wn(n.settings?.blocks?.[o],i))&&void 0!==s?s:Wn(n.settings,i),void 0!==l)break}const a=Xt(e);if(void 0===l&&o&&(l=Wn(a.__experimentalFeatures?.blocks?.[o],i)),void 0===l&&(l=Wn(a.__experimentalFeatures,i)),void 0!==l)return c.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[i]?Qn(l):l;const u=Zn[i]?.(a);return void 0!==u?u:"typography.dropCap"===i||void 0}))}function to(e){return e.isBlockInterfaceHidden}function no(e){return e?.lastBlockInserted?.clientIds}function oo(e,t){return e.blocks.byClientId.get(t)}const ro=(e,t)=>{const n=t=>"disabled"===_n(e,t)&&ot(e,t).every(n);return ot(e,t).every(n)};const lo=K((function e(t,n){const o=ot(t,n),r=[];for(const n of o){const o=e(t,n);"disabled"!==_n(t,n)?r.push({clientId:n,innerBlocks:o}):r.push(...o)}return r}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),io=K(((e,t,n=!1)=>Le(e,t,n).filter((t=>"disabled"!==_n(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function so(e){return e.removalPromptData}function ao(e){return e.blockRemovalRules}function co(e){return e.openedBlockSettingsMenu}function uo(e){return e.styleOverrides}function po(e){return e.registeredInserterMediaCategories}const mo=K((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const l=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!l.includes(e)))].filter((e=>!(!o&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),ho=(0,d.createRegistrySelector)((e=>K(((t,n=null)=>{const{getAllPatterns:o,__experimentalGetParsedPattern:r}=ie(e(oe)),l=o(),{allowedBlockTypes:i}=Xt(t);return l.some((({name:e,inserter:o=!0})=>{if(!o)return!1;const{blocks:l}=r(e);return J(l,i)&&l.every((({name:e})=>Ct(t,e,n)))}))}),((t,n)=>[ee(e)(t),t.settings.allowedBlockTypes,t.settings.templateLock,t.blockListSettings[n],t.blocks.byClientId.get(n)])))),go=(0,d.createRegistrySelector)((e=>K((t=>{var n;const{__experimentalBlockPatterns:o=[],__experimentalUserPatternCategories:r=[],__experimentalReusableBlocks:l=[]}=t.settings,i=(null!=l?l:[]).map((e=>({name:`core/block/${e.id}`,id:e.id,type:Fn.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>{const t=(null!=r?r:[]).find((({id:t})=>t===e));return t?t.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status})));return[...i,...o,...null!==(n=t.settings[X]?.(e))&&void 0!==n?n:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),ee(e))));function fo(e){return e.lastFocus}function bo(e){return e.isDragging}const vo=window.wp.a11y,ko="";function _o(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof Y.RichTextData)&&-1!==n.toString().indexOf(ko)}))}const yo=e=>Array.isArray(e)?e:[e],Eo=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(wo(e))},wo=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),l=!o||"all"!==r||(0,c.doBlocksMatchTemplate)(e,o);if(l!==t.isValidTemplate())return n.setTemplateValidity(l),l};function So(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Co(e){return w()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function xo(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:yo(e),attributes:t,uniqueByBlock:n}}function Bo(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Io(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const To=(e,t=!1)=>({select:n,dispatch:o})=>{const r=n.getPreviousBlockClientId(e);if(r)o.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}},Mo=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function Po(){return{type:"START_MULTI_SELECT"}}function Ro(){return{type:"STOP_MULTI_SELECT"}}const No=(e,t,n=0)=>({select:o,dispatch:r})=>{if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,vo.speak)((0,x.sprintf)((0,x._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function Lo(){return{type:"CLEAR_SELECTED_BLOCK"}}function Ao(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Oo(e,t){var n;const o=null!==(n=t?.__experimentalPreferredStyleVariations?.value)&&void 0!==n?n:{};return e.map((e=>{const t=e.name;if(!(0,c.hasBlockSupport)(t,"defaultStylePicker",!0))return e;if(!o[t])return e;const n=e.attributes?.className;if(n?.includes("is-style-"))return e;const{attributes:r={}}=e,l=o[t];return{...e,attributes:{...r,className:`${n||""} is-style-${l}`.trim()}}}))}const Do=(e,t,n,o=0,r)=>({select:l,dispatch:i,registry:s})=>{e=yo(e),t=Oo(yo(t),l.getSettings());const a=l.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!l.canInsertBlockType(n.name,a))return}s.batch((()=>{i({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),i.ensureDefaultBlock()}))};function zo(e,t){return Do(e,t)}const Vo=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t,n)&&r({type:e,clientIds:yo(t),rootClientId:n})},Fo=Vo("MOVE_BLOCKS_DOWN"),Ho=Vo("MOVE_BLOCKS_UP"),Go=(e,t="",n="",o)=>({select:r,dispatch:l})=>{if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function Uo(e,t="",n="",o){return Go([e],t,n,o)}function $o(e,t,n,o,r){return jo([e],t,n,o,0,r)}const jo=(e,t,n,o=!0,r=0,l)=>({select:i,dispatch:s})=>{null!==r&&"object"==typeof r&&(l=r,r=0,w()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Oo(yo(e),i.getSettings());const a=[];for(const t of e){i.canInsertBlockType(t.name,n)&&a.push(t)}a.length&&s({type:"INSERT_BLOCKS",blocks:a,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})};function Wo(e,t,n={}){const{__unstableWithInserter:o,operation:r,nearestSide:l}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o,operation:r,nearestSide:l}}const Ko=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Zo(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const qo=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,c.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},Yo=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),l=n.getSelectionEnd();if(r.clientId===l.clientId)return;if(!r.attributeKey||!l.attributeKey||void 0===r.offset||void 0===l.offset)return!1;const i=n.getBlockRootClientId(r.clientId);if(i!==n.getBlockRootClientId(l.clientId))return;const s=n.getBlockOrder(i);let a,u;s.indexOf(r.clientId)>s.indexOf(l.clientId)?(a=l,u=r):(a=r,u=l);const d=e?u:a,p=n.getBlock(d.clientId),m=(0,c.getBlockType)(p.name);if(!m.merge)return;const h=a,g=u,f=n.getBlock(h.clientId),b=n.getBlock(g.clientId),v=f.attributes[h.attributeKey],k=b.attributes[g.attributeKey];let _=(0,Y.create)({html:v}),y=(0,Y.create)({html:k});_=(0,Y.remove)(_,h.offset,_.text.length),y=(0,Y.insert)(y,ko,0,g.offset);const E=(0,c.cloneBlock)(f,{[h.attributeKey]:(0,Y.toHTMLString)({value:_})}),w=(0,c.cloneBlock)(b,{[g.attributeKey]:(0,Y.toHTMLString)({value:y})}),S=e?E:w,C=f.name===b.name?[S]:(0,c.switchToBlockType)(S,m.name);if(!C||!C.length)return;let x;if(e){const e=C.pop();x=m.merge(e.attributes,w.attributes)}else{const e=C.shift();x=m.merge(E.attributes,e.attributes)}const B=_o(x),I=x[B],T=(0,Y.create)({html:I}),M=T.text.indexOf(ko),P=(0,Y.remove)(T,M,M+1),R=(0,Y.toHTMLString)({value:P});x[B]=R;const N=n.getSelectedBlockClientIds(),L=[...e?C:[],{...p,attributes:{...p.attributes,...x}},...e?[]:C];t.batch((()=>{o.selectionChange(p.clientId,B,M,M),o.replaceBlocks(N,L,0,n.getSelectedBlocksInitialCaretPosition())}))},Xo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();if(n.clientId===o.clientId)return;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return;const r=e.getBlockRootClientId(n.clientId);if(r!==e.getBlockRootClientId(o.clientId))return;const l=e.getBlockOrder(r);let i,s;l.indexOf(n.clientId)>l.indexOf(o.clientId)?(i=o,s=n):(i=n,s=o);const a=i,c=s,u=e.getBlock(a.clientId),d=e.getBlock(c.clientId),p=u.attributes[a.attributeKey],m=d.attributes[c.attributeKey];let h=(0,Y.create)({html:p}),g=(0,Y.create)({html:m});h=(0,Y.remove)(h,a.offset,h.text.length),g=(0,Y.remove)(g,0,c.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,Y.toHTMLString)({value:h})}},{...d,attributes:{...d.attributes,[c.attributeKey]:(0,Y.toHTMLString)({value:g})}}])},Qo=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},Jo=(e,t)=>({registry:n,select:o,dispatch:r})=>{const l=[e,t];r({type:"MERGE_BLOCKS",blocks:l});const[i,s]=l,a=o.getBlock(i),u=(0,c.getBlockType)(a.name);if(!u)return;const d=o.getBlock(s);if(!u.merge&&(0,c.getBlockSupport)(a.name,"__experimentalOnMerge")){const e=(0,c.switchToBlockType)(d,u.name);if(1!==e?.length)return void r.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(a.clientId):void n.batch((()=>{r.insertBlocks(t.innerBlocks,void 0,i),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(i);if(e&&o.getBlockName(i)===o.getBlockName(e)){const t=o.getBlockAttributes(i),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,i),r.removeBlock(e,!1))}}))}if((0,c.isUnmodifiedDefaultBlock)(a))return void r.removeBlock(i,o.isBlockSelected(i));if((0,c.isUnmodifiedDefaultBlock)(d))return void r.removeBlock(s,o.isBlockSelected(s));if(!u.merge)return void r.selectBlock(a.clientId);const p=(0,c.getBlockType)(d.name),{clientId:m,attributeKey:h,offset:g}=o.getSelectionStart(),f=(m===i?u:p).attributes[h],b=(m===i||m===s)&&void 0!==h&&void 0!==g&&!!f;f||("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 v=(0,c.cloneBlock)(a),k=(0,c.cloneBlock)(d);if(b){const e=m===i?v:k,t=e.attributes[h],n=(0,Y.insert)((0,Y.create)({html:t}),ko,g,g);e.attributes[h]=(0,Y.toHTMLString)({value:n})}const _=a.name===d.name?[k]:(0,c.switchToBlockType)(k,a.name);if(!_||!_.length)return;const y=u.merge(v.attributes,_[0].attributes);if(b){const e=_o(y),t=y[e],n=(0,Y.create)({html:t}),o=n.text.indexOf(ko),l=(0,Y.remove)(n,o,o+1),i=(0,Y.toHTMLString)({value:l});y[e]=i,r.selectionChange(a.clientId,e,o,o)}r.replaceBlocks([a.clientId,d.clientId],[{...a,attributes:{...a.attributes,...y}},..._.slice(1)],0)},er=(e,t=!0)=>In(e,t);function tr(e,t){return er([e],t)}function nr(e,t,n=!1,o=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function or(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function rr(){return{type:"START_TYPING"}}function lr(){return{type:"STOP_TYPING"}}function ir(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function sr(){return{type:"STOP_DRAGGING_BLOCKS"}}function ar(){return w()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function cr(){return w()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function ur(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const dr=(e,t,n)=>({dispatch:o})=>{const r=(0,c.getDefaultBlockName)();if(!r)return;const l=(0,c.createBlock)(r,e);return o.insertBlock(l,n,t)};function pr(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function mr(e){return Cn(e,{stripExperimentalSettings:!0})}function hr(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function gr(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function fr(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const br=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},vr=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},kr=e=>({dispatch:t,select:n})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart();e&&t.selectBlock(n.getBlockHierarchyRootClientId(e))}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,vo.speak)((0,x.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,vo.speak)((0,x.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,vo.speak)((0,x.__)("You are currently in zoom-out mode."))},_r=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,vo.speak)((0,x.__)("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."))},yr=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const l=r.map((e=>e.name));if(l.some((e=>!(0,c.hasBlockSupport)(e,"multiple",!0))))return;const i=n.getBlockRootClientId(e[0]),s=yo(e),a=n.getBlockIndex(s[s.length-1]),u=r.map((e=>(0,c.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,a+1,i,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Er=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),l=o?t.getDirectInsertBlock(o):null;if(!l)return n.insertDefaultBlock({},o,r);const i={};if(l.attributesToCopy){const n=t.getBlockAttributes(e);l.attributesToCopy.forEach((e=>{n[e]&&(i[e]=n[e])}))}const s=(0,c.createBlock)(l.name,{...l.attributes,...i});return n.insertBlock(s,r,o)},wr=e=>({select:t,dispatch:n})=>{if(!e)return;const o=t.getBlockRootClientId(e);if(t.getTemplateLock(o))return;const r=t.getBlockIndex(e),l=o?t.getDirectInsertBlock(o):null;if(!l)return n.insertDefaultBlock({},o,r+1);const i={};if(l.attributesToCopy){const n=t.getBlockAttributes(e);l.attributesToCopy.forEach((e=>{n[e]&&(i[e]=n[e])}))}const s=(0,c.createBlock)(l.name,{...l.attributes,...i});return n.insertBlock(s,r+1,o)};function Sr(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Cr=e=>async({dispatch:t})=>{t(Sr(e,!0)),await new Promise((e=>setTimeout(e,150))),t(Sr(e,!1))};function xr(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Br(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Ir(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const Tr=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");const o=t.getRegisteredInserterMediaCategories();o.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):o.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function Mr(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Pr(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const Rr={reducer:U,selectors:e,actions:l},Nr=(0,d.createReduxStore)(oe,{...Rr,persist:["preferences"]}),Lr=(0,d.registerStore)(oe,{...Rr,persist:["preferences"]});function Ar(...e){const{clientId:t=null}=y();return(0,d.useSelect)((n=>ie(n(Nr)).getBlockSettings(t,...e)),[t,...e])}function Or(e){w()("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});const[t]=Ar(e);return t}ie(Lr).registerPrivateActions(t),ie(Lr).registerPrivateSelectors(r),ie(Nr).registerPrivateActions(t),ie(Nr).registerPrivateSelectors(r);const Dr="1600px",zr="320px",Vr=1,Fr=.25,Hr=.75,Gr="14px";function Ur({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=zr,maximumViewportWidth:r=Dr,scaleFactor:l=Vr,minimumFontSizeLimit:i}){if(i=$r(i)?i:Gr,n){const o=$r(n);if(!o?.unit)return null;const r=$r(i,{coerceTo:o.unit});if(r?.value&&!e&&!t&&o?.value<=r?.value)return null;if(t||(t=`${o.value}${o.unit}`),!e){const t="px"===o.unit?o.value:16*o.value,n=Math.min(Math.max(1-.075*Math.log2(t),Fr),Hr),l=jr(o.value*n,3);e=r?.value&&l<r?.value?`${r.value}${r.unit}`:`${l}${o.unit}`}}const s=$r(e),a=s?.unit||"rem",c=$r(t,{coerceTo:a});if(!s||!c)return null;const u=$r(e,{coerceTo:"rem"}),d=$r(r,{coerceTo:a}),p=$r(o,{coerceTo:a});if(!d||!p||!u)return null;const m=d.value-p.value;if(!m)return null;const h=jr(p.value/100,3),g=jr(h,3)+a,f=jr(((c.value-s.value)/m*100||1)*l,3);return`clamp(${e}, ${`${u.value}${u.unit} + ((1vw - ${g}) * ${f})`}, ${t})`}function $r(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:o,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},l=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${l}){1,1}$`),s=e.match(i);if(!s||s.length<3)return null;let[,a,c]=s,u=parseFloat(a);return"px"!==n||"em"!==c&&"rem"!==c||(u*=o,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=o,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:jr(u,3),unit:c}}function jr(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Wr(e,t){const{size:n}=e;if(!Kr(t))return n;if(!n||"0"===n||!1===e?.fluid)return n;const o="object"==typeof t?.fluid?t?.fluid:{},r=Ur({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth});return r||n}function Kr(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function Zr(e){const t=e?.typography,n=e?.layout,o=$r(n?.wideSize)?n?.wideSize:null;return Kr(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}const qr="body",Yr=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>Wr(e,Zr(t)),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]}],Xr={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"},Qr={popoverProps:{placement:"left-start",offset:259}};function Jr(e,t,n,o,r){const l=[Wn(e,["blocks",t,...n]),Wn(e,n)];for(const i of l)if(i){const l=["custom","theme","default"];for(const s of l){const l=i[s];if(l){const i=l.find((e=>e[o]===r));if(i){if("slug"===o)return i;return Jr(e,t,n,"slug",i.slug)[o]===i[o]?i:void 0}}}}}function el(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=Wn(e,t))||n?.ref)return n}}const o="var:",r="var(--wp--";let l;if(n.startsWith(o))l=n.slice(4).split("|");else{if(!n.startsWith(r)||!n.endsWith(")"))return n;l=n.slice(10,-1).split("--")}const[i,...s]=l;return"preset"===i?function(e,t,n,[o,r]){const l=Yr.find((e=>e.cssVarInfix===o));if(!l)return n;const i=Jr(e.settings,t,l.path,"slug",r);if(i){const{valueKey:n}=l;return el(e,t,i[n])}return n}(e,t,n,s):"custom"===i?function(e,t,n,o){var r;const l=null!==(r=Wn(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:Wn(e.settings,["custom",...o]);return l?el(e,t,l):n}(e,t,n,s):n}function tl(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(", ")}function nl(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:C()(e?.styles,t?.styles)&&C()(e?.settings,t?.settings)}const ol=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),rl={settings:{},styles:{}},ll=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],il=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(ol);return[!!e&&!C()(e,rl),(0,u.useCallback)((()=>t((()=>rl))),[t])]};function sl(e,t,n="all"){const{setUserConfig:o,...r}=(0,u.useContext)(ol),l=t?".blocks."+t:"",i=e?"."+e:"",s=`settings${l}${i}`,a=`settings${i}`,c="all"===n?"merged":n;return[(0,u.useMemo)((()=>{const t=r[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=Wn(t,s))&&void 0!==n?n:Wn(t,a);let o={};return ll.forEach((e=>{var n;const r=null!==(n=Wn(t,`settings${l}.${e}`))&&void 0!==n?n:Wn(t,`settings.${e}`);void 0!==r&&(o=jn(o,e.split("."),r))})),o}),[r,c,e,s,a,l]),e=>{o((t=>jn(t,s.split("."),e)))}]}function al(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:l,user:i,setUserConfig:s}=(0,u.useContext)(ol),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let d,p;switch(n){case"all":d=Wn(r,c),p=o?el(r,t,d):d;break;case"user":d=Wn(i,c),p=o?el(r,t,d):d;break;case"base":d=Wn(l,c),p=o?el(l,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{s((l=>jn(l,c.split("."),o?function(e,t,n,o){if(!o)return o;const r=Xr[n],l=Yr.find((e=>e.cssVarInfix===r));if(!l)return o;const{valueKey:i,path:s}=l,a=Jr(e,t,s,i,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n)))}]}function cl(e,t,n){const{supportedStyles:o,supports:r}=(0,d.useSelect)((e=>({supportedStyles:ie(e(c.store)).getSupportedStyles(t,n),supports:e(c.store).getBlockType(t)?.supports})),[t,n]);return(0,u.useMemo)((()=>{const t={...e};return o.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),o.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&o.includes("color"),background:t.color?.background&&(o.includes("background")||o.includes("backgroundColor")),button:t.color?.button&&o.includes("buttonColor"),heading:t.color?.heading&&o.includes("headingColor"),link:t.color?.link&&o.includes("linkColor"),caption:t.color?.caption&&o.includes("captionColor")},o.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),o.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{o.includes(e)||(t.typography={...t.typography,[e]:!1})})),o.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{o.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{o.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{o.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{o.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!o.includes("shadow")&&t.shadow,t}),[e,o,r])}function ul(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,o=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,x._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,x._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,x._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function dl(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,o=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,x._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,x._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,x._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}var pl=n(5755),ml=n.n(pl);const hl=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,hl(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function gl(e,t,n,o,r,l){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let i=o[0]?.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;i=o[r]?.attributes}let s=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=Wn(i,e);t&&(s={...s,attributes:jn(s.attributes,e,t)})}))})),s}function fl(e,t,n){const o=(0,c.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function bl({id:e,css:t,assets:n,__unstableType:o}={}){const{setStyleOverride:r,deleteStyleOverride:l}=ie((0,d.useDispatch)(Nr)),i=(0,u.useId)();(0,u.useEffect)((()=>{if(!t&&!n)return;const s=e||i;return r(s,{id:e,css:t,assets:n,__unstableType:o}),()=>{l(s)}}),[e,t,n,o,i,r,l])}function vl(e,t){const[n,o,r,l,i,s,a,c,d,p,m,h,g,f,b,v,k,_,y,E,w,S,C,x,B,I,T,M,P,R,N,L,A,O,D,z,V,F,H,G,U,$,j,W,K,Z,q,Y,X,Q]=Ar("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.spacingSizes","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return cl((0,u.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:N,theme:A,default:O},gradients:{custom:G,theme:U,default:$},duotone:{custom:V,theme:F,default:H},defaultGradients:j,defaultPalette:D,defaultDuotone:z,custom:R,customGradient:W,customDuotone:L,background:K,link:Z,heading:Y,button:X,text:q},typography:{fontFamilies:{custom:r,default:l,theme:i},fontSizes:{custom:s,default:a,theme:c},customFontSize:d,fontStyle:p,fontWeight:m,lineHeight:h,textColumns:g,textDecoration:f,textTransform:v,letterSpacing:k,writingMode:b},spacing:{spacingSizes:{custom:w},padding:_,margin:y,blockGap:E,units:S},border:{color:I,radius:T,style:M,width:P},dimensions:{aspectRatio:C,minHeight:x},layout:B,parentLayout:t,shadow:Q})),[n,o,r,l,i,s,a,c,d,p,m,h,g,f,v,k,b,_,y,E,w,S,C,x,B,t,I,T,M,P,R,N,L,A,O,D,z,V,F,H,G,U,$,j,W,K,Z,q,Y,X,Q]),e)}const kl=(0,u.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),l=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,u.useEffect)((()=>(l(r),()=>{l(void 0)}))),null}));(0,m.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,c.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const _l=window.wp.components,yl={default:(0,_l.createSlotFill)("BlockControls"),block:(0,_l.createSlotFill)("BlockControlsBlock"),inline:(0,_l.createSlotFill)("BlockFormatControls"),other:(0,_l.createSlotFill)("BlockControlsOther"),parent:(0,_l.createSlotFill)("BlockControlsParent")};function El({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=y();return n[h]?yl[e]?.Fill:n[g]&&t?yl.parent.Fill:null}(e,o);if(!r)return null;const l=(0,s.createElement)(s.Fragment,null,"default"===e&&(0,s.createElement)(_l.ToolbarGroup,{controls:t}),n);return(0,s.createElement)(_l.__experimentalStyleProvider,{document},(0,s.createElement)(r,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,s.createElement)(t,{...n},e)),l)})))}window.wp.warning;const{ComponentsContext:wl}=ie(_l.privateApis);function Sl({group:e="default",...t}){const n=(0,u.useContext)(_l.__experimentalToolbarContext),o=(0,u.useContext)(wl),r=(0,u.useMemo)((()=>({forwardedContext:[[_l.__experimentalToolbarContext.Provider,{value:n}],[wl.Provider,{value:o}]]})),[n,o]),l=yl[e]?.Slot,i=(0,_l.__experimentalUseSlotFills)(l?.__unstableName);if(!l)return null;if(!i?.length)return null;const a=(0,s.createElement)(l,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,s.createElement)(_l.ToolbarGroup,null,a)}const Cl=El;Cl.Slot=Sl;const xl=e=>(0,s.createElement)(El,{group:"inline",...e});xl.Slot=e=>(0,s.createElement)(Sl,{group:"inline",...e});const Bl=Cl,Il=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),Tl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})),Ml=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),Pl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),Rl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})),Nl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),Ll=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})),Al={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child:first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child:last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > *",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};function Ol(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Dl(e,t=Al,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${Ol(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function zl(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},l=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return l.test(t)&&"constrained"===o&&(r.none=(0,x.sprintf)((0,x.__)("Max %s wide"),t)),l.test(n)&&(r.wide=(0,x.sprintf)((0,x.__)("Max %s wide"),n)),r}const Vl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})),Fl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,s.createElement)(Z.Path,{d:"m18 7.5v9h1.5v-9z"})),Hl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,s.createElement)(Z.Path,{d:"m7.5 19.5h9v-1.5h-9z"})),Gl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m16.5 6h-9v-1.5h9z"})),Ul=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m18 16.5v-9h1.5v9z"})),$l=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m16.5 19.5h-9v-1.5h9z",style:{fill:"#1e1e1e"}})),jl=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,s.createElement)(Z.Path,{d:"m4.5 16.5v-9h1.5v9z"})),Wl=["top","right","bottom","left"],Kl={top:void 0,right:void 0,bottom:void 0,left:void 0},Zl={custom:Vl,axial:Vl,horizontal:Fl,vertical:Hl,top:Gl,right:Ul,bottom:$l,left:jl},ql={default:(0,x.__)("Spacing control"),top:(0,x.__)("Top"),bottom:(0,x.__)("Bottom"),left:(0,x.__)("Left"),right:(0,x.__)("Right"),mixed:(0,x.__)("Mixed"),vertical:(0,x.__)("Vertical"),horizontal:(0,x.__)("Horizontal"),axial:(0,x.__)("Horizontal & vertical"),custom:(0,x.__)("Custom")},Yl={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Xl(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function Ql(e,t){if(!Xl(e))return e;const n=ti(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Jl(e,t){if(!e||Xl(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function ei(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function ti(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function ni(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),o=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?o:n||o}function oi(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const o=ei(n?.top)||t,r=ei(n?.left)||t;return o===r?o:`${o} ${r}`}const ri=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(_l.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),li=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(_l.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),ii=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(_l.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),si=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(_l.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),ai=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(_l.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),ci={top:{icon:ii,title:(0,x._x)("Align top","Block vertical alignment setting")},center:{icon:li,title:(0,x._x)("Align middle","Block vertical alignment setting")},bottom:{icon:ri,title:(0,x._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:si,title:(0,x._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:ai,title:(0,x._x)("Space between","Block vertical alignment setting")}},ui=["top","center","bottom"];const di=function({value:e,onChange:t,controls:n=ui,isCollapsed:o=!0,isToolbar:r}){function l(n){return()=>t(e===n?void 0:n)}const i=ci[e],a=ci.top,c=r?_l.ToolbarGroup:_l.ToolbarDropdownMenu,u=r?{isCollapsed:o}:{};return(0,s.createElement)(c,{icon:i?i.icon:a.icon,label:(0,x._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...ci[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:l(t)}))),...u})},pi=e=>(0,s.createElement)(di,{...e,isToolbar:!1}),mi=e=>(0,s.createElement)(di,{...e,isToolbar:!0}),hi={left:Il,center:Tl,right:Ml,"space-between":Pl,stretch:Rl};const gi=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:l}){const i=e=>{n(e===o?void 0:e)},a=o?hi[o]:hi.left,c=[{name:"left",icon:Il,title:(0,x.__)("Justify items left"),isActive:"left"===o,onClick:()=>i("left")},{name:"center",icon:Tl,title:(0,x.__)("Justify items center"),isActive:"center"===o,onClick:()=>i("center")},{name:"right",icon:Ml,title:(0,x.__)("Justify items right"),isActive:"right"===o,onClick:()=>i("right")},{name:"space-between",icon:Pl,title:(0,x.__)("Space between items"),isActive:"space-between"===o,onClick:()=>i("space-between")},{name:"stretch",icon:Rl,title:(0,x.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>i("stretch")}],u=l?_l.ToolbarGroup:_l.ToolbarDropdownMenu,d=l?{isCollapsed:t}:{};return(0,s.createElement)(u,{icon:a,popoverProps:r,label:(0,x.__)("Change items justification"),controls:c.filter((t=>e.includes(t.name))),...d})},fi=e=>(0,s.createElement)(gi,{...e,isToolbar:!1}),bi=e=>(0,s.createElement)(gi,{...e,isToolbar:!0}),vi={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ki={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},_i={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},yi=["wrap","nowrap"],Ei={name:"flex",label:(0,x.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.Flex,null,(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(Ci,{layout:e,onChange:t})),(0,s.createElement)(_l.FlexItem,null,o&&(0,s.createElement)(Bi,{layout:e,onChange:t}))),(0,s.createElement)(xi,{layout:e,onChange:t}))},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=n;return(0,s.createElement)(Bl,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Ci,{layout:e,onChange:t,isToolbar:!0}),o&&(0,s.createElement)(wi,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=Al}){const{orientation:i="horizontal"}=t,s=n?.spacing?.blockGap&&!fl(o,"spacing","blockGap")?oi(n?.spacing?.blockGap,"0.5em"):void 0,a=vi[t.justifyContent],c=yi.includes(t.flexWrap)?t.flexWrap:"wrap",u=_i[t.verticalAlignment],d=ki[t.justifyContent]||ki.left;let p="";const m=[];return c&&"wrap"!==c&&m.push(`flex-wrap: ${c}`),"horizontal"===i?(u&&m.push(`align-items: ${u}`),a&&m.push(`justify-content: ${a}`)):(u&&m.push(`justify-content: ${u}`),m.push("flex-direction: column"),m.push(`align-items: ${d}`)),m.length&&(p=`${Ol(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&s&&(p+=Dl(e,l,"flex",s)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function wi({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?_i.center:_i.top,{verticalAlignment:l=r}=e,i=n=>{t({...e,verticalAlignment:n})};if(n)return(0,s.createElement)(pi,{onChange:i,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,x.__)("Align items top")},{value:"center",label:(0,x.__)("Align items center")},{value:"flex-end",label:(0,x.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,x.__)("Vertical alignment")),(0,s.createElement)("div",null,a.map(((e,t,n)=>(0,s.createElement)(_l.Button,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>i(e)})))))}const Si={placement:"bottom-start"};function Ci({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,l=n=>{t({...e,justifyContent:n})},i=["left","center","right"];if("horizontal"===r?i.push("space-between"):i.push("stretch"),n)return(0,s.createElement)(fi,{allowedControls:i,value:o,onChange:l,popoverProps:Si});const a=[{value:"left",icon:Il,label:(0,x.__)("Justify items left")},{value:"center",icon:Tl,label:(0,x.__)("Justify items center")},{value:"right",icon:Ml,label:(0,x.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:Pl,label:(0,x.__)("Space between items")}):a.push({value:"stretch",icon:Rl,label:(0,x.__)("Stretch items")}),(0,s.createElement)(_l.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((({value:e,icon:t,label:n})=>(0,s.createElement)(_l.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n}))))}function xi({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Bi({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,s.createElement)(_l.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,x.__)("Orientation"),value:n,onChange:n=>{let l=o,i=r;return"horizontal"===n?("space-between"===o&&(l="center"),"stretch"===r&&(i="left")):("stretch"===o&&(l="top"),"space-between"===r&&(i="left")),t({...e,orientation:n,verticalAlignment:l,justifyContent:i})}},(0,s.createElement)(_l.__experimentalToggleGroupControlOptionIcon,{icon:Nl,value:"horizontal",label:(0,x.__)("Horizontal")}),(0,s.createElement)(_l.__experimentalToggleGroupControlOptionIcon,{icon:Ll,value:"vertical",label:(0,x.__)("Vertical")}))}const Ii={name:"default",label:(0,x.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=Al}){const l=oi(t?.spacing?.blockGap);let i="";fl(n,"spacing","blockGap")||(l?.top?i=oi(l?.top):"string"==typeof l&&(i=oi(l)));let s="";return o&&i&&(s+=Dl(e,r,"default",i)),s},getOrientation:()=>"vertical",getAlignments(e,t){const n=zl(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const o=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:n.wide})}return o.unshift({name:"none",info:n.none}),o}};const Ti=(0,u.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:o})})),Mi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})),Pi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})),Ri=window.wp.styleEngine,Ni={name:"constrained",label:(0,x.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:l="center"}=e,{allowJustification:i=!0,allowCustomContentAndWideSize:a=!0}=n,c=[{value:"left",icon:Il,label:(0,x.__)("Justify items left")},{value:"center",icon:Tl,label:(0,x.__)("Justify items center")},{value:"right",icon:Ml,label:(0,x.__)("Justify items right")}],[u]=Ar("spacing.units"),d=(0,_l.__experimentalUseCustomUnits)({availableUnits:u||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(_l.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,x.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:d}),(0,s.createElement)(Ti,{icon:Mi})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(_l.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,x.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:d}),(0,s.createElement)(Ti,{icon:Pi}))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,x.__)("Customize the width for all elements that are assigned to the center or wide columns."))),i&&(0,s.createElement)(_l.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Justification"),value:l,onChange:n=>{t({...e,justifyContent:n})}},c.map((({value:e,icon:t,label:n})=>(0,s.createElement)(_l.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n})))))},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=Al}){const{contentSize:i,wideSize:s,justifyContent:a}=t,c=oi(n?.spacing?.blockGap);let u="";fl(o,"spacing","blockGap")||(c?.top?u=oi(c?.top):"string"==typeof c&&(u=oi(c)));const d="left"===a?"0 !important":"auto !important",p="right"===a?"0 !important":"auto !important";let m=i||s?`\n\t\t\t\t\t${Ol(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:s};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${p};\n\t\t\t\t\t}\n\t\t\t\t\t${Ol(e,"> .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${Ol(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";if("left"===a?m+=`${Ol(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(m+=`${Ol(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding){(0,Ri.getCSSRules)(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${Ol(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(m+=`\n\t\t\t\t\t${Ol(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)}))}return r&&u&&(m+=Dl(e,l,"constrained",u)),m},getOrientation:()=>"vertical",getAlignments(e){const t=zl(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}},Li={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},Ai={name:"grid",label:(0,x.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,s.createElement)(Di,{layout:e,onChange:t}):(0,s.createElement)(Oi,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:l=Al}){const{minimumColumnWidth:i="12rem",columnCount:s=null}=t,a=n?.spacing?.blockGap&&!fl(o,"spacing","blockGap")?oi(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return s?u.push(`grid-template-columns: repeat(${s}, minmax(0, 1fr))`):i&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${i}, 100%), 1fr))`),u.length&&(c=`${Ol(e)} { ${u.join("; ")}; }`),r&&a&&(c+=Dl(e,l,"grid",a)),c},getOrientation:()=>"horizontal",getAlignments:()=>[]};function Oi({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,s.createElement)("fieldset",null,(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Minimum column width")),(0,s.createElement)(_l.Flex,{gap:4},(0,s.createElement)(_l.FlexItem,{isBlock:!0},(0,s.createElement)(_l.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let l;["em","rem"].includes(n)&&"px"===r?l=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n?l=Math.round(16*o)+n:["vh","vw","%","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(n)&&o>100&&(l=100+n),t({...e,minimumColumnWidth:l})},value:n,min:0})),(0,s.createElement)(_l.FlexItem,{isBlock:!0},(0,s.createElement)(_l.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:Li[r]||600,withInputField:!1}))))}function Di({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,s.createElement)(_l.RangeControl,{label:(0,x.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const zi=[Ii,Ei,Ni,Ai];function Vi(e="default"){return zi.find((t=>t.name===e))}const Fi={type:"default"},Hi=(0,u.createContext)(Fi),Gi=Hi.Provider;function Ui(){return(0,u.useContext)(Hi)}const $i=[],ji=["none","left","center","right","wide","full"],Wi=["wide","full"];function Ki(e=ji){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,o,r]=(0,d.useSelect)((e=>{var n;if(t)return[!1,!1,!1];const o=e(Nr).getSettings();return[null!==(n=o.alignWide)&&void 0!==n&&n,o.supportsLayout,o.__unstableIsBlockBasedTheme]}),[t]),l=Ui();if(t)return $i;const i=Vi(l?.type);if(o){const t=i.getAlignments(l,r).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?$i:t}if("default"!==i.name&&"constrained"!==i.name)return $i;const s=e.filter((e=>l.alignments?l.alignments.includes(e):!(!n&&Wi.includes(e))&&ji.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?$i:s}const Zi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})),qi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})),Yi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})),Xi=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})),Qi={none:{icon:Zi,title:(0,x._x)("None","Alignment option")},left:{icon:qi,title:(0,x.__)("Align left")},center:{icon:Mi,title:(0,x.__)("Align center")},right:{icon:Yi,title:(0,x.__)("Align right")},wide:{icon:Pi,title:(0,x.__)("Wide width")},full:{icon:Xi,title:(0,x.__)("Full width")}};const Ji=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const l=Ki(n);if(!!!l.length)return null;function i(n){t([e,"none"].includes(n)?void 0:n)}const a=Qi[e],c=Qi.none,u=o?_l.ToolbarGroup:_l.ToolbarDropdownMenu,d={icon:a?a.icon:c.icon,label:(0,x.__)("Align")},p=o?{isCollapsed:r,controls:l.map((({name:t})=>({...Qi[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>i(t)})))}:{toggleProps:{describedBy:(0,x.__)("Change alignment")},children:({onClose:t})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},l.map((({name:n,info:o})=>{const{icon:r,title:l}=Qi[n],a=n===e||!e&&"none"===n;return(0,s.createElement)(_l.MenuItem,{key:n,icon:r,iconPosition:"left",className:ml()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{i(n),t()},role:"menuitemradio",info:o},l)}))))};return(0,s.createElement)(u,{...d,...p})},es=e=>(0,s.createElement)(Ji,{...e,isToolbar:!1}),ts=e=>(0,s.createElement)(Ji,{...e,isToolbar:!0});function ns(e){const t=y(),{clientId:n=""}=t,{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,d.useDispatch)(Nr),l=(0,d.useSelect)((e=>n?null:e(Nr).getBlockEditingMode()),[n]);return(0,u.useEffect)((()=>(e&&o(n,e),()=>{e&&r(n)})),[n,e,o,r]),n?t[f]:l}const os=["left","center","right","wide","full"],rs=["wide","full"];function ls(e,t=!0,n=!0){let o;return o=Array.isArray(e)?os.filter((t=>e.includes(t))):!0===e?[...os]:[],!n||!0===e&&!t?o.filter((e=>!rs.includes(e))):o}const is={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Ki(ls((0,c.getBlockSupport)(e,"align"),(0,c.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),r=ns();return o.length&&"default"===r?(0,s.createElement)(Bl,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(es,{value:t,onChange:t=>{if(!t){const n=(0,c.getBlockType)(e),o=n?.attributes?.align?.default;o&&(t="")}n({align:t})},controls:o})):null},useBlockProps:function({name:e,align:t}){const n=ls((0,c.getBlockSupport)(e,"align"),(0,c.hasBlockSupport)(e,"alignWide",!0));if(Ki(n).some((e=>e.name===t)))return{"data-align":t};return{}},addSaveProps:function(e,t,n){const{align:o}=n,r=(0,c.getBlockSupport)(t,"align"),l=(0,c.hasBlockSupport)(t,"alignWide",!0),i=ls(r,l).includes(o);i&&(e.className=ml()(`align${o}`,e.className));return e},attributeKeys:["align"],hasSupport:e=>(0,c.hasBlockSupport)(e,"align",!1)};(0,m.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||(0,c.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...os,""]}}),e})),(0,m.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const ss=(0,_l.createSlotFill)("InspectorControls"),as=(0,_l.createSlotFill)("InspectorAdvancedControls"),cs=(0,_l.createSlotFill)("InspectorControlsBackground"),us=(0,_l.createSlotFill)("InspectorControlsBorder"),ds=(0,_l.createSlotFill)("InspectorControlsColor"),ps=(0,_l.createSlotFill)("InspectorControlsFilter"),ms=(0,_l.createSlotFill)("InspectorControlsDimensions"),hs=(0,_l.createSlotFill)("InspectorControlsPosition"),gs=(0,_l.createSlotFill)("InspectorControlsTypography"),fs=(0,_l.createSlotFill)("InspectorControlsListView"),bs=(0,_l.createSlotFill)("InspectorControlsStyles"),vs={default:ss,advanced:as,background:cs,border:us,color:ds,dimensions:ms,effects:(0,_l.createSlotFill)("InspectorControlsEffects"),filter:ps,list:fs,position:hs,settings:ss,styles:bs,typography:gs};function ks({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(w()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=y(),l=vs[t]?.Fill;return l&&r[h]?(0,s.createElement)(_l.__experimentalStyleProvider,{document},(0,s.createElement)(l,null,(t=>(0,s.createElement)(ys,{fillProps:t,children:e,resetAllFilter:o})))):null}function _s({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,u.useContext)(_l.__experimentalToolsPanelContext);return(0,u.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function ys({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,s.createElement)(_s,{resetAllFilter:t},e);return o.reduce(((e,[t,n])=>(0,s.createElement)(t,{...n},e)),r)}function Es({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,d.useDispatch)(Nr),{getBlockAttributes:r,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:i,hasMultiSelection:a}=(0,d.useSelect)(Nr),c=i(),p=(0,u.useCallback)(((e=[])=>{const t={},n=a()?l():[c];n.forEach((n=>{const{style:o}=r(n);let l={style:o};e.forEach((e=>{l={...l,...e(l)}})),l={...l,style:hl(l.style)},t[n]=l})),o(n,t,!0)}),[r,l,a,c,o]);return(0,s.createElement)(_l.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:p,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Qr},e)}function ws({Slot:e,fillProps:t,...n}){const o=(0,u.useContext)(_l.__experimentalToolsPanelContext),r=(0,u.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[_l.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,s.createElement)(e,{...n,fillProps:r,bubblesVirtually:!0})}function Ss({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(w()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const l=vs[t]?.Slot,i=(0,_l.__experimentalUseSlotFills)(l?.__unstableName),a=(0,u.useContext)(_l.__unstableMotionContext),c=(0,u.useMemo)((()=>{var e;return{...null!=o?o:{},forwardedContext:[...null!==(e=o?.forwardedContext)&&void 0!==e?e:[],[_l.__unstableMotionContext.Provider,{value:a}]]}}),[a,o]);return l&&i?.length?n?(0,s.createElement)(Es,{group:t,label:n},(0,s.createElement)(ws,{...r,fillProps:c,Slot:l})):(0,s.createElement)(l,{...r,fillProps:c,bubblesVirtually:!0}):null}const Cs=ks;Cs.Slot=Ss;const xs=e=>(0,s.createElement)(ks,{...e,group:"advanced"});xs.Slot=e=>(0,s.createElement)(Ss,{...e,group:"advanced"}),xs.slotName="InspectorAdvancedControls";const Bs=Cs,Is=/[\s#]/g,Ts={type:"string",source:"attribute",attribute:"id",selector:"*"};const Ms={addSaveProps:function(e,t,n){(0,c.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor);return e},edit:function({name:e,anchor:t,setAttributes:n}){const o=ns(),r="web"===u.Platform.OS,l=(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,x.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,x.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),r&&(0,s.createElement)(_l.ExternalLink,{href:(0,x.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,x.__)("Learn more about anchors"))),value:t||"",placeholder:r?null:(0,x.__)("Add an anchor"),onChange:e=>{e=e.replace(Is,"-"),n({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,r&&"default"===o&&(0,s.createElement)(Bs,{group:"advanced"},l),!r&&"core/heading"===e&&(0,s.createElement)(Bs,null,(0,s.createElement)(_l.PanelBody,{title:(0,x.__)("Heading settings")},l)))},attributeKeys:["anchor"],hasSupport:e=>(0,c.hasBlockSupport)(e,"anchor")};(0,m.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||(0,c.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Ts}),e}));const Ps={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};const Rs={addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>(0,c.hasBlockSupport)(e,"ariaLabel")};(0,m.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||(0,c.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Ps}),e}));const Ns={edit:function({className:e,setAttributes:t}){return"default"!==ns()?null:(0,s.createElement)(Bs,{group:"advanced"},(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,x.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,x.__)("Separate multiple classes with spaces.")}))},addSaveProps:function(e,t,n){(0,c.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=ml()(e.className,n.className));return e},attributeKeys:["className"],hasSupport:e=>(0,c.hasBlockSupport)(e,"customClassName",!0)};(0,m.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return(0,c.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,c.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]){const o=t[n]?.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,m.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,c.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,c.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,c.getBlockDefaultClassName)(t.name)),e}));const Ls=window.wp.blob,As=window.wp.dom,Os=window.wp.notices,Ds=window.wp.url,zs=window.wp.keycodes,Vs=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})),Fs=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),Hs=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),Gs=(0,_l.withFilters)("editor.MediaUpload")((()=>null));const Us=function({fallback:e=null,children:t}){const n=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return!!t().mediaUpload}),[]);return n?t:e},$s=window.wp.isShallowEqual;var js=n.n($s);const Ws=window.wp.preferences,Ks=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(Z.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"})),Zs=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),qs=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}));const Ys=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,p.useReducedMotion)(),l=r?u.Fragment:_l.__unstableAnimatePresence,i=r?"div":_l.__unstableMotion.div,a=`link-control-settings-drawer-${(0,p.useInstanceId)(e)}`;return(0,s.createElement)(u.Fragment,null,(0,s.createElement)(_l.Button,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,x.isRTL)()?Zs:qs,"aria-controls":a},(0,x._x)("Advanced","Additional link settings")),(0,s.createElement)(l,null,n&&(0,s.createElement)(i,{className:"block-editor-link-control__drawer",hidden:!n,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,s.createElement)("div",{className:"block-editor-link-control__drawer-inner"},t))))};var Xs=n(5428),Qs=n.n(Xs);function Js(e){return"function"==typeof e}class ea extends u.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,u.createRef)(),this.inputRef=(0,u.createRef)(),this.updateSuggestions=(0,p.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Qs()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||(o?.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const o=!e?.length;if(e=e.trim(),!o&&(e.length<2||!n&&(0,Ds.isURL)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const r=t(e,{isInitialSuggestions:o});r.then((t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,x.sprintf)((0,x._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,x.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===r&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===r&&(this.suggestionsRequest=null)})),this.suggestionsRequest=r}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case zs.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case zs.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case zs.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case zs.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case zs.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case zs.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,x.__)("Link selected.")));break;case zs.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:o=!1},{showSuggestions:r}){let l=r;const i=e&&e.length;return o||i||(l=!1),!0===n&&(l=!1),{showSuggestions:l,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:o,instanceId:r,placeholder:l=(0,x.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:a="",hideLabelFromVision:c=!1}=this.props,{loading:u,showSuggestions:d,selectedSuggestion:p,suggestionsListboxId:m,suggestionOptionIdPrefix:h}=this.state,g=`url-input-control-${r}`,f={id:g,label:t,className:ml()("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:c},b={id:g,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:l,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,x.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==p?`${h}-${p}`:void 0,ref:this.inputRef};return i?i(f,b,u):(e||w()("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,s.createElement)(_l.BaseControl,{__nextHasNoMarginBottom:e,...f},(0,s.createElement)("input",{...b}),u&&(0,s.createElement)(_l.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:l,suggestionsListboxId:i,suggestionOptionIdPrefix:a,loading:c}=this.state;if(!n||0===o.length)return null;const u={id:i,ref:this.autocompleteRef,role:"listbox"},d=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===l||void 0});return Js(t)?t({suggestions:o,selectedSuggestion:l,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,s.createElement)(_l.Popover,{placement:"bottom",focusOnMount:!1},(0,s.createElement)("div",{...u,className:ml()("block-editor-url-input__suggestions",`${e}__suggestions`)},o.map(((e,t)=>(0,s.createElement)(_l.Button,{...d(0,t),key:e.id,className:ml()("block-editor-url-input__suggestion",{"is-selected":t===l}),onClick:()=>this.handleOnClick(e)},e.title)))))}}const ta=(0,p.compose)(p.withSafeTimeout,_l.withSpokenMessages,p.withInstanceId,(0,d.withSelect)(((e,t)=>{if(Js(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Nr);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(ea),na=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),oa=({searchTerm:e,onClick:t,itemProps:n,buttonText:o})=>{if(!e)return null;let r;return r=o?"function"==typeof o?o(e):o:(0,u.createInterpolateElement)((0,x.sprintf)((0,x.__)("Create: <mark>%s</mark>"),e),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(_l.MenuItem,{...n,iconPosition:"left",icon:na,className:"block-editor-link-control__search-item",onClick:t},r)},ra=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})),la=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,s.createElement)(Z.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})),ia=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})),sa=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})),aa=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})),ca=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),ua=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),da=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})),pa={post:ra,page:la,post_tag:ia,category:sa,attachment:aa};function ma({isURL:e,suggestion:t}){let n=null;return e?n=ca:t.type in pa&&(n=pa[t.type],"page"===t.type&&(t.isFrontPage&&(n=ua),t.isBlogHome&&(n=da))),n?(0,s.createElement)(Ti,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function ha(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function ga(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function fa(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const ba=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:l=!1})=>{const i=r?(0,x.__)("Press ENTER to add this link"):(a=t.url)?(0,p.pipe)(Ds.safeDecodeURI,Ds.getPath,(e=>t=>null==t||t!=t?e:t)(""),((e,...t)=>(...n)=>e(...n,...t))(Ds.filterURLForDisplay,24),ga,ha)(a):a;var a;return(0,s.createElement)(_l.MenuItem,{...e,info:i,iconPosition:"left",icon:(0,s.createElement)(ma,{suggestion:t,isURL:r}),onClick:o,shortcut:l&&fa(t),className:"block-editor-link-control__search-item"},(0,s.createElement)(_l.TextHighlight,{text:(0,As.__unstableStripHTML)(t.title),highlight:n}))},va="__CREATE__",ka="link",_a="mailto",ya="internal",Ea=[ka,_a,"tel",ya],wa=[{id:"opensInNewTab",title:(0,x.__)("Open in new tab")}];function Sa({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:l,suggestions:i,selectedSuggestion:a,isLoading:c,isInitialSuggestions:u,createSuggestionButtonText:d,suggestionsQuery:p}){const m=ml()("block-editor-link-control__search-results",{"is-loading":c}),h=1===i.length&&Ea.includes(i[0].type),g=t&&!h&&!u,f=!p?.type,b=`block-editor-link-control-search-results-label-${e}`,v=u?(0,x.__)("Suggestions"):(0,x.sprintf)((0,x.__)('Search results for "%s"'),n),k=(0,s.createElement)(_l.VisuallyHidden,{id:b},v);return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},k,(0,s.createElement)("div",{...r,className:m,"aria-labelledby":b},(0,s.createElement)(_l.MenuGroup,null,i.map(((e,t)=>g&&va===e.type?(0,s.createElement)(oa,{searchTerm:n,buttonText:d,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===a}):va===e.type?null:(0,s.createElement)(ba,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===a,isURL:Ea.includes(e.type),searchTerm:n,shouldShowType:f,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome}))))))}function Ca(e){if(e.includes(" "))return!1;const t=(0,Ds.getProtocol)(e),n=(0,Ds.isValidProtocol)(t),o=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www."),l=e?.startsWith("#")&&(0,Ds.isValidFragment)(e);return n||r||l||o}const xa=()=>Promise.resolve([]),Ba=e=>{let t=ka;const n=(0,Ds.getProtocol)(e)||"";return n.includes("mailto")&&(t=_a),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=ya),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Ds.prependHTTP)(e):e,type:t}])};function Ia(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:l}=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Ba:xa;return(0,u.useCallback)(((t,{isInitialSuggestions:s})=>Ca(t)?i(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,l)=>{const{isInitialSuggestions:i}=t,s=await n(e,t);return s.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===l?(e.isBlogHome=!0,e):e)),i||Ca(e)||!o?s:s.concat({title:e,url:e,type:va})})(t,{...e,isInitialSuggestions:s},o,n,r,l)),[i,o,r,l,e,n])}const Ta=()=>Promise.resolve([]),Ma=()=>{},Pa=(0,u.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:l=!1,onCreateSuggestion:i=Ma,onChange:a=Ma,onSelect:c=Ma,showSuggestions:d=!0,renderSuggestions:m=(e=>(0,s.createElement)(Sa,{...e})),fetchSuggestions:h=null,allowDirectEntry:g=!0,showInitialSuggestions:f=!1,suggestionsQuery:b={},withURLSuggestion:v=!0,createSuggestionButtonText:k,hideLabelFromVision:_=!1},y)=>{const E=Ia(b,g,l),w=d?h||E:Ta,S=(0,p.useInstanceId)(Pa),[C,B]=(0,u.useState)(),I=async e=>{let t=e;if(va!==e.type){if(g||t&&Object.keys(t).length>=1){const{id:e,url:o,...r}=null!=n?n:{};c({...r,...t},t)}}else try{t=await i(e.title),t?.url&&c(t)}catch(e){}};return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(ta,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,x.__)("Link"),hideLabelFromVision:_,className:o,value:e,onChange:(e,t)=>{a(e),B(t)},placeholder:null!=r?r:(0,x.__)("Search or type url"),__experimentalRenderSuggestions:d?e=>m({...e,instanceId:S,withCreateSuggestion:l,createSuggestionButtonText:k,suggestionsQuery:b,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),I(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:f,onSubmit:(t,n)=>{const o=t||C;o||e?.trim()?.length?I(o||{url:e}):n.preventDefault()},ref:y}),t)})),Ra=Pa,Na=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),La=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})),Aa=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})),Oa=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})),{Slot:Da,Fill:za}=(0,_l.createSlotFill)("BlockEditorLinkControlViewer");function Va(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}`)}}const Fa=function(e){const[t,n]=(0,u.useReducer)(Va,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,u.useEffect)((()=>{if(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 Ha({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r}){const l=(0,d.useSelect)((e=>e(Ws.store).get("core","showIconLabels")),[]),i=n?e?.url:null,{richData:a,isFetching:c}=Fa(i),u=a&&Object.keys(a).length,m=e&&(0,Ds.filterURLForDisplay)((0,Ds.safeDecodeURI)(e.url),24)||"",h=!e?.url?.length,g=!h&&(0,As.__unstableStripHTML)(a?.title||e?.title||m);let f;f=a?.icon?(0,s.createElement)("img",{src:a?.icon,alt:""}):h?(0,s.createElement)(Ti,{icon:Na,size:32}):(0,s.createElement)(Ti,{icon:ca});const{createNotice:b}=(0,d.useDispatch)(Os.store),v=(0,p.useCopyToClipboard)(e.url,(()=>{b("info",(0,x.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)("div",{"aria-label":(0,x.__)("Currently selected"),className:ml()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":h,"is-url-title":g===m})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:ml()("block-editor-link-control__search-item-icon",{"is-image":a?.icon})},f),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},h?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,x.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},(0,s.createElement)(_l.__experimentalTruncate,{numberOfLines:1},g)),e?.url&&g!==m&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},(0,s.createElement)(_l.__experimentalTruncate,{numberOfLines:1},m))))),(0,s.createElement)(_l.Button,{icon:La,label:(0,x.__)("Edit link"),onClick:t,size:"compact"}),o&&(0,s.createElement)(_l.Button,{icon:Aa,label:(0,x.__)("Remove link"),onClick:r,size:"compact"}),(0,s.createElement)(_l.Button,{icon:Oa,label:(0,x.sprintf)((0,x.__)("Copy link%s"),h||l?"":": "+e.url),ref:v,disabled:h,size:"compact"}),(0,s.createElement)(Da,{fillProps:e})))}const Ga=()=>{},Ua=({value:e,onChange:t=Ga,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,s.createElement)(_l.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:o(t),checked:!!e&&!!e[t.id],help:t?.help})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(_l.VisuallyHidden,{as:"legend"},(0,x.__)("Currently selected link settings")),r)};const $a=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}}};var ja=n(5215),Wa=n.n(ja);const Ka=()=>{},Za="core/block-editor",qa="linkControlSettingsDrawer";function Ya({searchInputPlaceholder:e,value:t,settings:n=wa,onChange:o=Ka,onRemove:r,onCancel:l,noDirectEntry:i=!1,showSuggestions:a=!0,showInitialSuggestions:c,forceIsEditingLink:p,createSuggestion:m,withCreateSuggestion:h,inputValue:g="",suggestionsQuery:f={},noURLSuggestion:b=!1,createSuggestionButtonText:v,hasRichPreviews:k=!1,hasTextControl:_=!1,renderControlBottom:y=null}){void 0===h&&m&&(h=!0);const[E,w]=(0,u.useState)(!1),{advancedSettingsPreference:S}=(0,d.useSelect)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(Ws.store).get(Za,qa))&&void 0!==t&&t}}),[]),{set:C}=(0,d.useDispatch)(Ws.store),B=S||E,I=(0,u.useRef)(!0),T=(0,u.useRef)(),M=(0,u.useRef)(),P=(0,u.useRef)(!1),R=n.map((({id:e})=>e)),[N,L,A,O,D]=function(e){const[t,n]=(0,u.useState)(e||{}),[o,r]=(0,u.useState)(e);return Wa()(e,o)||(r(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>o=>{const r=Object.keys(o).reduce(((t,n)=>(e.includes(n)&&(t[n]=o[n]),t)),{});n({...t,...r})}]}(t),z=t&&!(0,$s.isShallowEqualObjects)(N,t),[V,F]=(0,u.useState)(void 0!==p?p:!t||!t.url),{createPage:H,isCreatingPage:G,errorMessage:U}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[r,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=$a(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,x.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(m);(0,u.useEffect)((()=>{void 0!==p&&F(p)}),[p]),(0,u.useEffect)((()=>{if(I.current)return void(I.current=!1);(As.focus.focusable.find(T.current)[0]||T.current).focus(),P.current=!1}),[V,G]);const $=t?.url?.trim()?.length>0,j=()=>{P.current=!!T.current?.contains(T.current.ownerDocument.activeElement),F(!1)},W=()=>{z&&o({...t,...N,url:K}),j()},K=g||N?.url||"",Z=!K?.trim()?.length,q=r&&t&&!V&&!G,Y=V&&$,X=$&&_,Q=(V||!t)&&!G,J=!z||Z,ee=!!n?.length&&V&&$;return(0,s.createElement)("div",{tabIndex:-1,ref:T,className:"block-editor-link-control"},G&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(_l.Spinner,null)," ",(0,x.__)("Creating"),"…"),Q&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:ml()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":X,"has-actions":Y})},X&&(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,ref:M,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,x.__)("Text"),value:N?.title,onChange:O,onKeyDown:e=>{const{keyCode:t}=e;t!==zs.ENTER||Z||(e.preventDefault(),W())},size:"__unstable-large"}),(0,s.createElement)(Ra,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:K,withCreateSuggestion:h,onCreateSuggestion:H,onChange:A,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(R.includes(n)||(t[n]=e[n]),t)),{});o({...N,...t,title:N?.title||e?.title}),j()},showInitialSuggestions:c,allowDirectEntry:!i,showSuggestions:a,suggestionsQuery:f,withURLSuggestion:!b,createSuggestionButtonText:v,hideLabelFromVision:!X}),!Y&&(0,s.createElement)("div",{className:"block-editor-link-control__search-enter"},(0,s.createElement)(_l.Button,{onClick:J?Ka:W,label:(0,x.__)("Submit"),icon:Ks,className:"block-editor-link-control__search-submit","aria-disabled":J}))),U&&(0,s.createElement)(_l.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},U)),t&&!V&&!G&&(0,s.createElement)(Ha,{key:t?.url,value:t,onEditClick:()=>F(!0),hasRichPreviews:k,hasUnlinkControl:q,onRemove:()=>{r(),F(!0)}}),ee&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},!Z&&(0,s.createElement)(Ys,{settingsOpen:B,setSettingsOpen:e=>{C&&C(Za,qa,e),w(e)}},(0,s.createElement)(Ua,{value:N,settings:n,onChange:D(R)}))),Y&&(0,s.createElement)(_l.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions"},(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),L(t),$?j():r?.(),l?.()}},(0,x.__)("Cancel")),(0,s.createElement)(_l.Button,{variant:"primary",onClick:J?Ka:W,className:"block-editor-link-control__search-submit","aria-disabled":J},(0,x.__)("Save"))),!G&&y&&y())}Ya.ViewerFill=za,Ya.DEFAULT_LINK_SETTINGS=wa;const Xa=Ya,Qa=()=>{};let Ja=0;const ec=(0,p.compose)([(0,d.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Os.store);return{createNotice:t,removeNotice:n}})),(0,_l.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:l,onSelect:i,onSelectURL:a,onToggleFeaturedImage:c,useFeaturedImage:p,onFilesUpload:m=Qa,name:h=(0,x.__)("Replace"),createNotice:g,removeNotice:f,children:b,multiple:v=!1,addToGallery:k,handleUpload:_=!0,popoverProps:y})=>{const E=(0,d.useSelect)((e=>e(Nr).getSettings().mediaUpload),[]),w=!!E,S=(0,u.useRef)(),C="block-editor/media-replace-flow/error-notice/"+ ++Ja,B=e=>{const t=(0,As.__unstableStripHTML)(e);l?l(t):setTimeout((()=>{g("error",t,{speak:!0,id:C,isDismissible:!0})}),1e3)},I=(e,t)=>{p&&c&&c(),t(),i(e),(0,vo.speak)((0,x.__)("The media file has been replaced")),f(C)},T=e=>{e.keyCode===zs.DOWN&&(e.preventDefault(),e.target.click())},M=v&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(_l.Dropdown,{popoverProps:y,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(_l.ToolbarButton,{ref:S,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:T},h),renderContent:({onClose:l})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(Us,null,(0,s.createElement)(Gs,{gallery:M,addToGallery:k,multiple:v,value:v?n:t,onSelect:e=>I(e,l),allowedTypes:o,render:({open:e})=>(0,s.createElement)(_l.MenuItem,{icon:Vs,onClick:e},(0,x.__)("Open Media Library"))}),(0,s.createElement)(_l.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),i(n);m(n),E({allowedTypes:o,filesList:n,onFileChange:([e])=>{I(e,t)},onError:B})})(e,l)},accept:r,multiple:!!v,render:({openFileDialog:e})=>(0,s.createElement)(_l.MenuItem,{icon:Fs,onClick:()=>{e()}},(0,x.__)("Upload"))})),c&&(0,s.createElement)(_l.MenuItem,{icon:Hs,onClick:c,isPressed:p},(0,x.__)("Use featured image")),b),a&&(0,s.createElement)("form",{className:ml()("block-editor-media-flow__url-input",{"has-siblings":w||c})},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,x.__)("Current media URL:")),(0,s.createElement)(Xa,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),S.current.focus()}})))})})),tc="background",nc="image";function oc(e){return!!e?.background?.backgroundImage?.id||!!e?.background?.backgroundImage?.url}function rc(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,tc);return!0===n||("any"===t?!!n?.backgroundImage||!!n?.backgroundSize||!!n?.backgroundRepeat:!!n?.[t])}function lc(e={},t){t({style:hl({...e,background:{...e?.background,backgroundImage:void 0}})})}function ic(e){return oc(e)?"has-background":""}function sc({label:e,filename:t,url:n}){const o=e||(0,Ds.getFilename)(n);return(0,s.createElement)(_l.__experimentalItemGroup,{as:"span"},(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start",as:"span"},(0,s.createElement)("span",{className:ml()("block-editor-hooks__background__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0},n&&(0,s.createElement)("span",{className:"block-editor-hooks__background__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})),(0,s.createElement)(_l.FlexItem,{as:"span"},(0,s.createElement)(_l.__experimentalTruncate,{numberOfLines:1,className:"block-editor-hooks__background__inspector-media-replace-title"},o),(0,s.createElement)(_l.VisuallyHidden,{as:"span"},t?(0,x.sprintf)((0,x.__)("Selected image: %s"),t):(0,x.__)("No image selected")))))}function ac({clientId:e,isShownByDefault:t,setAttributes:n}){const{style:o,mediaUpload:r}=(0,d.useSelect)((t=>{const{getBlockAttributes:n,getSettings:o}=t(Nr);return{style:n(e)?.style,mediaUpload:o().mediaUpload}}),[e]),{id:l,title:i,url:a}=o?.background?.backgroundImage||{},c=(0,u.useRef)(),{createErrorNotice:p}=(0,d.useDispatch)(Os.store),m=e=>{p(e,{type:"snackbar"})},h=e=>{if(!e||!e.url){const e={...o,background:{...o?.background,backgroundImage:void 0}},t={style:hl(e)};return void n(t)}if((0,Ls.isBlobURL)(e.url))return;if(e.media_type&&e.media_type!==nc||!e.media_type&&e.type&&e.type!==nc)return void m((0,x.__)("Only images can be used as a background image."));const t={...o,background:{...o?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0}}},r={style:hl(t)};n(r)},g=(0,u.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),f=oc(o);return(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>f,label:(0,x.__)("Background image"),onDeselect:()=>lc(o,n),isShownByDefault:t,resetAllFilter:g,panelId:e},(0,s.createElement)("div",{className:"block-editor-hooks__background__inspector-media-replace-container",ref:c},(0,s.createElement)(ec,{mediaId:l,mediaURL:a,allowedTypes:[nc],accept:"image/*",onSelect:h,name:(0,s.createElement)(sc,{label:(0,x.__)("Background image"),filename:i,url:a}),variant:"secondary"},f&&(0,s.createElement)(_l.MenuItem,{onClick:()=>{const[e]=As.focus.tabbable.find(c.current);e?.focus(),e?.click(),lc(o,n)}},(0,x.__)("Reset "))),(0,s.createElement)(_l.DropZone,{onFilesDrop:e=>{r({allowedTypes:["image"],filesList:e,onFileChange([e]){(0,Ls.isBlobURL)(e?.url)||h(e)},onError:m})},label:(0,x.__)("Drop to upload")})))}const cc=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},uc=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function dc({clientId:e,isShownByDefault:t,setAttributes:n}){const o=(0,d.useSelect)((t=>t(Nr).getBlockAttributes(e)?.style),[e]),r=o?.background?.backgroundSize,l=o?.background?.backgroundRepeat,i=void 0!==r&&"cover"!==r&&"contain"!==r||""===r?"auto":r||"cover",a="no-repeat"!==l&&("cover"!==i||void 0!==l),c=function(e){return void 0!==e?.background?.backgroundPosition||void 0!==e?.background?.backgroundSize}(o),p=(0,u.useCallback)((e=>({...e,style:{...e.style,background:{...e.style?.background,backgroundRepeat:void 0,backgroundSize:void 0}}})),[]),m=e=>{let t=l;"contain"===e&&(t="no-repeat"),"cover"!==i&&"contain"!==i||"auto"!==e||(t=void 0),n({style:hl({...o,background:{...o?.background,backgroundRepeat:t,backgroundSize:e}})})};return(0,s.createElement)(_l.__experimentalVStack,{as:_l.__experimentalToolsPanelItem,spacing:2,className:"single-column",hasValue:()=>c,label:(0,x.__)("Size"),onDeselect:()=>function(e={},t){t({style:hl({...e,background:{...e?.background,backgroundPosition:void 0,backgroundRepeat:void 0,backgroundSize:void 0}})})}(o,n),isShownByDefault:t,resetAllFilter:p,panelId:e},(0,s.createElement)(_l.FocalPointPicker,{__next40pxDefaultSize:!0,label:(0,x.__)("Position"),url:o?.background?.backgroundImage?.url,value:uc(o?.background?.backgroundPosition),onChange:e=>{n({style:hl({...o,background:{...o?.background,backgroundPosition:cc(e)}})})}}),(0,s.createElement)(_l.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,x.__)("Size"),value:i,onChange:m,isBlock:!0,help:(h=r,"cover"===h||void 0===h?(0,x.__)("Image covers the space evenly."):"contain"===h?(0,x.__)("Image is contained without distortion."):(0,x.__)("Specify a fixed width."))},(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"cover",value:"cover",label:(0,x.__)("Cover")}),(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"contain",value:"contain",label:(0,x.__)("Contain")}),(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"fixed",value:"auto",label:(0,x.__)("Fixed")})),void 0!==r&&"cover"!==r&&"contain"!==r?(0,s.createElement)(_l.__experimentalUnitControl,{size:"__unstable-large",onChange:m,value:r}):null,"cover"!==i&&(0,s.createElement)(_l.ToggleControl,{label:(0,x.__)("Repeat"),checked:a,onChange:()=>{n({style:hl({...o,background:{...o?.background,backgroundRepeat:!0===a?"no-repeat":void 0}})})}}));var h}function pc(e){const[t,n]=Ar("background.backgroundImage","background.backgroundSize");if(!t||!rc(e.name,"backgroundImage"))return null;const o=!(!n||!rc(e.name,"backgroundSize")),r=(0,c.getBlockSupport)(e.name,[tc,"__experimentalDefaultControls"]);return(0,s.createElement)(Bs,{group:"background"},(0,s.createElement)(ac,{isShownByDefault:r?.backgroundImage,...e}),o&&(0,s.createElement)(dc,{isShownByDefault:r?.backgroundSize,...e}))}var mc={grad:.9,turn:360,rad:360/(2*Math.PI)},hc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},gc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},fc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},bc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},vc=function(e){return{r:fc(e.r,0,255),g:fc(e.g,0,255),b:fc(e.b,0,255),a:fc(e.a)}},kc=function(e){return{r:gc(e.r),g:gc(e.g),b:gc(e.b),a:gc(e.a,3)}},_c=/^#([0-9a-f]{3,8})$/i,yc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ec=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},wc=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Sc=function(e){return{h:bc(e.h),s:fc(e.s,0,100),l:fc(e.l,0,100),a:fc(e.a)}},Cc=function(e){return{h:gc(e.h),s:gc(e.s),l:gc(e.l),a:gc(e.a,3)}},xc=function(e){return wc((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},Bc=function(e){return{h:(t=Ec(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},Ic=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Pc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rc={string:[[function(e){var t=_c.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?gc(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?gc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Mc.exec(e)||Pc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vc({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=Ic.exec(e)||Tc.exec(e);if(!t)return null;var n,o,r=Sc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(mc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return xc(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 hc(t)&&hc(n)&&hc(o)?vc({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(!hc(t)||!hc(n)||!hc(o))return null;var i=Sc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return xc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!hc(t)||!hc(n)||!hc(o))return null;var i=function(e){return{h:bc(e.h),s:fc(e.s,0,100),v:fc(e.v,0,100),a:fc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return wc(i)},"hsv"]]},Nc=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]},Lc=function(e){return"string"==typeof e?Nc(e.trim(),Rc.string):"object"==typeof e&&null!==e?Nc(e,Rc.object):[null,void 0]},Ac=function(e,t){var n=Bc(e);return{h:n.h,s:fc(n.s+100*t,0,100),l:n.l,a:n.a}},Oc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Dc=function(e,t){var n=Bc(e);return{h:n.h,s:n.s,l:fc(n.l+100*t,0,100),a:n.a}},zc=function(){function e(e){this.parsed=Lc(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 gc(Oc(this.rgba),2)},e.prototype.isDark=function(){return Oc(this.rgba)<.5},e.prototype.isLight=function(){return Oc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=kc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?yc(gc(255*r)):"","#"+yc(t)+yc(n)+yc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return kc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=kc(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 Cc(Bc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Cc(Bc(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=Ec(this.rgba),{h:gc(e.h),s:gc(e.s),v:gc(e.v),a:gc(e.a,3)};var e},e.prototype.invert=function(){return Vc({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),Vc(Ac(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Vc(Ac(this.rgba,-e))},e.prototype.grayscale=function(){return Vc(Ac(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Vc(Dc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Vc(Dc(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?Vc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):gc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Bc(this.rgba);return"number"==typeof e?Vc({h:e,s:t.s,l:t.l,a:t.a}):gc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Vc(e).toHex()},e}(),Vc=function(e){return e instanceof zc?e:new zc(e)},Fc=[],Hc=function(e){e.forEach((function(e){Fc.indexOf(e)<0&&(e(zc,Rc),Fc.push(e))}))};function Gc(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Uc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},$c=function(e){return.2126*Uc(e.r)+.7152*Uc(e.g)+.0722*Uc(e.b)};function jc(e){e.prototype.luminance=function(){return e=$c(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=$c(l))>(a=$c(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}Hc([Gc,jc]);const Wc=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Kc=(e,t)=>e?.find((e=>e.color===t));function Zc(e,t){if(!e||!t)return;const{kebabCase:n}=ie(_l.privateApis);return`has-${n(t)}-${e}`}function qc(){const[e,t,n,o,r,l,i,s,a,c]=Ar("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!l};return d.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,x._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,x._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,x._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[t,n,o,r]),d.gradients=(0,u.useMemo)((()=>{const e=[];return s&&s.length&&e.push({name:(0,x._x)("Theme","Indicates this palette comes from the theme."),gradients:s}),c&&a&&a.length&&e.push({name:(0,x._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),i&&i.length&&e.push({name:(0,x._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,s,a,c]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}function Yc(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Xc(e={}){const{flat:t,...n}=e;return t||Yc(Object.values(n).filter(Boolean))||"px"}function Qc(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,_l.__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=Yc(o);return 0===r||r?`${r}${l}`:void 0}function Jc(e={}){const t=Qc(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function eu(e){if(!e)return!1;if("string"==typeof e)return!0;return!!Object.values(e).filter((e=>!!e||0===e)).length}function tu({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let l=Qc(o);void 0===l&&(l=Xc(t));const i=eu(o)&&Jc(o),a=i?(0,x.__)("Mixed"):null;return(0,s.createElement)(_l.__experimentalUnitControl,{...r,"aria-label":(0,x.__)("Border radius"),disableUnits:i,isOnly:!0,value:l,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const nu={topLeft:(0,x.__)("Top left"),topRight:(0,x.__)("Top right"),bottomLeft:(0,x.__)("Bottom left"),bottomRight:(0,x.__)("Bottom right")};function ou({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const l=t=>n=>{if(!e)return;const o=!isNaN(parseFloat(n))?n:void 0;e({...i,[t]:o})},i="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(nu).map((([e,o])=>{const[a,c]=(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(i[e]),u=i[e]?c:t[e]||t.flat;return(0,s.createElement)(_l.Tooltip,{text:o,placement:"top",key:e},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(_l.__experimentalUnitControl,{...r,"aria-label":o,value:[a,u].join(""),onChange:l(e),onUnitChange:(d=e,e=>{const o={...t};o[d]=e,n(o)}),size:"__unstable-large"})));var d})))}const ru=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"}));function lu({isLinked:e,...t}){const n=e?(0,x.__)("Unlink radii"):(0,x.__)("Link radii");return(0,s.createElement)(_l.Tooltip,{text:n},(0,s.createElement)(_l.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?ru:Aa,iconSize:24,"aria-label":n}))}const iu={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},su=0,au={px:100,em:20,rem:20};function cu({onChange:e,values:t}){const[n,o]=(0,u.useState)(!eu(t)||!Jc(t)),[r,l]=(0,u.useState)({flat:"string"==typeof t?(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[i]=Ar("spacing.units"),a=(0,_l.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"]}),c=Xc(r),d=a&&a.find((e=>e.value===c)),p=d?.step||1,[m]=(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(Qc(t));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(tu,{className:"components-border-radius-control__unit-control",values:t,min:su,onChange:e,selectedUnits:r,setSelectedUnits:l,units:a}),(0,s.createElement)(_l.RangeControl,{label:(0,x.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=m?m:"",min:su,max:au[c],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${c}`:void 0)},step:p,__nextHasNoMarginBottom:!0})):(0,s.createElement)(ou,{min:su,onChange:e,selectedUnits:r,setSelectedUnits:l,values:t||iu,units:a}),(0,s.createElement)(lu,{onClick:()=>o(!n),isLinked:n})))}const uu=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),du=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})),pu=[];function mu({shadow:e,onShadowChange:t,settings:n}){const o=bu(n);return(0,s.createElement)("div",{className:"block-editor-global-styles__shadow-popover-container"},(0,s.createElement)(_l.__experimentalVStack,{spacing:4},(0,s.createElement)(_l.__experimentalHeading,{level:5},(0,x.__)("Drop shadow")),(0,s.createElement)(hu,{presets:o,activeShadow:e,onSelect:t}),(0,s.createElement)("div",{className:"block-editor-global-styles__clear-shadow"},(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>t(void 0)},(0,x.__)("Clear")))))}function hu({presets:e,activeShadow:t,onSelect:n}){const{CompositeV2:o,useCompositeStoreV2:r}=ie(_l.privateApis),l=r();return e?(0,s.createElement)(o,{store:l,role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,x.__)("Drop shadows")},e.map((({name:e,slug:o,shadow:r})=>(0,s.createElement)(gu,{key:o,label:e,isActive:r===t,type:"unset"===o?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r})))):null}function gu({type:e,label:t,isActive:n,onSelect:o,shadow:r}){const{CompositeItemV2:l}=ie(_l.privateApis);return(0,s.createElement)(l,{role:"option","aria-label":t,"aria-selected":n,className:ml()("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,s.createElement)(_l.Button,{className:ml()("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:o,label:t,style:{boxShadow:r},showTooltip:!0},n&&(0,s.createElement)(Ti,{icon:uu}))})}function fu({shadow:e,onShadowChange:t,settings:n}){return(0,s.createElement)(_l.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:ml()({"is-open":t}),"aria-expanded":t};return(0,s.createElement)(_l.Button,{...n},(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(Ti,{className:"block-editor-global-styles__toggle-icon",icon:du,size:24}),(0,s.createElement)(_l.FlexItem,null,(0,x.__)("Drop shadow"))))},renderContent:()=>(0,s.createElement)(_l.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(mu,{shadow:e,onShadowChange:t,settings:n}))})}function bu(e){return(0,u.useMemo)((()=>{var t;if(!e?.shadow)return pu;const n=e?.shadow?.defaultPresets,{default:o,theme:r}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},l={name:(0,x.__)("Unset"),slug:"unset",shadow:"none"},i=[...n&&o||pu,...r||pu];return i.length&&i.unshift(l),i}),[e])}function vu(e){return Object.values(ku(e)).some(Boolean)}function ku(e){return{hasBorderColor:_u(e),hasBorderRadius:yu(e),hasBorderStyle:Eu(e),hasBorderWidth:wu(e),hasShadow:Su(e)}}function _u(e){return e?.border?.color}function yu(e){return e?.border?.radius}function Eu(e){return e?.border?.style}function wu(e){return e?.border?.width}function Su(e){const t=bu(e);return!!e?.shadow&&t.length>0}function Cu({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r,label:l}){return(0,s.createElement)(_l.__experimentalToolsPanel,{label:l,resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Qr},r)}const xu={radius:!0,color:!0,width:!0,shadow:!1};function Bu({as:e=Cu,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,name:i,defaultControls:a=xu}){var c,d;const p=ul(r),m=(0,u.useCallback)((e=>el({settings:r},"",e)),[r]),h=e=>{const t=p.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},g=(0,u.useMemo)((()=>{if((0,_l.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:m(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?m(o?.border?.color):void 0}}),[o?.border,m]),f=e=>n({...t,border:e}),b=_u(r),v=Eu(r),k=wu(r),_=yu(r),y=m(g?.radius),E=e=>f({...g,radius:e}),w=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},S=Su(r),C=m(o?.shadow),B=null!==(d=Qn(null!==(c=r?.shadow?.presets)&&void 0!==c?c:{}))&&void 0!==d?d:[],I=e=>{const o=B?.find((({shadow:t})=>t===e))?.slug;n(jn(t,["shadow"],o?`var:preset|shadow|${o}`:e||void 0))},T=(0,u.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),M=a?.color||a?.width,P=b||v||k||_,R=zu({blockName:i,hasShadowControl:S,hasBorderControl:P});return(0,s.createElement)(e,{resetAllFilter:T,value:t,onChange:n,panelId:l,label:R},(k||b)&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>(0,_l.__experimentalIsDefinedBorder)(t?.border),label:(0,x.__)("Border"),onDeselect:()=>(()=>{if(w())return f({radius:t?.border?.radius});f(void 0)})(),isShownByDefault:M,panelId:l},(0,s.createElement)(_l.__experimentalBorderBoxControl,{colors:p,enableAlpha:!0,enableStyle:v,onChange:e=>{const t={...e};(0,_l.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:h(t[e]?.color)})})):t&&(t.color=h(t.color)),f({radius:g?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:g,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,x.__)("Border")})),_&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:w,label:(0,x.__)("Radius"),onDeselect:()=>E(void 0),isShownByDefault:a.radius,panelId:l},(0,s.createElement)(cu,{values:y,onChange:e=>{E(e||void 0)}})),S&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>I(void 0),isShownByDefault:a.shadow,panelId:l},P?(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Shadow")):null,(0,s.createElement)(_l.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(fu,{shadow:C,onShadowChange:I,settings:r}))))}const Iu="__experimentalBorder",Tu="shadow",Mu=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Pu=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=Mu(e,"slug",t);if(n)return n}if(!n)return{color:void 0};const o=Mu(e,"color",n);return o||{color:n}};function Ru(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Nu(e){if((0,_l.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o={...e};return o.border={...o.border,color:n?void 0:t},{style:hl(o),borderColor:n}}function Lu(e){return(0,_l.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function Au({label:e,children:t,resetAllFilter:n}){const o=(0,u.useCallback)((e=>{const t=Lu(e),o=n(t);return{...e,...Nu(o)}}),[n]);return(0,s.createElement)(Bs,{group:"border",resetAllFilter:o,label:e},t)}function Ou({clientId:e,name:t,setAttributes:n,settings:o}){const r=vu(o);const{style:l,borderColor:i}=(0,d.useSelect)((function(t){const{style:n,borderColor:o}=t(Nr).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),a=(0,u.useMemo)((()=>Lu({style:l,borderColor:i})),[l,i]);if(!r)return null;const p={...(0,c.getBlockSupport)(t,[Iu,"__experimentalDefaultControls"]),...(0,c.getBlockSupport)(t,[Tu,"__experimentalDefaultControls"])};return(0,s.createElement)(Bu,{as:Au,panelId:e,settings:o,value:a,onChange:e=>{n(Nu(e))},defaultControls:p})}function Du(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,Iu);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function zu({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const o=ku(vl(e));return t||n||!e||(t=o?.hasBorderColor||o?.hasBorderStyle||o?.hasBorderWidth||o?.hasBorderRadius,n=o?.hasShadow),t&&n?(0,x.__)("Border & Shadow"):n?(0,x.__)("Shadow"):(0,x.__)("Border")}function Vu(e,t,n){if(!Du(t,"color")||fl(t,Iu,"color"))return e;const o=Fu(n),r=ml()(e.className,o);return e.className=r||void 0,e}function Fu(e){const{borderColor:t,style:n}=e,o=Zc("border-color",t);return ml()({"has-border-color":t||n?.border?.color,[o]:!!o})}const Hu={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=qc();if(!Du(e,"color")||fl(e,Iu,"color"))return{};const{color:r}=Pu({colors:o,namedColor:t}),{color:l}=Pu({colors:o,namedColor:Ru(n?.border?.top?.color)}),{color:i}=Pu({colors:o,namedColor:Ru(n?.border?.right?.color)}),{color:s}=Pu({colors:o,namedColor:Ru(n?.border?.bottom?.color)}),{color:a}=Pu({colors:o,namedColor:Ru(n?.border?.left?.color)});return Vu({style:hl({borderTopColor:l||r,borderRightColor:i||r,borderBottomColor:s||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:Vu,attributeKeys:["borderColor","style"],hasSupport:e=>Du(e,"color")};function Gu(e){if(e)return`has-${e}-gradient-background`}function Uu(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function $u(e,t){const n=e?.find((e=>e.gradient===t));return n}function ju(e,t){const n=$u(e,t);return n&&n.slug}function Wu({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=y(),[o,r,l]=Ar("color.gradients.custom","color.gradients.theme","color.gradients.default"),i=(0,u.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:s,customGradient:a}=(0,d.useSelect)((o=>{const{getBlockAttributes:r}=o(Nr),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,d.useDispatch)(Nr),p=(0,u.useCallback)((o=>{const r=ju(i,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,c]),m=Gu(s);let h;return h=s?Uu(i,s):a,{gradientClass:m,gradientValue:h,setGradient:p}}(0,m.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Du(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const Ku=["colors","disableCustomColors","gradients","disableCustomGradients"],Zu={color:"color",gradient:"gradient"};function qu({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:l,label:i,onColorChange:a,onGradientChange:c,colorValue:u,gradientValue:d,clearable:p,showTitle:m=!0,enableAlpha:h,headingLevel:g}){const f=a&&(e&&e.length>0||!n),b=c&&(t&&t.length>0||!o);if(!f&&!b)return null;const v={[Zu.color]:(0,s.createElement)(_l.ColorPalette,{value:u,onChange:b?e=>{a(e),c()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:h,headingLevel:g}),[Zu.gradient]:(0,s.createElement)(_l.GradientPicker,{value:d,onChange:f?e=>{c(e),a()}:c,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:g})},k=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},v[e]),{Tabs:_}=ie(_l.privateApis);return(0,s.createElement)(_l.BaseControl,{__nextHasNoMarginBottom:!0,className:ml()("block-editor-color-gradient-control",l)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(_l.__experimentalVStack,{spacing:1},m&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(_l.BaseControl.VisualLabel,null,i))),f&&b&&(0,s.createElement)("div",null,(0,s.createElement)(_,{initialTabId:d?Zu.gradient:!!f&&Zu.color},(0,s.createElement)(_.TabList,null,(0,s.createElement)(_.Tab,{tabId:Zu.color},(0,x.__)("Solid")),(0,s.createElement)(_.Tab,{tabId:Zu.gradient},(0,x.__)("Gradient"))),(0,s.createElement)(_.TabPanel,{tabId:Zu.color,className:"block-editor-color-gradient-control__panel",focusable:!1},v.color),(0,s.createElement)(_.TabPanel,{tabId:Zu.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1},v.gradient))),!b&&k(Zu.color),!f&&k(Zu.gradient))))}function Yu(e){const[t,n,o,r]=Ar("color.palette","color.gradients","color.custom","color.customGradient");return(0,s.createElement)(qu,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}const Xu=function(e){return Ku.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(qu,{...e}):(0,s.createElement)(Yu,{...e})};function Qu(e){const t=Ju(e),n=rd(e),o=ed(e),r=nd(e),l=od(e),i=td(e);return t||n||o||r||l||i}function Ju(e){const t=ul(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function ed(e){const t=ul(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function td(e){const t=ul(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function nd(e){const t=ul(e),n=dl(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function od(e){const t=ul(e),n=dl(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function rd(e){const t=ul(e),n=dl(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function ld({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(_l.__experimentalToolsPanel,{label:(0,x.__)("Color"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Qr},(0,s.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},r))}const id={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},sd={placement:"left-start",offset:36,shift:!0},ad=({indicators:e,label:t})=>(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(_l.__experimentalZStack,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,s.createElement)(_l.Flex,{key:t,expanded:!1},(0,s.createElement)(_l.ColorIndicator,{colorValue:e}))))),(0,s.createElement)(_l.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function cd({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,s.createElement)(Xu,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:o,onGradientChange:e?o:void 0,clearable:t===n,headingLevel:3})}function ud({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:l,colorGradientControlSettings:i,panelId:a}){const c=l.find((e=>void 0!==e.userValue)),{Tabs:u}=ie(_l.privateApis);return(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:a},(0,s.createElement)(_l.Dropdown,{popoverProps:sd,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:ml()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,x.sprintf)((0,x.__)("Color %s styles"),e)};return(0,s.createElement)(_l.Button,{...o},(0,s.createElement)(ad,{indicators:r,label:e}))},renderContent:()=>(0,s.createElement)(_l.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===l.length&&(0,s.createElement)(cd,{...l[0],colorGradientControlSettings:i}),l.length>1&&(0,s.createElement)(u,{initialTabId:c?.key},(0,s.createElement)(u.TabList,null,l.map((e=>(0,s.createElement)(u.Tab,{key:e.key,tabId:e.key},e.label)))),l.map((e=>(0,s.createElement)(u.TabPanel,{key:e.key,tabId:e.key,focusable:!1},(0,s.createElement)(cd,{...e,colorGradientControlSettings:i})))))))}))}function dd({as:e=ld,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=id,children:a}){const c=ul(r),d=dl(r),p=r?.color?.custom,m=r?.color?.customGradient,h=c.length>0||p,g=d.length>0||m,f=e=>el({settings:r},"",e),b=e=>{const t=c.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},v=e=>{const t=d.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},k=rd(r),_=f(o?.color?.background),y=f(t?.color?.background),E=f(o?.color?.gradient),w=f(t?.color?.gradient),S=ed(r),C=f(o?.elements?.link?.color?.text),B=f(t?.elements?.link?.color?.text),I=f(o?.elements?.link?.[":hover"]?.color?.text),T=f(t?.elements?.link?.[":hover"]?.color?.text),M=Ju(r),P=f(o?.color?.text),R=f(t?.color?.text),N=e=>{let o=jn(t,["color","text"],b(e));P===C&&(o=jn(o,["elements","link","color","text"],b(e))),n(o)},L=[{name:"caption",label:(0,x.__)("Captions"),showPanel:td(r)},{name:"button",label:(0,x.__)("Button"),showPanel:od(r)},{name:"heading",label:(0,x.__)("Heading"),showPanel:nd(r)},{name:"h1",label:(0,x.__)("H1"),showPanel:nd(r)},{name:"h2",label:(0,x.__)("H2"),showPanel:nd(r)},{name:"h3",label:(0,x.__)("H3"),showPanel:nd(r)},{name:"h4",label:(0,x.__)("H4"),showPanel:nd(r)},{name:"h5",label:(0,x.__)("H5"),showPanel:nd(r)},{name:"h6",label:(0,x.__)("H6"),showPanel:nd(r)}],A=(0,u.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...L.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),O=[M&&{key:"text",label:(0,x.__)("Text"),hasValue:()=>!!R,resetValue:()=>N(void 0),isShownByDefault:i.text,indicators:[P],tabs:[{key:"text",label:(0,x.__)("Text"),inheritedValue:P,setValue:N,userValue:R}]},k&&{key:"background",label:(0,x.__)("Background"),hasValue:()=>!!y||!!w,resetValue:()=>{const e=jn(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:i.background,indicators:[null!=E?E:_],tabs:[h&&{key:"background",label:(0,x.__)("Solid"),inheritedValue:_,setValue:e=>{const o=jn(t,["color","background"],b(e));o.color.gradient=void 0,n(o)},userValue:y},g&&{key:"gradient",label:(0,x.__)("Gradient"),inheritedValue:E,setValue:e=>{const o=jn(t,["color","gradient"],v(e));o.color.background=void 0,n(o)},userValue:w,isGradient:!0}].filter(Boolean)},S&&{key:"link",label:(0,x.__)("Link"),hasValue:()=>!!B||!!T,resetValue:()=>{let e=jn(t,["elements","link",":hover","color","text"],void 0);e=jn(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:i.link,indicators:[C,I],tabs:[{key:"link",label:(0,x.__)("Default"),inheritedValue:C,setValue:e=>{n(jn(t,["elements","link","color","text"],b(e)))},userValue:B},{key:"hover",label:(0,x.__)("Hover"),inheritedValue:I,setValue:e=>{n(jn(t,["elements","link",":hover","color","text"],b(e)))},userValue:T}]}].filter(Boolean);return L.forEach((({name:e,label:r,showPanel:l})=>{if(!l)return;const s=f(o?.elements?.[e]?.color?.background),a=f(o?.elements?.[e]?.color?.gradient),c=f(o?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),p=f(t?.elements?.[e]?.color?.text),m="caption"!==e;O.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=jn(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:i[e],indicators:m?[c,null!=a?a:s]:[c],tabs:[h&&{key:"text",label:(0,x.__)("Text"),inheritedValue:c,setValue:o=>{n(jn(t,["elements",e,"color","text"],b(o)))},userValue:p},h&&m&&{key:"background",label:(0,x.__)("Background"),inheritedValue:s,setValue:o=>{const r=jn(t,["elements",e,"color","background"],b(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},g&&m&&{key:"gradient",label:(0,x.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=jn(t,["elements",e,"color","gradient"],v(o));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,s.createElement)(e,{resetAllFilter:A,value:t,onChange:n,panelId:l},O.map((e=>(0,s.createElement)(ud,{key:e.key,...e,colorGradientControlSettings:{colors:c,disableCustomColors:!p,gradients:d,disableCustomGradients:!m},panelId:l}))),a)}Hc([Gc,jc]);const pd=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:l,textColor:i,linkColor:a,enableAlphaChecker:c=!1}){const u=e||t;if(!u)return null;const d=i||n,p=a||o;if(!d&&!p)return null;const m=[{color:d,description:(0,x.__)("text color")},{color:p,description:(0,x.__)("link color")}],h=Vc(u),g=h.alpha()<1,f=h.brightness(),b={level:"AA",size:l||!1!==l&&r>=24?"large":"small"};let v="",k="";for(const e of m){if(!e.color)continue;const t=Vc(e.color),n=t.isReadable(h,b),o=t.alpha()<1;if(!n){if(g||o)continue;v=f<t.brightness()?(0,x.sprintf)((0,x.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,x.sprintf)((0,x.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),k=(0,x.__)("This color combination may be hard for people to read.");break}o&&c&&(v=(0,x.__)("Transparent text may be hard for people to read."),k=(0,x.__)("Transparent text may be hard for people to read."))}return v?((0,vo.speak)(k),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(_l.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},v))):null},md=(0,u.createContext)({refs:new Map,callbacks:new Map});function hd({children:e}){const t=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(md.Provider,{value:t},e)}function gd(e){const{refs:t,callbacks:n}=(0,u.useContext)(md),o=(0,u.useRef)();return(0,u.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,p.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function fd(e){const{refs:t}=(0,u.useContext)(md),n=(0,u.useRef)();return n.current=e,(0,u.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function bd(e){const{callbacks:t}=(0,u.useContext)(md),n=fd(e),[o,r]=(0,u.useState)(null);return(0,u.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function vd(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function kd({clientId:e}){const[t,n]=(0,u.useState)(),[o,r]=(0,u.useState)(),[l,i]=(0,u.useState)(),a=fd(e);return(0,u.useEffect)((()=>{if(!a.current)return;r(vd(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&i(vd(e).color);let t=a.current,o=vd(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=vd(t).backgroundColor;n(o)})),(0,s.createElement)(pd,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:l})}const _d="color",yd=e=>{const t=(0,c.getBlockSupport)(e,_d);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Ed=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,c.getBlockSupport)(e,_d);return null!==t&&"object"==typeof t&&!!t.link},wd=e=>{const t=(0,c.getBlockSupport)(e,_d);return null!==t&&"object"==typeof t&&!!t.gradients},Sd=e=>{const t=(0,c.getBlockSupport)(e,_d);return t&&!1!==t.background},Cd=e=>{const t=(0,c.getBlockSupport)(e,_d);return t&&!1!==t.text};function xd(e,t,n){if(!yd(t)||fl(t,_d))return e;const o=wd(t),{backgroundColor:r,textColor:l,gradient:i,style:s}=n,a=e=>!fl(t,_d,e),c=a("text")?Zc("color",l):void 0,u=a("gradients")?Gu(i):void 0,d=a("background")?Zc("background-color",r):void 0,p=a("background")||a("gradients"),m=r||s?.color?.background||o&&(i||s?.color?.gradient),h=ml()(e.className,c,u,{[d]:!(o&&s?.color?.gradient||!d),"has-text-color":a("text")&&(l||s?.color?.text),"has-background":p&&m,"has-link-color":a("link")&&s?.elements?.link?.color});return e.className=h||void 0,e}function Bd(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,o=e?.color?.background,r=o?.startsWith("var:preset|color|")?o.substring(17):void 0,l=e?.color?.gradient,i=l?.startsWith("var:preset|gradient|")?l.substring(20):void 0,s={...e};return s.color={...s.color,text:n?void 0:t,background:r?void 0:o,gradient:i?void 0:l},{style:hl(s),textColor:n,backgroundColor:r,gradient:i}}function Id(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function Td({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=Id(e),o=t(n);return{...e,...Bd(o)}}),[t]);return(0,s.createElement)(Bs,{group:"color",resetAllFilter:n},e)}function Md({clientId:e,name:t,setAttributes:n,settings:o}){const r=Qu(o);const{style:l,textColor:i,backgroundColor:a,gradient:p}=(0,d.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:r,gradient:l}=t(Nr).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:l}}),[e]),m=(0,u.useMemo)((()=>Id({style:l,textColor:i,backgroundColor:a,gradient:p})),[l,i,a,p]);if(!r)return null;const h=(0,c.getBlockSupport)(t,[_d,"__experimentalDefaultControls"]),g="web"===u.Platform.OS&&!m?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,c.getBlockSupport)(t,[_d,"enableContrastChecker"]);return(0,s.createElement)(dd,{as:Td,panelId:e,settings:o,value:m,onChange:e=>{n(Bd(e))},defaultControls:h,enableContrastChecker:!1!==(0,c.getBlockSupport)(t,[_d,"enableContrastChecker"])},g&&(0,s.createElement)(kd,{clientId:e}))}const Pd={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[l,i,s]=Ar("color.palette.custom","color.palette.theme","color.palette.default"),a=(0,u.useMemo)((()=>[...l||[],...i||[],...s||[]]),[l,i,s]);if(!yd(e)||fl(e,_d))return{};const c={};n&&!fl(e,_d,"text")&&(c.color=Wc(a,n)?.color),t&&!fl(e,_d,"background")&&(c.backgroundColor=Wc(a,t)?.color);const d=xd({style:c},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:ml()(d.className,!p&&ic(r))}},addSaveProps:xd,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:yd},Rd={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function Nd({value:e="",onChange:t,fontFamilies:n,...o}){const[r]=Ar("typography.fontFamilies");if(n||(n=r),!n||0===n.length)return null;const l=[{value:"",label:(0,x.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,s.createElement)(_l.SelectControl,{label:(0,x.__)("Font"),options:l,value:e,onChange:t,labelPosition:"top",...o})}(0,m.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return yd(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),wd(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return gl({linkColor:Ed(r),textColor:Cd(r),backgroundColor:Sd(r),gradient:wd(r)},Rd,e,t,n,o)}));const Ld=[{name:(0,x._x)("Regular","font style"),value:"normal"},{name:(0,x._x)("Italic","font style"),value:"italic"}],Ad=[{name:(0,x._x)("Thin","font weight"),value:"100"},{name:(0,x._x)("Extra Light","font weight"),value:"200"},{name:(0,x._x)("Light","font weight"),value:"300"},{name:(0,x._x)("Regular","font weight"),value:"400"},{name:(0,x._x)("Medium","font weight"),value:"500"},{name:(0,x._x)("Semi Bold","font weight"),value:"600"},{name:(0,x._x)("Bold","font weight"),value:"700"},{name:(0,x._x)("Extra Bold","font weight"),value:"800"},{name:(0,x._x)("Black","font weight"),value:"900"}],Od=(e,t)=>e?t?(0,x.__)("Appearance"):(0,x.__)("Font style"):(0,x.__)("Font weight");function Dd(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...i}=e,a=n||o,c=Od(n,o),d={key:"default",name:(0,x.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return Ld.forEach((({name:t,value:n})=>{Ad.forEach((({name:o,value:r})=>{const l="normal"===n?o:(0,x.sprintf)((0,x.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:l,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[d];return Ld.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[d];return Ad.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),m=p.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||p[0];return a&&(0,s.createElement)(_l.CustomSelectControl,{...i,className:"components-font-appearance-control",label:c,describedBy:m?n?o?(0,x.sprintf)((0,x.__)("Currently selected font appearance: %s"),m.name):(0,x.sprintf)((0,x.__)("Currently selected font style: %s"),m.name):(0,x.sprintf)((0,x.__)("Currently selected font weight: %s"),m.name):(0,x.__)("No selected font appearance"),options:p,value:m,onChange:({selectedItem:e})=>t(e.style),__nextUnconstrainedWidth:!0})}const zd=1.5;const Vd=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:o="60px",...r})=>{const l=function(e){return void 0!==e&&""!==e}(e),i=(e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return zd;default:return e}},a=l?e:"";n||w()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const c=n?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:c},(0,s.createElement)(_l.__experimentalNumberControl,{...r,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=i(e.value,n);return{...e,value:o}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(i(`${e}`,!1)):t()},label:(0,x.__)("Line height"),placeholder:zd,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"}))};function Fd({value:e,onChange:t,__unstableInputWidth:n="60px",...o}){const[r]=Ar("spacing.units"),l=(0,_l.__experimentalUseCustomUnits)({availableUnits:r||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(_l.__experimentalUnitControl,{...o,label:(0,x.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:l,onChange:t})}const Hd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M7 11.5h10V13H7z"})),Gd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),Ud=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),$d=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),jd=[{name:(0,x.__)("None"),value:"none",icon:Hd},{name:(0,x.__)("Uppercase"),value:"uppercase",icon:Gd},{name:(0,x.__)("Lowercase"),value:"lowercase",icon:Ud},{name:(0,x.__)("Capitalize"),value:"capitalize",icon:$d}];function Wd({className:e,value:t,onChange:n}){return(0,s.createElement)("fieldset",{className:ml()("block-editor-text-transform-control",e)},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},jd.map((e=>(0,s.createElement)(_l.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Kd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),Zd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),qd=[{name:(0,x.__)("None"),value:"none",icon:Hd},{name:(0,x.__)("Underline"),value:"underline",icon:Kd},{name:(0,x.__)("Strikethrough"),value:"line-through",icon:Zd}];function Yd({value:e,onChange:t,className:n}){return(0,s.createElement)("fieldset",{className:ml()("block-editor-text-decoration-control",n)},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},qd.map((n=>(0,s.createElement)(_l.Button,{key:n.value,icon:n.icon,label:n.name,isPressed:n.value===e,onClick:()=>{t(n.value===e?void 0:n.value)}})))))}const Xd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z"})),Qd=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"})),Jd=[{name:(0,x.__)("Horizontal"),value:"horizontal-tb",icon:Xd},{name:(0,x.__)("Vertical"),value:(0,x.isRTL)()?"vertical-lr":"vertical-rl",icon:Qd}];function ep({className:e,value:t,onChange:n}){return(0,s.createElement)("fieldset",{className:ml()("block-editor-writing-mode-control",e)},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},(0,x.__)("Orientation")),(0,s.createElement)("div",{className:"block-editor-writing-mode-control__buttons"},Jd.map((e=>(0,s.createElement)(_l.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const tp=1,np=6;function op(e){const t=lp(e),n=ip(e),o=sp(e),r=ap(e),l=cp(e),i=up(e),s=dp(e),a=pp(e),c=rp(e);return t||n||o||r||l||c||i||s||a}function rp(e){return Jn(e?.typography?.fontSizes)||e?.typography?.customFontSize}function lp(e){return Jn(e?.typography?.fontFamilies)}function ip(e){return e?.typography?.lineHeight}function sp(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function ap(e){return e?.typography?.letterSpacing}function cp(e){return e?.typography?.textTransform}function up(e){return e?.typography?.textDecoration}function dp(e){return e?.typography?.writingMode}function pp(e){return e?.typography?.textColumns}function mp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(_l.__experimentalToolsPanel,{label:(0,x.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Qr},r)}const hp={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function gp({as:e=mp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=hp}){var a;const c=e=>el({settings:r},"",e),d=lp(r),p=null!==(a=r?.typography?.fontFamilies)&&void 0!==a?a:{},m=p?function(e){let t=Xn.get(e);return t||(t=["default","theme","custom"].flatMap((t=>{var n;return null!==(n=e[t])&&void 0!==n?n:[]})),Xn.set(e,t)),t}(p):[],h=c(o?.typography?.fontFamily),g=e=>{const o=m?.find((({fontFamily:t})=>t===e))?.slug;n(jn(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},f=rp(r),b=!r?.typography?.customFontSize,v=function(e){var t,n;const o=null!==(n=Qn(null!==(t=e?.typography?.fontSizes)&&void 0!==t?t:{}))&&void 0!==n?n:[],r=[];for(const e of o)r.some((({slug:t})=>t===e.slug))||r.push(e);return r}(r),k=c(o?.typography?.fontSize),_=(e,o)=>{n(jn(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},y=sp(r),E=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,x.__)("Appearance"):(0,x.__)("Font style"):(0,x.__)("Font weight")}(r),w=r?.typography?.fontStyle,S=r?.typography?.fontWeight,C=c(o?.typography?.fontStyle),B=c(o?.typography?.fontWeight),I=({fontStyle:e,fontWeight:o})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},T=ip(r),M=c(o?.typography?.lineHeight),P=e=>{n(jn(t,["typography","lineHeight"],e||void 0))},R=ap(r),N=c(o?.typography?.letterSpacing),L=e=>{n(jn(t,["typography","letterSpacing"],e||void 0))},A=pp(r),O=c(o?.typography?.textColumns),D=e=>{n(jn(t,["typography","textColumns"],e||void 0))},z=cp(r),V=c(o?.typography?.textTransform),F=e=>{n(jn(t,["typography","textTransform"],e||void 0))},H=up(r),G=c(o?.typography?.textDecoration),U=e=>{n(jn(t,["typography","textDecoration"],e||void 0))},$=dp(r),j=c(o?.typography?.writingMode),W=e=>{n(jn(t,["typography","writingMode"],e||void 0))},K=(0,u.useCallback)((e=>({...e,typography:{}})),[]);return(0,s.createElement)(e,{resetAllFilter:K,value:t,onChange:n,panelId:l},d&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Font family"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>g(void 0),isShownByDefault:i.fontFamily,panelId:l},(0,s.createElement)(Nd,{fontFamilies:m,value:h,onChange:g,size:"__unstable-large",__nextHasNoMarginBottom:!0})),f&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Font size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>_(void 0),isShownByDefault:i.fontSize,panelId:l},(0,s.createElement)(_l.FontSizePicker,{value:k,onChange:_,fontSizes:v,disableCustomFontSizes:b,withReset:!1,withSlider:!0,size:"__unstable-large"})),y&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:E,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{I({})},isShownByDefault:i.fontAppearance,panelId:l},(0,s.createElement)(Dd,{value:{fontStyle:C,fontWeight:B},onChange:I,hasFontStyles:w,hasFontWeights:S,size:"__unstable-large",__nextHasNoMarginBottom:!0})),T&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>P(void 0),isShownByDefault:i.lineHeight,panelId:l},(0,s.createElement)(Vd,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:M,onChange:P,size:"__unstable-large"})),R&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>L(void 0),isShownByDefault:i.letterSpacing,panelId:l},(0,s.createElement)(Fd,{value:N,onChange:L,size:"__unstable-large",__unstableInputWidth:"auto"})),A&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Text columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>D(void 0),isShownByDefault:i.textColumns,panelId:l},(0,s.createElement)(_l.__experimentalNumberControl,{label:(0,x.__)("Text columns"),max:np,min:tp,onChange:D,size:"__unstable-large",spinControls:"custom",value:O,initialPosition:1})),H&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Text decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>U(void 0),isShownByDefault:i.textDecoration,panelId:l},(0,s.createElement)(Yd,{value:G,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})),$&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Text orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>W(void 0),isShownByDefault:i.writingMode,panelId:l},(0,s.createElement)(ep,{value:j,onChange:W,size:"__unstable-large",__nextHasNoMarginBottom:!0})),z&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>F(void 0),isShownByDefault:i.textTransform,panelId:l},(0,s.createElement)(Wd,{value:V,onChange:F,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}const fp="typography.lineHeight";const bp=window.wp.tokenList;var vp=n.n(bp);const kp="typography.__experimentalFontFamily";function _p(e,t,n){if(!(0,c.hasBlockSupport)(t,kp))return e;if(fl(t,Mp,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(vp())(e.className),{kebabCase:r}=ie(_l.privateApis);o.add(`has-${r(n?.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}const yp={useBlockProps:function({name:e,fontFamily:t}){return _p({},e,{fontFamily:t})},addSaveProps:_p,attributeKeys:["fontFamily"],hasSupport:e=>(0,c.hasBlockSupport)(e,kp)};(0,m.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,c.hasBlockSupport)(e,kp)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const Ep=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function wp(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Sp(e){if(!e)return;const{kebabCase:t}=ie(_l.privateApis);return`has-${t(e)}-font-size`}const Cp="typography.fontSize";function xp(e,t,n){if(!(0,c.hasBlockSupport)(t,Cp))return e;if(fl(t,Mp,"fontSize"))return e;const o=new(vp())(e.className);o.add(Sp(n.fontSize));const r=o.value;return e.className=r||void 0,e}const Bp={useBlockProps:function({name:e,fontSize:t,style:n}){const[o,r,l]=Ar("typography.fontSizes","typography.fluid","layout");if(!(0,c.hasBlockSupport)(e,Cp)||fl(e,Mp,"fontSize")||!t&&!n?.typography?.fontSize)return;let i;if(n?.typography?.fontSize){const e=Zr({typography:{fluid:r},layout:l});i={style:{fontSize:Wr({size:n.typography.fontSize},e)}}}return t&&(i={style:{fontSize:Ep(o,t,n?.typography?.fontSize).size}}),i?xp(i,e,{fontSize:t}):void 0},addSaveProps:xp,attributeKeys:["fontSize","style"],hasSupport:e=>(0,c.hasBlockSupport)(e,Cp)},Ip={fontSize:[["fontSize"],["style","typography","fontSize"]]};function Tp(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}(0,m.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,c.hasBlockSupport)(e,Cp)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,m.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const r=e.name;return gl({fontSize:(0,c.hasBlockSupport)(r,Cp)},Ip,e,t,n,o)}));const Mp="typography",Pp=[fp,Cp,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",kp,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function Rp(e){const t={...Tp(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,l=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Tp(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:hl(t),fontFamily:l,fontSize:r}}function Np(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function Lp({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=Np(e),o=t(n);return{...e,...Rp(o)}}),[t]);return(0,s.createElement)(Bs,{group:"typography",resetAllFilter:n},e)}function Ap({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:l,fontSize:i}=(0,d.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:r}=t(Nr).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r}}),[e]),a=op(o),p=(0,u.useMemo)((()=>Np({style:r,fontFamily:l,fontSize:i})),[r,i,l]);if(!a)return null;const m=(0,c.getBlockSupport)(t,[Mp,"__experimentalDefaultControls"]);return(0,s.createElement)(gp,{as:Lp,panelId:e,settings:o,value:p,onChange:e=>{n(Rp(e))},defaultControls:m})}const Op=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,s.createElement)(Z.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})),Dp={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function zp({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,side:a,spacingSizes:c,type:m,value:h}){var g,f;h=Jl(h,c);let b=c;const v=c.length<=8,k=(0,d.useSelect)((e=>{const t=e(Nr).getSettings();return t?.disableCustomSpacingSizes})),[_,y]=(0,u.useState)(!k&&void 0!==h&&!Xl(h)),E=(0,p.usePrevious)(h);h&&E!==h&&!Xl(h)&&!0!==_&&y(!0);const[w]=Ar("spacing.units"),S=(0,_l.__experimentalUseCustomUnits)({availableUnits:w||["px","em","rem"]});let C=null;!v&&!_&&void 0!==h&&(!Xl(h)||Xl(h)&&t)?(b=[...c,{name:t?(0,x.__)("Mixed"):(0,x.sprintf)((0,x.__)("Custom (%s)"),h),slug:"custom",size:h}],C=b.length-1):t||(C=_?Ql(h,c):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":ti(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(h,c));const B=(0,u.useMemo)((()=>(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(C)),[C])[1]||S[0]?.value,I=parseFloat(C,10),T=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${c[e]?.slug}`},M=t?(0,x.__)("Mixed"):null,P=b.map(((e,t)=>({key:t,name:e.name}))),R=c.map(((e,t)=>({value:t,label:void 0}))),N=Wl.includes(a)&&i?ql[a]:"",L=i?m?.toLowerCase():m,A=(0,x.sprintf)((0,x.__)("%1$s %2$s"),N,L).trim();return(0,s.createElement)(_l.__experimentalHStack,{className:"spacing-sizes-control__wrapper"},e&&(0,s.createElement)(_l.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),_&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.__experimentalUnitControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:S,min:n,placeholder:M,disableUnits:t,label:A,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,s.createElement)(_l.RangeControl,{onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r,value:I,min:0,max:null!==(g=Dp[B]?.max)&&void 0!==g?g:10,step:null!==(f=Dp[B]?.steps)&&void 0!==f?f:.1,withInputField:!1,onChange:e=>{o([e,B].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),v&&!_&&(0,s.createElement)(_l.RangeControl,{onMouseOver:l,onMouseOut:r,className:"spacing-sizes-control__range-control",value:C,onChange:e=>o(T(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===h&&o("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":c[C]?.name,renderTooltipContent:e=>void 0===h?void 0:c[e]?.name,min:0,max:c.length-1,marks:R,label:A,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:l,onBlur:r}),!v&&!_&&(0,s.createElement)(_l.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:P.find((e=>e.key===C))||"",onChange:e=>{o(T(e.selectedItem.key,"selectList"))},options:P,label:A,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:l,onMouseOut:r,onFocus:l,onBlur:r}),!k&&(0,s.createElement)(_l.Button,{label:_?(0,x.__)("Use size preset"):(0,x.__)("Set custom size"),icon:Op,onClick:()=>{y(!_)},isPressed:_,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24}))}const Vp=["vertical","horizontal"];function Fp({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const c=e=>n=>{if(!t)return;const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Jl(a[t],l),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},u=r?.length?Vp.filter((e=>ni(r,e))):Vp;return(0,s.createElement)(s.Fragment,null,u.map((t=>{const r="vertical"===t?a.top:a.left;return(0,s.createElement)(zp,{key:`spacing-sizes-control-${t}`,icon:Zl[t],label:ql[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:r,withInputField:!1})})))}function Hp({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:l,type:i,values:a}){const c=r?.length?Wl.filter((e=>r.includes(e))):Wl,u=e=>n=>{const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Jl(a[t],l),e)),{})};o[e]=n,t(o)};return(0,s.createElement)(s.Fragment,null,c.map((t=>(0,s.createElement)(zp,{key:`spacing-sizes-control-${t}`,icon:Zl[t],label:ql[t],minimumCustomValue:e,onChange:u(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:l,type:i,value:a[t],withInputField:!1}))))}function Gp({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,values:c}){return(0,s.createElement)(zp,{label:ql[l],minimumCustomValue:e,onChange:(u=l,e=>{const n={...Object.keys(c).reduce(((e,t)=>(e[t]=Jl(c[t],i),e)),{})};n[u]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:l,spacingSizes:i,type:a,value:c[l],withInputField:!1});var u}const Up=(0,s.createElement)(_l.Icon,{icon:uu,size:24});function $p({label:e,onChange:t,sides:n,value:o}){if(!n||!n.length)return;const r=function(e){if(!e||!e.length)return{};const t={},n=ni(e,"horizontal"),o=ni(e,"vertical");n&&o?t.axial={label:ql.axial,icon:Zl.axial}:n?t.axial={label:ql.horizontal,icon:Zl.horizontal}:o&&(t.axial={label:ql.vertical,icon:Zl.vertical});let r=0;return Wl.forEach((n=>{e.includes(n)&&(r+=1,t[n]={label:ql[n],icon:Zl[n]})})),r>1&&(t.custom={label:ql.custom,icon:Zl.custom}),t}(n),l=r[o].icon,{custom:i,...a}=r;return(0,s.createElement)(_l.DropdownMenu,{icon:l,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{isSmall:!0}},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuGroup,null,Object.entries(a).map((([n,{label:r,icon:l}])=>{const i=o===n;return(0,s.createElement)(_l.MenuItem,{key:n,icon:l,iconPosition:"left",isSelected:i,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:i?Up:void 0},r)}))),!!i&&(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(_l.MenuItem,{icon:i.icon,iconPosition:"left",isSelected:o===Yl.custom,role:"menuitemradio",onClick:()=>{t(Yl.custom),e()},suffix:o===Yl.custom?Up:void 0},i.label)))))}function jp({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:l,showSideInLabel:i=!0,sides:a=Wl,useSelect:c,values:d}){const p=function(){const e=[{name:0,slug:"0",size:0}],[t]=Ar("spacing.spacingSizes");return t&&e.push(...t),e.length>8&&e.unshift({name:(0,x.__)("Default"),slug:"default",size:void 0}),e}(),m=d||Kl,h=1===a?.length,g=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,b]=(0,u.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:l}=e,i=[n,o,r,l].filter(Boolean),s=!(n!==r||l!==o||!n&&!l),a=!i.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(ni(t)&&(s||a))return Yl.axial;if(1===i.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||i.length?Yl.custom:t[0]}(m,a)),v={...e,minimumCustomValue:n,onChange:e=>{const t={...d,...e};o(t)},onMouseOut:r,onMouseOver:l,sides:a,spacingSizes:p,type:t,useSelect:c,values:m},k=Wl.includes(f)&&i?ql[f]:"",_=(0,x.sprintf)((0,x.__)("%1$s %2$s"),t,k).trim(),y=(0,x.sprintf)((0,x._x)("%s options","Button label to reveal side configuration options"),t);return(0,s.createElement)("fieldset",{className:"spacing-sizes-control"},(0,s.createElement)(_l.__experimentalHStack,{className:"spacing-sizes-control__header"},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label"},_),!h&&!g&&(0,s.createElement)($p,{label:y,onChange:b,sides:a,value:f})),(0,s.createElement)(_l.__experimentalVStack,{spacing:.5},f===Yl.axial?(0,s.createElement)(Fp,{...v}):f===Yl.custom?(0,s.createElement)(Hp,{...v}):(0,s.createElement)(Gp,{side:f,...v,showSideInLabel:i})))}const Wp={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function Kp({label:e=(0,x.__)("Height"),onChange:t,value:n}){var o,r;const l=parseFloat(n),[i]=Ar("spacing.units"),a=(0,_l.__experimentalUseCustomUnits)({availableUnits:i||["%","px","em","rem","vh","vw"]}),c=(0,u.useMemo)((()=>(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||a[0]?.value||"px";return(0,s.createElement)("fieldset",{className:"block-editor-height-control"},(0,s.createElement)(_l.BaseControl.VisualLabel,{as:"legend"},e),(0,s.createElement)(_l.Flex,null,(0,s.createElement)(_l.FlexItem,{isBlock:!0},(0,s.createElement)(_l.__experimentalUnitControl,{value:n,units:a,onChange:t,onUnitChange:e=>{const[o,r]=(0,_l.__experimentalParseQuantityAndUnitFromRawValue)(n);["em","rem"].includes(e)&&"px"===r?t((o/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*o)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&o>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})),(0,s.createElement)(_l.FlexItem,{isBlock:!0},(0,s.createElement)(_l.__experimentalSpacer,{marginX:2,marginBottom:0},(0,s.createElement)(_l.RangeControl,{value:l,min:0,max:null!==(o=Wp[c]?.max)&&void 0!==o?o:100,step:null!==(r=Wp[c]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,c].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})))))}function Zp(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,x.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,x.__)("Specify a fixed width."):"fixed"===e?(0,x.__)("Specify a fixed height."):(0,x.__)("Fit contents.")}function qp({value:e={},onChange:t,parentLayout:n}){const{selfStretch:o,flexSize:r}=e;return(0,u.useEffect)((()=>{"fixed"!==o||r||t({...e,selfStretch:"fit"})}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:Yp(n),value:o||"fit",help:Zp(o,n),onChange:n=>{const o="fixed"!==n?null:r;t({...e,selfStretch:n,flexSize:o})},isBlock:!0},(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,x.__)("Fit")}),(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,x.__)("Fill")}),(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,x.__)("Fixed")})),"fixed"===o&&(0,s.createElement)(_l.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,flexSize:n})},value:r}))}function Yp(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,x.__)("Width"):(0,x.__)("Height")}const Xp=[{label:(0,x._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},{label:(0,x._x)("Square - 1:1","Aspect ratio option for dimensions control"),value:"1"},{label:(0,x._x)("Standard - 4:3","Aspect ratio option for dimensions control"),value:"4/3"},{label:(0,x._x)("Portrait - 3:4","Aspect ratio option for dimensions control"),value:"3/4"},{label:(0,x._x)("Classic - 3:2","Aspect ratio option for dimensions control"),value:"3/2"},{label:(0,x._x)("Classic Portrait - 2:3","Aspect ratio option for dimensions control"),value:"2/3"},{label:(0,x._x)("Wide - 16:9","Aspect ratio option for dimensions control"),value:"16/9"},{label:(0,x._x)("Tall - 9:16","Aspect ratio option for dimensions control"),value:"9/16"},{label:(0,x._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];function Qp({panelId:e,value:t,onChange:n=(()=>{}),options:o=Xp,defaultValue:r=Xp[0].value,hasValue:l,isShownByDefault:i=!0}){const a=null!=t?t:"auto";return(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:l||(()=>a!==r),label:(0,x.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e},(0,s.createElement)(_l.SelectControl,{label:(0,x.__)("Aspect ratio"),value:a,options:o,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0}))}const Jp=["horizontal","vertical"];function em(e){const t=tm(e),n=nm(e),o=om(e),r=rm(e),l=lm(e),i=im(e),s=sm(e),a=am(e);return"web"===u.Platform.OS&&(t||n||o||r||l||i||s||a)}function tm(e){return e?.layout?.contentSize}function nm(e){return e?.layout?.wideSize}function om(e){return e?.spacing?.padding}function rm(e){return e?.spacing?.margin}function lm(e){return e?.spacing?.blockGap}function im(e){return e?.dimensions?.minHeight}function sm(e){return e?.dimensions?.aspectRatio}function am(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},l=("flex"===o||"flex"===n)&&r;return!!e?.layout&&l}function cm(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function um(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function dm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(_l.__experimentalToolsPanel,{label:(0,x.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Qr},r)}const pm={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function mm({as:e=dm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=pm,onVisualize:a=(()=>{}),includeLayoutControls:c=!1}){var d,p,m,h,g,f,b,v,k;const{dimensions:_,spacing:y}=r,E=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=el({settings:{dimensions:_,spacing:y}},"",e[n]),t)),{}):el({settings:{dimensions:_,spacing:y}},"",e),w=function(e){var t,n;const{custom:o,theme:r,default:l}=e?.spacing?.spacingSizes||{};return(null!==(t=null!==(n=null!=o?o:r)&&void 0!==n?n:l)&&void 0!==t?t:[]).length>0}(r),S=(0,_l.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),C=tm(r)&&c,B=E(o?.layout?.contentSize),I=e=>{n(jn(t,["layout","contentSize"],e||void 0))},T=nm(r)&&c,M=E(o?.layout?.wideSize),P=e=>{n(jn(t,["layout","wideSize"],e||void 0))},R=om(r),N=um(E(o?.spacing?.padding)),L=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,A=L&&L.some((e=>Jp.includes(e))),O=e=>{const o=cm(e,L);n(jn(t,["spacing","padding"],o))},D=()=>a("padding"),z=rm(r),V=um(E(o?.spacing?.margin)),F=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,H=F&&F.some((e=>Jp.includes(e))),G=e=>{const o=cm(e,F);n(jn(t,["spacing","margin"],o))},U=()=>a("margin"),$=lm(r),j=E(o?.spacing?.blockGap),W=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(j),K=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,Z=K&&K.some((e=>Jp.includes(e))),q=e=>{n(jn(t,["spacing","blockGap"],e))},Y=e=>{e||q(null),!Z&&e?.hasOwnProperty("top")?q(e.top):q({top:e?.top,left:e?.left})},X=im(r),Q=E(o?.dimensions?.minHeight),J=e=>{const o=jn(t,["dimensions","minHeight"],e);n(jn(o,["dimensions","aspectRatio"],void 0))},ee=sm(r),te=E(o?.dimensions?.aspectRatio),ne=am(r),oe=o?.layout,{orientation:re="horizontal"}=null!==(d=r?.parentLayout)&&void 0!==d?d:{},le="horizontal"===re?(0,x.__)("Width"):(0,x.__)("Height"),ie=e=>{n({...t,layout:{...t?.layout,...e}})},se=(0,u.useCallback)((e=>({...e,layout:hl({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),ae=()=>a(!1);return(0,s.createElement)(e,{resetAllFilter:se,value:t,onChange:n,panelId:l},(C||T)&&(0,s.createElement)("span",{className:"span-columns"},(0,x.__)("Set the width of the main content area.")),C&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>I(void 0),isShownByDefault:null!==(p=i.contentSize)&&void 0!==p?p:pm.contentSize,panelId:l},(0,s.createElement)(_l.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(_l.__experimentalUnitControl,{label:(0,x.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:B||"",onChange:e=>{I(e)},units:S}),(0,s.createElement)(_l.__experimentalView,null,(0,s.createElement)(Ti,{icon:Mi})))),T&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{className:"single-column",label:(0,x.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>P(void 0),isShownByDefault:null!==(m=i.wideSize)&&void 0!==m?m:pm.wideSize,panelId:l},(0,s.createElement)(_l.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(_l.__experimentalUnitControl,{label:(0,x.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:M||"",onChange:e=>{P(e)},units:S}),(0,s.createElement)(_l.__experimentalView,null,(0,s.createElement)(Ti,{icon:Pi})))),R&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,x.__)("Padding"),onDeselect:()=>O(void 0),isShownByDefault:null!==(h=i.padding)&&void 0!==h?h:pm.padding,className:ml()({"tools-panel-item-spacing":w}),panelId:l},!w&&(0,s.createElement)(_l.__experimentalBoxControl,{values:N,onChange:O,label:(0,x.__)("Padding"),sides:L,units:S,allowReset:!1,splitOnAxis:A,onMouseOver:D,onMouseOut:ae}),w&&(0,s.createElement)(jp,{values:N,onChange:O,label:(0,x.__)("Padding"),sides:L,units:S,allowReset:!1,onMouseOver:D,onMouseOut:ae})),z&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,x.__)("Margin"),onDeselect:()=>G(void 0),isShownByDefault:null!==(g=i.margin)&&void 0!==g?g:pm.margin,className:ml()({"tools-panel-item-spacing":w}),panelId:l},!w&&(0,s.createElement)(_l.__experimentalBoxControl,{values:V,onChange:G,label:(0,x.__)("Margin"),sides:F,units:S,allowReset:!1,splitOnAxis:H,onMouseOver:U,onMouseOut:ae}),w&&(0,s.createElement)(jp,{values:V,onChange:G,label:(0,x.__)("Margin"),sides:F,units:S,allowReset:!1,onMouseOver:U,onMouseOut:ae})),$&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,x.__)("Block spacing"),onDeselect:()=>q(void 0),isShownByDefault:null!==(f=i.blockGap)&&void 0!==f?f:pm.blockGap,className:ml()({"tools-panel-item-spacing":w}),panelId:l},!w&&(Z?(0,s.createElement)(_l.__experimentalBoxControl,{label:(0,x.__)("Block spacing"),min:0,onChange:Y,units:S,sides:K,values:W,allowReset:!1,splitOnAxis:Z}):(0,s.createElement)(_l.__experimentalUnitControl,{label:(0,x.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:q,units:S,value:j})),w&&(0,s.createElement)(jp,{label:(0,x.__)("Block spacing"),min:0,onChange:Y,showSideInLabel:!1,sides:Z?K:["top"],values:W,allowReset:!1})),X&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,x.__)("Minimum height"),onDeselect:()=>{J(void 0)},isShownByDefault:null!==(b=i.minHeight)&&void 0!==b?b:pm.minHeight,panelId:l},(0,s.createElement)(Kp,{label:(0,x.__)("Minimum height"),value:Q,onChange:J})),ee&&(0,s.createElement)(Qp,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:te,onChange:e=>{const o=jn(t,["dimensions","aspectRatio"],e);n(jn(o,["dimensions","minHeight"],void 0))},panelId:l,isShownByDefault:null!==(v=i.aspectRatio)&&void 0!==v?v:pm.aspectRatio}),ne&&(0,s.createElement)(_l.__experimentalVStack,{as:_l.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!t?.layout,label:le,onDeselect:()=>{ie({selfStretch:void 0,flexSize:void 0})},isShownByDefault:null!==(k=i.childLayout)&&void 0!==k?k:pm.childLayout,panelId:l},(0,s.createElement)(qp,{value:oe,onChange:ie,parentLayout:r?.parentLayout})))}const hm=function(e){return(0,p.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])},gm=Number.MAX_SAFE_INTEGER;const fm=(0,u.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:r=!1,__unstablePopoverSlot:l,__unstableContentRef:i,shift:a=!0,...c},d){const m=bd(e),h=bd(null!=t?t:e),g=(0,p.useMergeRefs)([d,hm(i)]),[f,b]=(0,u.useReducer)((e=>(e+1)%gm),0);(0,u.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(b);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]);const v=(0,u.useMemo)((()=>f<0||!m||h!==m?{}:{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}),[m,h,o,f]),k=(0,u.useMemo)((()=>{if(!(f<0||!m||t&&!h))return{getBoundingClientRect(){var e,t,n,o;const r=m.getBoundingClientRect(),l=h?.getBoundingClientRect(),i=Math.min(r.left,null!==(e=l?.left)&&void 0!==e?e:1/0),s=Math.min(r.top,null!==(t=l?.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=l.right)&&void 0!==n?n:-1/0)-i,c=Math.max(r.bottom,null!==(o=l.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(i,s,a,c)},contextElement:m}}),[t,h,m,f]);return!m||t&&!h?null:(0,s.createElement)(_l.Popover,{ref:g,animate:!1,focusOnMount:!1,anchor:k,__unstableSlotName:l,inline:!l,placement:"top-start",resize:!1,flip:!1,shift:a,...c,className:ml()("block-editor-block-popover",c.className),variant:"unstyled"},r&&(0,s.createElement)("div",{style:v},n),!r&&n)}));function bm(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function vm({clientId:e,attributes:t,forceShow:n}){const o=bd(e),[r,l]=(0,u.useState)(),i=t?.style?.spacing?.margin;(0,u.useEffect)((()=>{if(!o||null===o.ownerDocument.defaultView)return;const e=bm(o,"margin-top"),t=bm(o,"margin-right"),n=bm(o,"margin-bottom"),r=bm(o,"margin-left");l({borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:r,top:e?`-${e}`:0,right:t?`-${t}`:0,bottom:n?`-${n}`:0,left:r?`-${r}`:0})}),[o,i]);const[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(js()(i,d.current)||n||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,n]),a||n?(0,s.createElement)(fm,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}function km(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function _m({clientId:e,value:t,forceShow:n}){const o=bd(e),[r,l]=(0,u.useState)(),i=t?.spacing?.padding;(0,u.useEffect)((()=>{o&&null!==o.ownerDocument.defaultView&&l({borderTopWidth:km(o,"padding-top"),borderRightWidth:km(o,"padding-right"),borderBottomWidth:km(o,"padding-bottom"),borderLeftWidth:km(o,"padding-left")})}),[o,i]);const[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(i),p=(0,u.useRef)();return(0,u.useEffect)((()=>(js()(i,d.current)||n||(c(!0),d.current=i,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[i,n]),a||n?(0,s.createElement)(fm,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:i,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}const ym="dimensions",Em="spacing";function wm({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=e.style,o=t(n);return{...e,style:o}}),[t]);return(0,s.createElement)(Bs,{group:"dimensions",resetAllFilter:n},e)}function Sm({clientId:e,name:t,setAttributes:n,settings:o}){const r=em(o),l=(0,d.useSelect)((t=>t(Nr).getBlockAttributes(e)?.style),[e]),[i,a]=function(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=ie((0,d.useDispatch)(Nr));return(0,u.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const p={...(0,c.getBlockSupport)(t,[ym,"__experimentalDefaultControls"]),...(0,c.getBlockSupport)(t,[Em,"__experimentalDefaultControls"])};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(mm,{as:wm,panelId:e,settings:o,value:l,onChange:e=>{n({style:hl(e)})},defaultControls:p,onVisualize:a}),!!o?.spacing?.padding&&(0,s.createElement)(_m,{forceShow:"padding"===i,clientId:e,value:l}),!!o?.spacing?.margin&&(0,s.createElement)(vm,{forceShow:"margin"===i,clientId:e,value:l}))}function Cm(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,ym);return!0===n||("any"===t?!(!n?.aspectRatio&&!n?.minHeight):!!n?.[t])}const xm={useBlockProps:function({name:e,minHeight:t,style:n}){if(!Cm(e,"aspectRatio")||fl(e,ym,"aspectRatio"))return{};const o=ml()({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),r={};n?.dimensions?.aspectRatio?r.minHeight="unset":(t||n?.dimensions?.minHeight)&&(r.aspectRatio="unset");return{className:o,style:r}},attributeKeys:["minHeight","style"],hasSupport:e=>Cm(e,"aspectRatio")};function Bm(){w()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const Im=[...Pp,Iu,_d,ym,tc,Em,Tu],Tm=e=>Im.some((t=>(0,c.hasBlockSupport)(e,t)));function Mm(e={}){const t={};return(0,Ri.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const Pm={[`${Iu}.__experimentalSkipSerialization`]:["border"],[`${_d}.__experimentalSkipSerialization`]:[_d],[`${Mp}.__experimentalSkipSerialization`]:[Mp],[`${ym}.__experimentalSkipSerialization`]:[ym],[`${Em}.__experimentalSkipSerialization`]:[Em],[`${Tu}.__experimentalSkipSerialization`]:[Tu]},Rm={...Pm,[`${ym}.aspectRatio`]:[`${ym}.aspectRatio`],[`${tc}`]:[tc]},Nm={[`${ym}.aspectRatio`]:!0,[`${tc}`]:!0},Lm={gradients:"gradient"};function Am(e,t,n=!1){if(!e)return e;let o=e;return n||(o=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;Am(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function Om(e,t,n,o=Rm){if(!Tm(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=Nm[e]||(0,c.getBlockSupport)(t,e);!0===o&&(r=Am(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=Lm[e]||e;r=Am(r,[[...n,t]])}))})),e.style={...Mm(r),...e.style},e}const Dm={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r={clientId:e,name:t,setAttributes:n,settings:vl(t,o)};return"default"!==ns()?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Md,{...r}),(0,s.createElement)(pc,{...r}),(0,s.createElement)(Ap,{...r}),(0,s.createElement)(Ou,{...r}),(0,s.createElement)(Sm,{...r}))},hasSupport:Tm,addSaveProps:Om,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const o=`wp-elements-${(0,p.useInstanceId)(e)}`,r=`.editor-styles-wrapper .${o}`,l=n?.elements,i=(0,u.useMemo)((()=>{if(!l)return;const e=[];return zm.forEach((({elementType:n,pseudo:o,elements:i})=>{if(fl(t,_d,n))return;const s=l?.[n];if(s){const t=tl(r,c.__EXPERIMENTAL_ELEMENTS[n]);e.push((0,Ri.compileCSS)(s,{selector:t})),o&&o.forEach((t=>{s[t]&&e.push((0,Ri.compileCSS)(s[t],{selector:tl(r,`${c.__EXPERIMENTAL_ELEMENTS[n]}${t}`)}))}))}i&&i.forEach((t=>{l[t]&&e.push((0,Ri.compileCSS)(l[t],{selector:tl(r,c.__EXPERIMENTAL_ELEMENTS[t])}))}))})),e.length>0?e.join(""):void 0}),[r,l,t]);return bl({css:i}),Om({className:o},t,{style:n},Pm)}},zm=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}];(0,m.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Tm(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));(0,m.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return t=e,(0,c.hasBlockSupport)(t,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e;var t}));const Vm=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"}));const Fm=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}){let c;c="unset"===i?(0,s.createElement)(_l.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(_l.DuotoneSwatch,{values:i}):(0,s.createElement)(Ti,{icon:Vm});const u=(0,x.__)("Apply duotone filter"),d=`${(0,p.useInstanceId)(e,"duotone-control",t)}__description`;return(0,s.createElement)(_l.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,x.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(_l.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==zs.DOWN||(n.preventDefault(),t())},label:u,icon:c}),renderContent:()=>(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Duotone")},(0,s.createElement)("p",null,(0,x.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(_l.DuotonePicker,{"aria-label":u,"aria-describedby":d,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})};function Hm(e){return`${e}{filter:none}`}function Gm(e,t){return`${e}{filter:url(#${t})}`}function Um(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Vc(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}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}function $m(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:l,supports:i}=e,s=l&&Object.keys(l).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&l.root?l?.root:i?.__experimentalSelector?i.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===a)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=o?c:null;if(s){return Wn(l,`${a}.root`,null)||Wn(l,a,null)||e}const t=Wn(i,`${a}.__experimentalSelector`,null);return t?tl(c,t):e}let d;return s&&(d=Wn(l,a,null)),d||(o?$m(e,u[0],n):null)}const jm=[];function Wm(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||jm,l=e?.color?.[t]?.theme||jm,i=e?.color?.[t]?.default||jm;return(0,u.useMemo)((()=>[...r,...l,...o?jm:i]),[o,r,l,i])}function Km(e){return Zm(e)}function Zm(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function qm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(_l.__experimentalToolsPanel,{label:(0,x._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Qr},r)}const Ym={duotone:!0},Xm={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,x.__)("Duotone")},Qm=({indicator:e,label:t})=>(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(_l.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(_l.Flex,{expanded:!1},"unset"!==e&&e?(0,s.createElement)(_l.DuotoneSwatch,{values:e}):(0,s.createElement)(_l.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}))),(0,s.createElement)(_l.FlexItem,{title:t},t));function Jm({as:e=qm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=Ym}){const a=Zm(r),c=Wm(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=Wm(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=(m=o?.filter?.duotone,el({settings:r},"",m));var m;const h=e=>{const o=c.find((({colors:t})=>t===e)),r=o?`var:preset|duotone|${o.slug}`:e;n(jn(t,["filter","duotone"],r))},g=(0,u.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,s.createElement)(e,{resetAllFilter:g,value:t,onChange:n,panelId:l},a&&(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:i.duotone,panelId:l},(0,s.createElement)(_l.Dropdown,{popoverProps:Xm,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:ml()({"is-open":t}),"aria-expanded":t};return(0,s.createElement)(_l.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(_l.Button,{...n},(0,s.createElement)(Qm,{indicator:p,label:(0,x.__)("Duotone")})))},renderContent:()=>(0,s.createElement)(_l.__experimentalDropdownContentWrapper,{paddingSize:"small"},(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Duotone")},(0,s.createElement)("p",null,(0,x.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(_l.DuotonePicker,{colorPalette:d,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:h})))})))}const eh=[],th=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function nh({presetSetting:e,defaultSetting:t}){const[n,o,r,l]=Ar(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,u.useMemo)((()=>[...o||eh,...r||eh,...n&&l||eh]),[n,o,r,l])}function oh(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}Hc([Gc]);const rh={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=vl(n),l=ns(),i=nh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=nh({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=Ar("color.custom","color.customDuotone"),d=!c,p=!u||0===a?.length&&d;if(0===i?.length&&p)return null;if("default"!==l)return null;const m=Array.isArray(o)?o:oh(o,i);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bs,{group:"filter"},(0,s.createElement)(Jm,{value:{filter:{duotone:m}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:o})},settings:r})),(0,s.createElement)(Bl,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Fm,{duotonePalette:i,colorPalette:a,disableCustomDuotone:p,disableCustomColors:d,value:m,onChange:n=>{const o=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,i),r={...e,color:{...e?.color,duotone:null!=o?o:n}};t({style:r})},settings:r})))},useBlockProps:function e({name:t,style:n}){const o=(0,p.useInstanceId)(e),r=(0,u.useMemo)((()=>{const e=(0,c.getBlockType)(t);if(e){if(!(0,c.getBlockSupport)(e,"filter.duotone",!1))return null;const t=(0,c.getBlockSupport)(e,"color.__experimentalDuotone",!1);if(t){const n=$m(e);return"string"==typeof t?tl(n,t):n}return $m(e,"filter.duotone",{fallback:!0})}}),[t]),l=n?.color?.duotone,i=`wp-duotone-${o}`,s=r&&l;return lh({clientId:o,id:i,selector:r,attribute:l}),{className:s?i:""}},attributeKeys:["style"],hasSupport:e=>(0,c.hasBlockSupport)(e,"filter.duotone")};function lh({clientId:e,id:t,selector:n,attribute:o}){const r=nh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),l=Array.isArray(o),i=l?void 0:oh(o,r),s="string"==typeof o&&i;let a=null;s?a=i:("string"==typeof o&&!s||l)&&(a=o);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(a)||"unset"===a;bl(d?{css:"unset"!==a?Gm(c,t):Hm(c),__unstableType:"presets"}:void 0),bl(d?{assets:"unset"!==a?Um(t,a):"",__unstableType:"svgs"}:void 0);const p=bd(e);(0,u.useEffect)((()=>{if(d&&p&&th){const e=p.style.display;p.style.display="inline-block",p.offsetHeight,p.style.display=e}}),[d,p])}function ih(e){return(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t(Nr),{getBlockType:l,getActiveBlockVariation:i}=t(c.store),s=n(e),a=l(s);if(!a)return null;const u=o(e),d=i(s,u),p=(0,c.isReusableBlock)(a),m=(p?r(u.ref):void 0)||a.title,h=p||(0,c.isTemplatePart)(a),g=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,x.__)("Sticky"):"fixed"===t?(0,x.__)("Fixed"):null}(u),f={isSynced:h,title:m,icon:a.icon,description:a.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name};return d?{isSynced:h,title:d.title||a.title,icon:d.icon||a.icon,description:d.description||a.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name}:f}),[e])}(0,m.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,c.hasBlockSupport)(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const{CustomSelectControl:sh}=ie(_l.privateApis),ah="position",ch="block-editor-hooks__position-selection__select-control__option",uh={key:"default",value:"",name:(0,x.__)("Default"),className:ch},dh={key:"sticky",value:"sticky",name:(0,x._x)("Sticky","Name for the value of the CSS position property"),className:ch,__experimentalHint:(0,x.__)("The block will stick to the top of the window instead of scrolling.")},ph={key:"fixed",value:"fixed",name:(0,x._x)("Fixed","Name for the value of the CSS position property"),className:ch,__experimentalHint:(0,x.__)("The block will not move when the page is scrolled.")},mh=["top","right","bottom","left"],hh=["sticky","fixed"];function gh(e){const t=e.style?.position?.type;return"sticky"===t||"fixed"===t}function fh({name:e}={}){const[t,n]=Ar("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,c.getBlockSupport)(r,ah)||o;var r}function bh({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,c.getBlockSupport)(e,ah);return!(!0!==t&&!t?.fixed)}(n),l=function(e){const t=(0,c.getBlockSupport)(e,ah);return!(!0!==t&&!t?.sticky)}(n),i=e?.position?.type,{firstParentClientId:a}=(0,d.useSelect)((e=>{const{getBlockParents:n}=e(Nr),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),p=ih(a),m=l&&i===dh.value&&p?(0,x.sprintf)((0,x.__)("The block will stick to the scrollable area of the parent %s block."),p.title):null,h=(0,u.useMemo)((()=>{const e=[uh];return(l||i===dh.value)&&e.push(dh),(r||i===ph.value)&&e.push(ph),e}),[r,l,i]),g=i&&h.find((e=>e.value===i))||uh;return u.Platform.select({web:h.length>1?(0,s.createElement)(Bs,{group:"position"},(0,s.createElement)(_l.BaseControl,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:m},(0,s.createElement)(sh,{__nextUnconstrainedWidth:!0,__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,x.__)("Position"),hideLabelFromVision:!0,describedBy:(0,x.sprintf)((0,x.__)("Currently selected position: %s"),g.name),options:h,value:g,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:hl(n)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const vh={edit:function(e){return fh(e)?null:(0,s.createElement)(bh,{...e})},useBlockProps:function e({name:t,style:n}){const o=(0,c.hasBlockSupport)(t,ah),r=fh({name:t}),l=o&&!r,i=(0,p.useInstanceId)(e),s=`.wp-container-${i}.wp-container-${i}`;let a;l&&(a=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return hh.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,mh.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(n+="z-index: 10"),n+="}",n):n}({selector:s,style:n})||"");const u=ml()({[`wp-container-${i}`]:l&&!!a,[`is-position-${n?.position?.type}`]:l&&!!a&&!!n?.position?.type});return bl({css:a}),{className:u}},attributeKeys:["style"],hasSupport:e=>(0,c.hasBlockSupport)(e,ah)};const kh="layout";function _h(e){return(0,c.hasBlockSupport)(e,"layout")||(0,c.hasBlockSupport)(e,"__experimentalLayout")}function yh(e={},t=""){const{kebabCase:n}=ie(_l.privateApis),o=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return t().__experimentalFeatures?.useRootPaddingAwareAlignments}),[]),{layout:r}=e,{default:l}=(0,c.getBlockSupport)(t,kh)||{},i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||l||{},s=[];if(Al[i?.type||"default"]?.className){const e=Al[i?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;s.push(e,o)}return(i?.inherit||i?.contentSize||"constrained"===i?.type)&&o&&s.push("has-global-padding"),i?.orientation&&s.push(`is-${n(i.orientation)}`),i?.justifyContent&&s.push(`is-content-justification-${n(i.justifyContent)}`),i?.flexWrap&&"nowrap"===i.flexWrap&&s.push("is-nowrap"),s}const Eh={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n}){const o=vl(n),{layout:r}=o,[l]=Ar("layout"),{themeSupportsLayout:i}=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==ns())return null;const a=(0,c.getBlockSupport)(n,kh,{}),u={...r,...a},{allowSwitching:p,allowEditing:m=!0,allowInheriting:h=!0,default:g}=u;if(!m)return null;const f=!(!h||!l||e?.type&&"default"!==e?.type&&"constrained"!==e?.type&&!e?.inherit),b=e||g||{},{inherit:v=!1,type:k="default",contentSize:_=null}=b;if(("default"===k||"constrained"===k)&&!i)return null;const y=Vi(k),E=Vi("constrained"),w=!b.type&&(_||v),S=!!v||!!_,C=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bs,null,(0,s.createElement)(_l.PanelBody,{title:(0,x.__)("Layout")},f&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,x.__)("Inner blocks use content width"),checked:"constrained"===y?.name||S,onChange:()=>t({layout:{type:"constrained"===y?.name||S?"default":"constrained"}}),help:"constrained"===y?.name||S?(0,x.__)("Nested blocks use content width with options for full and wide widths."):(0,x.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!v&&p&&(0,s.createElement)(wh,{type:k,onChange:e=>t({layout:{type:e}})}),y&&"default"!==y.name&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:C,layoutBlockSupport:u}),E&&w&&(0,s.createElement)(E.inspectorControls,{layout:b,onChange:C,layoutBlockSupport:u}))),!v&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:C,layoutBlockSupport:a}))},attributeKeys:["layout"],hasSupport:e=>_h(e)};function wh({type:e,onChange:t}){return(0,s.createElement)(_l.ButtonGroup,null,zi.map((({name:n,label:o})=>(0,s.createElement)(_l.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}function Sh({block:e,props:t}){const{name:n,attributes:o}=t,r=(0,p.useInstanceId)(e),{layout:l}=o,{default:i}=(0,c.getBlockSupport)(n,kh)||{},a=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||i||{},u=yh(o,n),{kebabCase:d}=ie(_l.privateApis),m=`wp-container-${d(n)}-is-layout-`,h=`.${m}${r}.${m}${r}`,[g]=Ar("spacing.blockGap"),f=null!==g,b=Vi(a?.type||"default"),v=b?.getLayoutStyle?.({blockName:n,selector:h,layout:a,style:o?.style,hasBlockGapSupport:f}),k=ml()({[`${m}${r}`]:!!v},u);return bl({css:v}),(0,s.createElement)(e,{...t,__unstableLayoutClassNames:k})}const Ch=(0,p.createHigherOrderComponent)((e=>t=>{const n=_h(t.name);return(0,d.useSelect)((e=>!!n&&!e(Nr).getSettings().disableLayoutStyles),[n])?(0,s.createElement)(Sh,{block:e,props:t}):(0,s.createElement)(e,{...t})}),"withLayoutStyles");(0,m.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||_h(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,m.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ch);const xh={useBlockProps:function e({style:t}){var n;const o=(0,d.useSelect)((e=>!e(Nr).getSettings().disableLayoutStyles)),r=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:l,flexSize:i}=r,s=(0,p.useInstanceId)(e),a=`.wp-container-content-${s}`;let c="";if(o&&("fixed"===l&&i?c=`${a} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===l&&(c=`${a} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`)),bl({css:c}),c)return{className:`wp-container-content-${s}`}},attributeKeys:["style"],hasSupport:()=>!0};function Bh(e){return(0,d.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:l}=t(Nr),{getGroupingBlockName:i,getBlockType:s}=t(c.store),a=e?.length?e:o(),u=n(a),[d]=u,p=1===a.length&&r(a[0]);return{clientIds:a,isGroupable:l(a),isUngroupable:p,blocksSelection:u,groupingBlockName:i(),onUngroup:p&&s(d.name)?.transforms?.ungroup}}),[e])}function Ih({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:l,onClose:i=(()=>{})}){const{replaceBlocks:a}=(0,d.useDispatch)(Nr);return t||n?(0,s.createElement)(s.Fragment,null,t&&(0,s.createElement)(_l.MenuItem,{onClick:()=>{(()=>{const t=(0,c.switchToBlockType)(r,l);t&&a(e,t)})(),i()}},(0,x._x)("Group","verb")),n&&(0,s.createElement)(_l.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),a(e,t))})(),i()}},(0,x._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor "))):null}function Th(e){return(0,d.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s,getTemplateLock:a}=t(Nr),c=s(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:l(i(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}const Mh=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.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"})),Ph=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})),Rh=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.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"})),Nh=["core/block","core/navigation"];function Lh(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Ah({clientId:e,onClose:t}){const[n,o]=(0,u.useState)({move:!1,remove:!1}),{canEdit:r,canMove:l,canRemove:i}=Th(e),{allowsEditLocking:a,templateLock:m,hasTemplateLock:h}=(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Nr),r=n(e),l=(0,c.getBlockType)(r);return{allowsEditLocking:Nh.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!l?.attributes?.templateLock}}),[e]),[g,f]=(0,u.useState)(!!m),{updateBlockAttributes:b}=(0,d.useDispatch)(Nr),v=ih(e),k=(0,p.useInstanceId)(Ah,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{o({move:!l,remove:!i,...a?{edit:!r}:{}})}),[r,l,i,a]);const _=Object.values(n).every(Boolean),y=Object.values(n).some(Boolean)&&!_;return(0,s.createElement)(_l.Modal,{title:(0,x.sprintf)((0,x.__)("Lock %s"),v.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t},(0,s.createElement)("p",null,(0,x.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:o=>{o.preventDefault(),b([e],{lock:n,templateLock:g?Lh(n):void 0}),t()}},(0,s.createElement)("div",{role:"group","aria-labelledby":k,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(_l.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:k},(0,x.__)("Lock all")),checked:_,indeterminate:y,onChange:e=>o({move:e,remove:e,...a?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},a&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(_l.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,s.createElement)(_l.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?Rh:Mh})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(_l.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,s.createElement)(_l.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?Rh:Mh})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(_l.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,s.createElement)(_l.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?Rh:Mh}))),h&&(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,x.__)("Apply to all blocks inside"),checked:g,disabled:n.move&&!n.remove,onChange:()=>f(!g)})),(0,s.createElement)(_l.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:t},(0,x.__)("Cancel"))),(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(_l.Button,{variant:"primary",type:"submit"},(0,x.__)("Apply"))))))}function Oh({clientId:e}){const{canLock:t,isLocked:n}=Th(e),[o,r]=(0,u.useReducer)((e=>!e),!1);if(!t)return null;const l=n?(0,x.__)("Unlock"):(0,x.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuItem,{icon:n?Mh:Ph,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"},l),o&&(0,s.createElement)(Ah,{clientId:e,onClose:r}))}const Dh=()=>{};const zh=(0,p.compose)([(0,d.withSelect)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:o,getSettings:r}=e(Nr),l=n(t),i=r().codeEditingEnabled;return{mode:o(t),blockType:l?(0,c.getBlockType)(l.name):null,isCodeEditingEnabled:i}})),(0,d.withDispatch)(((e,{onToggle:t=Dh,clientId:n})=>({onToggleMode(){e(Nr).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:o=!1,isCodeEditingEnabled:r=!0}){if(!e||!(0,c.hasBlockSupport)(e,"html",!0)||!r)return null;const l="visual"===t?(0,x.__)("Edit as HTML"):(0,x.__)("Edit visually");return(0,s.createElement)(_l.MenuItem,{onClick:n},!o&&l)}));function Vh(e){return 0===e?.trim()?.length}function Fh({blockName:e,originalBlockName:t,onClose:n,onSave:o}){const[r,l]=(0,u.useState)(e),i=r!==e,a=r===t,c=Vh(r),d=i||a,m=(0,p.useInstanceId)(Fh,"block-editor-rename-modal__description");return(0,s.createElement)(_l.Modal,{title:(0,x.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",aria:{describedby:m},focusOnMount:"firstContentElement"},(0,s.createElement)("p",{id:m},(0,x.__)("Enter a custom name for this block.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=a||c?(0,x.sprintf)((0,x.__)('Block name reset to: "%s".'),r):(0,x.sprintf)((0,x.__)('Block name changed to: "%s".'),r);(0,vo.speak)(e,"assertive"),o(r),n()})()}},(0,s.createElement)(_l.__experimentalVStack,{spacing:"3"},(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:r,label:(0,x.__)("Block name"),hideLabelFromVision:!0,placeholder:t,onChange:l,onFocus:e=>e.target.select()}),(0,s.createElement)(_l.__experimentalHStack,{justify:"right"},(0,s.createElement)(_l.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n},(0,x.__)("Cancel")),(0,s.createElement)(_l.Button,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit"},(0,x.__)("Save"))))))}function Hh({clientId:e}){const[t,n]=(0,u.useState)(!1),{metadata:o}=(0,d.useSelect)((t=>{const{getBlockAttributes:n}=t(Nr),o=n(e)?.metadata;return{metadata:o}}),[e]),{updateBlockAttributes:r}=(0,d.useDispatch)(Nr),l=o?.name;const i=ih(e);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog"},(0,x.__)("Rename")),t&&(0,s.createElement)(Fh,{blockName:l||"",originalBlockName:i?.title,onClose:()=>n(!1),onSave:t=>{(t===i?.title||Vh(t))&&(t=void 0),function(t){r([e],{metadata:{...o&&o,name:t}})}(t)}}))}const{Fill:Gh,Slot:Uh}=(0,_l.createSlotFill)("BlockSettingsMenuControls");function $h({...e}){return(0,s.createElement)(_l.__experimentalStyleProvider,{document},(0,s.createElement)(Gh,{...e}))}$h.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:o,selectedClientIds:r}=(0,d.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o}=e(Nr),r=null!==t?t:o();return{selectedBlocks:n(r),selectedClientIds:r}}),[t]),{canLock:l}=Th(r[0]),{canRename:i}=(a=o[0],{canRename:(0,c.getBlockSupport)(a,"renaming",!0)});var a;const u=1===r.length&&l,m=1===r.length&&i,h=Bh(r),{isGroupable:g,isUngroupable:f}=h,b=g||f;return(0,s.createElement)(Uh,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:o,selectedClientIds:r}},(t=>!t?.length>0&&!b&&!u?null:(0,s.createElement)(_l.MenuGroup,null,b&&(0,s.createElement)(Ih,{...h,onClose:e?.onClose}),u&&(0,s.createElement)(Oh,{clientId:r[0]}),m&&(0,s.createElement)(Hh,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&(0,s.createElement)(_l.MenuItem,{onClick:(0,p.pipe)(e?.onClose,e?.onMoveTo)},(0,x.__)("Move to")),1===e?.count&&(0,s.createElement)(zh,{clientId:e?.firstBlockClientId,onToggle:e?.onClose}))))};const jh=$h;const Wh={edit:function({clientId:e,isSelected:t}){const{getBlockListSettings:n,getSettings:o}=(0,d.useSelect)(Nr),{templateLock:r,isLockedByParent:l,isEditingAsBlocks:i}=(0,d.useSelect)((t=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=t(Nr);return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),{updateSettings:a,updateBlockListSettings:c,__unstableSetTemporarilyEditingAsBlocks:p}=(0,d.useDispatch)(Nr),{stopEditingAsBlocks:m}=ie((0,d.useDispatch)(Nr)),h=!l&&"contentOnly"===r,{__unstableMarkNextChangeAsNotPersistent:g,updateBlockAttributes:f}=(0,d.useDispatch)(Nr),b=(0,u.useCallback)((()=>{m(e)}),[e,m]);if(!h&&!i)return null;const v=i&&!h,k=!i&&h&&t;return(0,s.createElement)(s.Fragment,null,v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bl,{group:"other"},(0,s.createElement)(_l.ToolbarButton,{onClick:b},(0,x.__)("Done")))),k&&(0,s.createElement)(jh,null,(({onClose:t})=>(0,s.createElement)(_l.MenuItem,{onClick:()=>{g(),f(e,{templateLock:void 0}),c(e,{...n(e),templateLock:!1});const r=o().focusMode;a({focusMode:!0}),p(e,r),t()}},(0,x.__)("Modify")))))},hasSupport:()=>!0},Kh="metadata";(0,m.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[Kh]?.type||(e.attributes={...e.attributes,[Kh]:{type:"object"}}),e}));const Zh=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"}));const qh=(0,u.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:Zh});const r=(0,s.createElement)(_l.Icon,{icon:e&&e.src?e.src:e,context:o}),l=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,s.createElement)("span",{style:l,className:ml()("block-editor-block-icon",n,{"has-colors":t})},r)})),Yh={};const Xh={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const o=(0,d.useSelect)((e=>e(c.store).getBlockTypes()),[]),r=(0,u.useMemo)((()=>o?.filter((({name:t,blockHooks:o})=>o&&e in o||n.includes(t)))),[o,e,n]),{blockIndex:l,rootClientId:i,innerBlocksLength:a}=(0,d.useSelect)((e=>{const{getBlocks:n,getBlockIndex:o,getBlockRootClientId:r}=e(Nr);return{blockIndex:o(t),innerBlocksLength:n(t)?.length,rootClientId:r(t)}}),[t]),p=(0,d.useSelect)((n=>{const{getBlocks:o,getGlobalBlockCount:l}=n(Nr),s=r.reduce(((n,r)=>{if(0===l(r.name))return n;const s=r?.blockHooks?.[e];let a;switch(s){case"before":case"after":a=o(i);break;case"first_child":case"last_child":a=o(t);break;case void 0:a=[...o(i),...o(t)]}const c=a?.find((e=>e.name===r.name));return c?{...n,[r.name]:c.clientId}:n}),{});return Object.values(s).length>0?s:Yh}),[r,e,t,i]),{insertBlock:m,removeBlock:h}=(0,d.useDispatch)(Nr);if(!r.length)return null;const g=r.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,s.createElement)(Bs,null,(0,s.createElement)(_l.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,x.__)("Plugins"),initialOpen:!0},(0,s.createElement)("p",{className:"block-editor-hooks__block-hooks-helptext"},(0,x.__)("Manage the inclusion of blocks added automatically by plugins.")),Object.keys(g).map((n=>(0,s.createElement)(u.Fragment,{key:n},(0,s.createElement)("h3",null,n),g[n].map((n=>{const o=n.name in p;return(0,s.createElement)(_l.ToggleControl,{checked:o,key:n.title,label:(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(qh,{icon:n.icon}),(0,s.createElement)("span",null,n.title)),onChange:()=>{if(o)h(p[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":m(e,"after"===n?l+1:l,i,!1);break;case"first_child":case"last_child":m(e,"first_child"===n?0:a,t,!1);break;case void 0:m(e,l+1,i,!1)}})((0,c.createBlock)(n.name),o)}}})})))))))},attributeKeys:["metadata"],hasSupport:()=>!0};const Qh={edit:function({metadata:e,setAttributes:t}){return(0,s.createElement)(Bs,{group:"advanced"},(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,x.__)("Block name"),value:e?.name||"",onChange:n=>{t({metadata:{...e,name:n}})}}))},attributeKeys:["metadata"],hasSupport:e=>(0,c.hasBlockSupport)(e,"renaming",!0)};(0,m.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||(0,c.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const Jh={"core/paragraph":["content"],"core/heading":["content"],"core/image":["url","title","alt"],"core/button":["url","text","linkTarget"]};function eg(e){return e in Jh}const tg=({args:e,attrName:t,blockProps:n,source:o,onPropValueChange:r})=>{const{placeholder:l,value:i}=o.useSource(n,e),{name:s}=n,a=n.attributes[t],d=(0,u.useCallback)(((e,n)=>{if(n instanceof Y.RichTextData){if(n.toHTMLString()===e)return;e=Y.RichTextData.fromHTMLString(e)}n!==e&&r({[t]:e})}),[t,r]);return(0,u.useLayoutEffect)((()=>{if(void 0!==i)d(i,a);else if(l){const e=(0,c.getBlockType)(s).attributes[t].attribute;if("src"===e||"href"===e)return void d(null);d(l)}}),[d,i,a,l,s,t]),null};function ng({blockProps:e,bindings:t,onPropValueChange:n}){const o=ie((0,d.useSelect)(c.store)).getAllBlockBindingsSources();return(0,s.createElement)(s.Fragment,null,Object.entries(t).map((([t,r])=>{const l=o[r.source];return l?.useSource?(0,s.createElement)(tg,{key:t,attrName:t,source:l,blockProps:e,args:r.args,onPropValueChange:n}):null})))}const og=(0,p.createHigherOrderComponent)((e=>t=>{const[n,o]=(0,u.useState)({}),r=(0,u.useCallback)((e=>o((t=>({...t,...e})))),[]),l=Object.fromEntries(Object.entries(t.attributes.metadata?.bindings||{}).filter((([e])=>{return n=t.name,o=e,eg(n)&&Jh[n].includes(o);var n,o})));return(0,s.createElement)(s.Fragment,null,Object.keys(l).length>0&&(0,s.createElement)(ng,{blockProps:t,bindings:l,onPropValueChange:r}),(0,s.createElement)(e,{...t,attributes:{...t.attributes,...n}}))}),"withBlockBindingSupport");function rg(e){const t=e.style?.border||{};return{className:Fu(e)||void 0,style:Mm({border:t})}}function lg(e){const{colors:t}=qc(),n=rg(e),{borderColor:o}=e;if(o){const e=Pu({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function ig(e){return{style:Mm({shadow:e.style?.shadow||""})}}function sg(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,l=Zc("background-color",t),i=Zc("color",n),s=Gu(o),a=s||r?.color?.gradient;return{className:ml()(i,s,{[l]:!a&&!!l,"has-text-color":n||r?.color?.text,"has-background":t||r?.color?.background||o||r?.color?.gradient,"has-link-color":r?.elements?.link?.color})||void 0,style:Mm({color:r?.color||{}})}}function ag(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,l,i,s,a,c]=Ar("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,u.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),p=(0,u.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]),m=sg(e);if(t){const e=Wc(d,t);m.style.backgroundColor=e.color}if(o&&(m.style.background=Uu(p,o)),n){const e=Wc(d,n);m.style.color=e.color}return m}function cg(e){const{style:t}=e;return{style:Mm({spacing:t?.spacing||{}})}}function ug(e,t){const{kebabCase:n}=ie(_l.privateApis);let o=e?.style?.typography||{};const r=Zr(t);o={...o,fontSize:Wr({size:e?.style?.typography?.fontSize},r)};const l=Mm({typography:o}),i=e?.fontFamily?`has-${n(e.fontFamily)}-font-family`:"";return{className:ml()(i,Sp(e?.fontSize)),style:l}}function dg(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}var pg;(0,m.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return eg(t)?{...e,edit:og(e.edit)}:e})),function(e){e=e.map((e=>({...e,Edit:(0,u.memo)(e.edit)})));const t=(0,p.createHigherOrderComponent)((t=>n=>{const o=y();return[...e.map(((e,t)=>{const{Edit:r,hasSupport:l,attributeKeys:i=[],shareWithChildBlocks:a}=e;if(!(o[h]||o[g]&&a)||!l(n.name))return null;const c={};for(const e of i)n.attributes[e]&&(c[e]=n.attributes[e]);return(0,s.createElement)(r,{key:t,name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...c})})),(0,s.createElement)(t,{key:"edit",...n})]}),"withBlockEditHooks");(0,m.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([is,Ms,Ns,Dm,rh,vh,Eh,Wh,Xh,Qh].filter(Boolean)),function(e){const t=(0,p.createHigherOrderComponent)((t=>n=>{const[o,r]=(0,u.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:o,attributeKeys:l=[],useBlockProps:i}=e,a={};for(const e of l)n.attributes[e]&&(a[e]=n.attributes[e]);return Object.keys(a).length&&o(n.name)?(0,s.createElement)(kl,{key:t,index:t,useBlockProps:i,setAllWrapperProps:r,name:n.name,...a}):null})),(0,s.createElement)(t,{key:"edit",...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:ml()(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})})]}),"withBlockListBlockHooks");(0,m.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([is,Dm,Pd,xm,rh,yp,Bp,Hu,vh,xh]),pg=[is,Ms,Rs,Ns,Hu,Pd,Dm,yp,Bp],(0,m.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return pg.reduce(((e,o)=>{const{hasSupport:r,attributeKeys:l=[],addSaveProps:i}=o,s={};for(const e of l)n[e]&&(s[e]=n[e]);return Object.keys(s).length&&r(t)?i(e,t,s):e}),e)}),0),(0,m.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));const mg=([e,...t])=>e.toUpperCase()+t.join(""),hg=e=>(0,p.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,{...n,colors:e})),"withCustomColorPalette"),gg=()=>(0,p.createHigherOrderComponent)((e=>t=>{const[n,o,r]=Ar("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,{...t,colors:l})}),"withEditorColorPalette");function fg(e,t){const{kebabCase:n}=ie(_l.privateApis),o=e.reduce(((e,t)=>({...e,..."string"==typeof t?{[t]:n(t)}:t})),{});return(0,p.compose)([t,e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Vc(t),o=({color:e})=>n.contrast(e),r=Math.max(...e.map(o));return e.find((e=>o(e)===r)).color}(t,e)}createSetters(){return Object.keys(o).reduce(((e,t)=>{const n=mg(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Kc(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,colors:t},n){return Object.entries(o).reduce(((o,[r,l])=>{const i=Wc(t,e[r],e[`custom${mg(r)}`]),s=n[r],a=s?.color;return a===i.color&&s?o[r]=s:o[r]={...i,class:Zc(l,i.slug)},o}),{})}render(){return(0,s.createElement)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function bg(e){return(...t)=>{const n=hg(e);return(0,p.createHigherOrderComponent)(fg(t,n),"withCustomColors")}}function vg(...e){const t=gg();return(0,p.createHigherOrderComponent)(fg(e,t),"withColors")}const kg=function(e){const[t,n]=Ar("typography.fontSizes","typography.customFontSize");return(0,s.createElement)(_l.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})},_g=[],yg=([e,...t])=>e.toUpperCase()+t.join(""),Eg=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${yg(t)}`,e)),{});return(0,p.createHigherOrderComponent)((0,p.compose)([(0,p.createHigherOrderComponent)((e=>t=>{const[n]=Ar("typography.fontSizes");return(0,s.createElement)(e,{...t,fontSizes:n||_g})}),"withFontSizes"),e=>class extends u.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce(((e,[t,n])=>(e[`set${yg(t)}`]=this.createSetFontSize(t,n),e)),{})}createSetFontSize(e,t){return n=>{const o=this.props.fontSizes?.find((({size:e})=>e===Number(n)));this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps({attributes:e,fontSizes:n},o){const r=(t,n)=>!o[n]||(e[n]?e[n]!==o[n].slug:o[n].size!==e[t]);if(!Object.values(t).some(r))return null;const l=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const l=e[o],i=Ep(n,l,e[r]);return t[o]={...i,class:Sp(l)},t}),{});return{...o,...l}}render(){return(0,s.createElement)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")},wg=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})),Sg=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})),Cg=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})),xg=[{icon:wg,title:(0,x.__)("Align text left"),align:"left"},{icon:Sg,title:(0,x.__)("Align text center"),align:"center"},{icon:Cg,title:(0,x.__)("Align text right"),align:"right"}],Bg={placement:"bottom-start"};const Ig=function({value:e,onChange:t,alignmentControls:n=xg,label:o=(0,x.__)("Align text"),describedBy:r=(0,x.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:i}){function a(n){return()=>t(e===n?void 0:n)}const c=n.find((t=>t.align===e)),u=i?_l.ToolbarGroup:_l.ToolbarDropdownMenu,d=i?{isCollapsed:l}:{toggleProps:{describedBy:r},popoverProps:Bg};return(0,s.createElement)(u,{icon:c?c.icon:(0,x.isRTL)()?Cg:wg,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:l?"menuitemradio":void 0,onClick:a(n)}})),...d})},Tg=e=>(0,s.createElement)(Ig,{...e,isToolbar:!1}),Mg=e=>(0,s.createElement)(Ig,{...e,isToolbar:!0});var Pg=n(9681),Rg=n.n(Pg);function Ng(e){return e.toLowerCase()}var Lg=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Ag=/[^A-Z0-9]+/gi;function Og(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Dg=e=>e.name||"",zg=e=>e.title,Vg=e=>e.description||"",Fg=e=>e.keywords||[],Hg=e=>e.category,Gg=()=>null;function Ug(e=""){return function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Lg:n,r=t.stripRegexp,l=void 0===r?Ag:r,i=t.transform,s=void 0===i?Ng:i,a=t.delimiter,c=void 0===a?" ":a,u=Og(Og(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function $g(e=""){return e=(e=(e=Rg()(e)).replace(/^\//,"")).toLowerCase()}const jg=(e="")=>Ug($g(e)),Wg=(e,t,n,o)=>{if(0===jg(o).length)return e;return Kg(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title})},Kg=(e=[],t="",n={})=>{if(0===jg(t).length)return e;const o=e.map((e=>[e,Zg(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function Zg(e,t,n={}){const{getName:o=Dg,getTitle:r=zg,getDescription:l=Vg,getKeywords:i=Fg,getCategory:s=Hg,getCollection:a=Gg}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=s(e),h=a(e),g=$g(t),f=$g(u);let b=0;if(g===f)b+=30;else if(f.startsWith(g))b+=20;else{const e=[c,u,d,...p,m,h].join(" ");0===((e,t)=>e.filter((e=>!jg(t).some((t=>t.includes(e))))))(Ug(g),e).length&&(b+=10)}if(0!==b&&c.startsWith("core/")){b+=c!==e.id?1:2}return b}const qg=(e,t)=>{const[n]=(0,d.useSelect)((t=>[t(Nr).getInserterItems(e)]),[e]),[o,r]=(0,d.useSelect)((e=>{const{getCategories:t,getCollections:n}=e(c.store);return[t(),n()]}),[]);return[n,o,r,(0,u.useCallback)((({name:e,initialAttributes:n,innerBlocks:o,syncStatus:r,content:l},i)=>{const s="unsynced"===r?(0,c.parse)(l,{__unstableSkipMigrationLogs:!0}):(0,c.createBlock)(e,n,(0,c.createBlocksFromInnerBlocksTemplate)(o));t(s,void 0,i)}),[t])]},Yg=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let o=t.indexOf(e),r=t.indexOf(n);return o<0&&(o=t.length),r<0&&(r=t.length),o-r})),e):e,Xg=()=>{};const Qg={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:o}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:o,getBlockRootClientId:r}=e(Nr),l=t(),i=r(l);return{selectedBlockName:l?n(l):null,rootClientId:i,prioritizedBlocks:o(i)?.prioritizedInserterBlocks}}),[]),[r,l,i]=qg(t,Xg),a=(0,u.useMemo)((()=>(e.trim()?Wg(r,l,i,e):Yg(ne(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,l,i,o]);return[(0,u.useMemo)((()=>a.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qh,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[a])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:r,content:l}=e;return{action:"replace",value:"unsynced"===r?(0,c.parse)(l,{__unstableSkipMigrationLogs:!0}):(0,c.createBlock)(t,n,(0,c.createBlocksFromInnerBlocksTemplate)(o))}}},Jg=window.wp.apiFetch;var ef=n.n(Jg);const tf=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"}));const nf={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await ef()({path:(0,Ds.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ti,{key:"icon",icon:"page"===e.subtype?la:tf}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)},of=[];function rf({completers:e=of}){const{name:t}=y();return(0,u.useMemo)((()=>{let n=[...e,nf];return(t===(0,c.getDefaultBlockName)()||(0,c.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,Qg]),(0,m.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,m.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const lf=function(e){return(0,s.createElement)(_l.Autocomplete,{...e,completers:rf(e)})},sf=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"}));const af=function({isActive:e,label:t=(0,x.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,s.createElement)(_l.ToolbarButton,{isActive:e,icon:sf,label:t,onClick:()=>n(!e),disabled:o})},cf=()=>{};const uf=function(e){const{label:t=(0,x.__)("Change matrix alignment"),onChange:n=cf,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(_l.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(_l.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,s.createElement)(_l.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==zs.DOWN||(t.preventDefault(),e())},label:t,icon:l,showTooltip:!0,disabled:r}),renderContent:()=>(0,s.createElement)(_l.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function df({clientId:e,maximumLength:t,context:n}){const o=(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:o,getBlockAttributes:r}=t(Nr),{getBlockType:l,getActiveBlockVariation:i}=t(c.store),s=o(e),a=l(s);if(!a)return null;const u=r(e),d=(0,c.__experimentalGetBlockLabel)(a,u,n);if(d!==a.title)return d;const p=i(s,u);return p?.title||a.title}),[e,n]);if(!o)return null;if(t&&t>0&&o.length>t){const e="...";return o.slice(0,t-e.length)+e}return o}function pf({clientId:e,maximumLength:t,context:n}){return df({clientId:e,maximumLength:t,context:n})}const mf=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,d.useDispatch)(Nr),{clientId:o,parents:r,hasSelection:l}=(0,d.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=ie(e(Nr)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),i=e||(0,x.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,x.__)("Block breadcrumb")},(0,s.createElement)("li",{className:l?void 0:"block-editor-block-breadcrumb__current","aria-current":l?void 0:"true"},l&&(0,s.createElement)(_l.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},i),!l&&i,!!o&&(0,s.createElement)(Ti,{icon:qs,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(_l.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,s.createElement)(pf,{clientId:e,maximumLength:35})),(0,s.createElement)(Ti,{icon:qs,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(pf,{clientId:o,maximumLength:35})))};function hf(e){return(0,d.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(Nr);return n(e)}),[e])}const gf=(0,u.createContext)({});function ff({value:e,children:t}){const n=(0,u.useContext)(gf),o=(0,u.useMemo)((()=>({...n,...e})),[n,e]);return(0,s.createElement)(gf.Provider,{value:o,children:t})}const bf=gf,vf={},kf=(0,_l.withFilters)("editor.BlockEdit")((e=>{const{name:t}=e,n=(0,c.getBlockType)(t);if(!n)return null;const o=n.edit||n.save;return(0,s.createElement)(o,{...e})})),_f=e=>{const{attributes:t={},name:n}=e,o=(0,c.getBlockType)(n),r=(0,u.useContext)(bf),l=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):vf),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,s.createElement)(kf,{...e,context:l});const i=(0,c.hasBlockSupport)(o,"className",!0)?(0,c.getBlockDefaultClassName)(n):null,a=ml()(i,t.className,e.className);return(0,s.createElement)(kf,{...e,context:l,className:a})};function yf({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,...o}){const{name:r,isSelected:l,clientId:i,attributes:a={},__unstableLayoutClassNames:d}=o,{layout:p=null,metadata:m={}}=a,{bindings:v}=m,k=(0,c.hasBlockSupport)(r,"layout",!1)||(0,c.hasBlockSupport)(r,"__experimentalLayout",!1);return(0,s.createElement)(_,{value:(0,u.useMemo)((()=>({name:r,isSelected:l,clientId:i,layout:k?p:null,__unstableLayoutClassNames:d,[h]:e,[g]:t,[f]:n,[b]:v})),[r,l,i,k,p,d,e,t,n,v])},(0,s.createElement)(_f,{...o}))}const Ef=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));const wf=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:ml()(e,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},n),(u.Children.count(t)>0||o)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},u.Children.count(t)>0&&u.Children.map(t,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,s.createElement)(_l.DropdownMenu,{className:"block-editor-warning__secondary",icon:Ef,label:(0,x.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(_l.MenuGroup,null,o.map(((e,t)=>(0,s.createElement)(_l.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var Sf=n(8021);function Cf({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:l}){return(0,s.createElement)("div",{className:l},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},e),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(u.RawHTML,null,(0,As.safeHTML)(n)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(_l.Button,{variant:"secondary",tabIndex:"0",onClick:o},r)))}const xf=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const l=(i=o(e),(Array.isArray(i)?i:[i]).map((e=>(0,c.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var i;const a=(u=e.originalContent,d=l,(0,Sf.JJ)(u,d).map(((e,t)=>{const n=ml()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var u,d;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Cf,{title:(0,x.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,x.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,s.createElement)(Cf,{title:(0,x.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:l}))},Bf=e=>(0,c.rawHandler)({HTML:e.originalContent});function If({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,d.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(Nr),l=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",l),canInsertClassicBlock:n("core/freeform",l)}}),[e]),{replaceBlock:r}=(0,d.useDispatch)(Nr),[l,i]=(0,u.useState)(!1),a=(0,u.useCallback)((()=>i(!1)),[]),p=(0,u.useMemo)((()=>({toClassic(){const e=(0,c.createBlock)("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=(0,c.createBlock)("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=Bf(t);return r(t.clientId,e)},toRecoveredBlock(){const e=(0,c.createBlock)(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}})),[t,r]),m=(0,u.useMemo)((()=>[{title:(0,x._x)("Resolve","imperative verb"),onClick:()=>i(!0)},n&&{title:(0,x.__)("Convert to HTML"),onClick:p.toHTML},o&&{title:(0,x.__)("Convert to Classic Block"),onClick:p.toClassic}].filter(Boolean)),[n,o,p]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wf,{actions:[(0,s.createElement)(_l.Button,{key:"recover",onClick:p.toRecoveredBlock,variant:"primary"},(0,x.__)("Attempt Block Recovery"))],secondaryActions:m},(0,x.__)("This block contains unexpected or invalid content.")),l&&(0,s.createElement)(_l.Modal,{title:(0,x.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare"},(0,s.createElement)(xf,{block:t,onKeep:p.toHTML,onConvert:p.toBlocks,convertor:Bf,convertButtonText:(0,x.__)("Convert to Blocks")})))}const Tf=(0,s.createElement)(wf,{className:"block-editor-block-list__block-crash-warning"},(0,x.__)("This block has encountered an error and cannot be previewed.")),Mf=()=>Tf;class Pf extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Rf=Pf;var Nf=n(4132);const Lf=function({clientId:e}){const[t,n]=(0,u.useState)(""),o=(0,d.useSelect)((t=>t(Nr).getBlock(e)),[e]),{updateBlock:r}=(0,d.useDispatch)(Nr);return(0,u.useEffect)((()=>{n((0,c.getBlockContent)(o))}),[o]),(0,s.createElement)(Nf.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const l=(0,c.getBlockType)(o.name);if(!l)return;const i=(0,c.getBlockAttributes)(l,t,o.attributes),s=t||(0,c.getSaveContent)(l,i),[a]=t?(0,c.validateBlock)({...o,attributes:i,originalContent:s}):[!0];r(e,{attributes:i,originalContent:s,isValid:a}),t||n(s)},onChange:e=>n(e.target.value)})};var Af=Xf(),Of=e=>Kf(e,Af),Df=Xf();Of.write=e=>Kf(e,Df);var zf=Xf();Of.onStart=e=>Kf(e,zf);var Vf=Xf();Of.onFrame=e=>Kf(e,Vf);var Ff=Xf();Of.onFinish=e=>Kf(e,Ff);var Hf=[];Of.setTimeout=(e,t)=>{let n=Of.now()+t,o=()=>{let e=Hf.findIndex((e=>e.cancel==o));~e&&Hf.splice(e,1),jf-=~e?1:0},r={time:n,handler:e,cancel:o};return Hf.splice(Gf(n),0,r),jf+=1,Zf(),r};var Gf=e=>~(~Hf.findIndex((t=>t.time>e))||~Hf.length);Of.cancel=e=>{zf.delete(e),Vf.delete(e),Ff.delete(e),Af.delete(e),Df.delete(e)},Of.sync=e=>{Wf=!0,Of.batchedUpdates(e),Wf=!1},Of.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Of.onStart(n)}return o.handler=e,o.cancel=()=>{zf.delete(n),t=null},o};var Uf=typeof window<"u"?window.requestAnimationFrame:()=>{};Of.use=e=>Uf=e,Of.now=typeof performance<"u"?()=>performance.now():Date.now,Of.batchedUpdates=e=>e(),Of.catch=console.error,Of.frameLoop="always",Of.advance=()=>{"demand"!==Of.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Yf()};var $f=-1,jf=0,Wf=!1;function Kf(e,t){Wf?(t.delete(e),e(0)):(t.add(e),Zf())}function Zf(){$f<0&&($f=0,"demand"!==Of.frameLoop&&Uf(qf))}function qf(){~$f&&(Uf(qf),Of.batchedUpdates(Yf))}function Yf(){let e=$f;$f=Of.now();let t=Gf($f);t&&(Qf(Hf.splice(0,t),(e=>e.handler())),jf-=t),jf?(zf.flush(),Af.flush(e?Math.min(64,$f-e):16.667),Vf.flush(),Df.flush(),Ff.flush()):$f=-1}function Xf(){let e=new Set,t=e;return{add(n){jf+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(jf-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,jf-=t.size,Qf(t,(t=>t(n)&&e.add(t))),jf+=e.size,t=e)}}}function Qf(e,t){e.forEach((e=>{try{t(e)}catch(e){Of.catch(e)}}))}var Jf=Object.defineProperty,eb={};function tb(){}((e,t)=>{for(var n in t)Jf(e,n,{get:t[n],enumerable:!0})})(eb,{assign:()=>gb,colors:()=>pb,createStringInterpolator:()=>ab,skipAnimation:()=>mb,to:()=>cb,willAdvance:()=>hb});var nb={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 ob(e,t){if(nb.arr(e)){if(!nb.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}var rb=(e,t)=>e.forEach(t);function lb(e,t,n){if(nb.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(let o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}var ib=e=>nb.und(e)?[]:nb.arr(e)?e:[e];function sb(e,t){if(e.size){let n=Array.from(e);e.clear(),rb(n,t)}}var ab,cb,ub=(e,...t)=>sb(e,(e=>e(...t))),db=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),pb=null,mb=!1,hb=tb,gb=e=>{e.to&&(cb=e.to),e.now&&(Of.now=e.now),void 0!==e.colors&&(pb=e.colors),null!=e.skipAnimation&&(mb=e.skipAnimation),e.createStringInterpolator&&(ab=e.createStringInterpolator),e.requestAnimationFrame&&Of.use(e.requestAnimationFrame),e.batchedUpdates&&(Of.batchedUpdates=e.batchedUpdates),e.willAdvance&&(hb=e.willAdvance),e.frameLoop&&(Of.frameLoop=e.frameLoop)},fb=new Set,bb=[],vb=[],kb=0,_b={get idle(){return!fb.size&&!bb.length},start(e){kb>e.priority?(fb.add(e),Of.onStart(yb)):(Eb(e),Of(Sb))},advance:Sb,sort(e){if(kb)Of.onFrame((()=>_b.sort(e)));else{let t=bb.indexOf(e);~t&&(bb.splice(t,1),wb(e))}},clear(){bb=[],fb.clear()}};function yb(){fb.forEach(Eb),fb.clear(),Of(Sb)}function Eb(e){bb.includes(e)||wb(e)}function wb(e){bb.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(bb,(t=>t.priority>e.priority)),0,e)}function Sb(e){let t=vb;for(let n=0;n<bb.length;n++){let o=bb[n];kb=o.priority,o.idle||(hb(o),o.advance(e),o.idle||t.push(o))}return kb=0,(vb=bb).length=0,(bb=t).length>0}var Cb="[-+]?\\d*\\.?\\d+",xb=Cb+"%";function Bb(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ib=new RegExp("rgb"+Bb(Cb,Cb,Cb)),Tb=new RegExp("rgba"+Bb(Cb,Cb,Cb,Cb)),Mb=new RegExp("hsl"+Bb(Cb,xb,xb)),Pb=new RegExp("hsla"+Bb(Cb,xb,xb,Cb)),Rb=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Nb=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Lb=/^#([0-9a-fA-F]{6})$/,Ab=/^#([0-9a-fA-F]{8})$/;function Ob(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 Db(e,t,n){let o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Ob(r,o,e+1/3),i=Ob(r,o,e),s=Ob(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function zb(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Vb(e){return(parseFloat(e)%360+360)%360/360}function Fb(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Hb(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Gb(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Lb.exec(e))?parseInt(t[1]+"ff",16)>>>0:pb&&void 0!==pb[e]?pb[e]:(t=Ib.exec(e))?(zb(t[1])<<24|zb(t[2])<<16|zb(t[3])<<8|255)>>>0:(t=Tb.exec(e))?(zb(t[1])<<24|zb(t[2])<<16|zb(t[3])<<8|Fb(t[4]))>>>0:(t=Rb.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ab.exec(e))?parseInt(t[1],16)>>>0:(t=Nb.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Mb.exec(e))?(255|Db(Vb(t[1]),Hb(t[2]),Hb(t[3])))>>>0:(t=Pb.exec(e))?(Db(Vb(t[1]),Hb(t[2]),Hb(t[3]))|Fb(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})`)}var Ub=(e,t,n)=>{if(nb.fun(e))return e;if(nb.arr(e))return Ub({range:e,output:t,extrapolate:n});if(nb.str(e.output[0]))return ab(e);let o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};var $b=1.70158,jb=1.525*$b,Wb=$b+1,Kb=2*Math.PI/3,Zb=2*Math.PI/4.5,qb=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Yb={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=>Wb*e*e*e-$b*e*e,easeOutBack:e=>1+Wb*Math.pow(e-1,3)+$b*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(jb+1)*e-jb)/2:(Math.pow(2*e-2,2)*((jb+1)*(2*e-2)+jb)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Kb),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Kb)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Zb)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Zb)/2+1,easeInBounce:e=>1-qb(1-e),easeOutBounce:qb,easeInOutBounce:e=>e<.5?(1-qb(1-2*e))/2:(1+qb(2*e-1))/2,steps:(e,t="end")=>n=>{let o=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,e),t))(0,1,("end"===t?Math.floor(o):Math.ceil(o))/e)}},Xb=Symbol.for("FluidValue.get"),Qb=Symbol.for("FluidValue.observers"),Jb=e=>Boolean(e&&e[Xb]),ev=e=>e&&e[Xb]?e[Xb]():e,tv=e=>e[Qb]||null;function nv(e,t){let n=e[Qb];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var ov=class{[Xb];[Qb];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");rv(this,e)}},rv=(e,t)=>av(e,Xb,t);function lv(e,t){if(e[Xb]){let n=e[Qb];n||av(e,Qb,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function iv(e,t){let n=e[Qb];if(n&&n.has(t)){let o=n.size-1;o?n.delete(t):e[Qb]=null,e.observerRemoved&&e.observerRemoved(o,t)}}var sv,av=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),cv=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,uv=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,dv=new RegExp(`(${cv.source})(%|[a-z]+)`,"i"),pv=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,mv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,hv=e=>{let[t,n]=gv(e);if(!t||db())return e;let o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&mv.test(n)?hv(n):n||e},gv=e=>{let t=mv.exec(e);if(!t)return[,];let[,n,o]=t;return[n,o]},fv=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,bv=e=>{sv||(sv=pb?new RegExp(`(${Object.keys(pb).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>ev(e).replace(mv,hv).replace(uv,Gb).replace(sv,Gb))),n=t.map((e=>e.match(cv).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Ub({...e,output:t})));return e=>{let n=!dv.test(t[0])&&t.find((e=>dv.test(e)))?.replace(cv,""),r=0;return t[0].replace(cv,(()=>`${o[r++](e)}${n||""}`)).replace(pv,fv)}},vv="react-spring: ",kv=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${vv}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},_v=kv(console.warn);kv(console.warn);function yv(e){return nb.str(e)&&("#"==e[0]||/\d/.test(e)||!db()&&mv.test(e)||e in(pb||{}))}new WeakMap;new Set,new WeakMap,new WeakMap,new WeakMap;var Ev=db()?s.useEffect:s.useLayoutEffect;function wv(){let e=(0,s.useState)()[1],t=(()=>{let e=(0,s.useRef)(!1);return Ev((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Sv=[];var Cv=Symbol.for("Animated:node"),xv=e=>e&&e[Cv],Bv=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Cv,t),Iv=e=>e&&e[Cv]&&e[Cv].getPayload(),Tv=class{payload;constructor(){Bv(this,this)}getPayload(){return this.payload||[]}},Mv=class extends Tv{constructor(e){super(),this._value=e,nb.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Mv(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return nb.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(){let{done:e}=this;this.done=!1,nb.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Pv=class extends Mv{_string=null;_toString;constructor(e){super(0),this._toString=Ub({output:[e,e]})}static create(e){return new Pv(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(nb.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=Ub({output:[this.getValue(),e]})),this._value=0,super.reset()}},Rv={dependencies:null},Nv=class extends Tv{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return lb(this.source,((n,o)=>{(e=>!!e&&e[Cv]===e)(n)?t[o]=n.getValue(e):Jb(n)?t[o]=ev(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&rb(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return lb(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Rv.dependencies&&Jb(e)&&Rv.dependencies.add(e);let t=Iv(e);t&&rb(t,(e=>this.add(e)))}},Lv=class extends Nv{constructor(e){super(e)}static create(e){return new Lv(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Av)),!0)}};function Av(e){return(yv(e)?Pv:Mv).create(e)}function Ov(e){let t=xv(e);return t?t.constructor:nb.arr(e)?Lv:yv(e)?Pv:Mv}var Dv=(e,t)=>{let n=!nb.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,s.forwardRef)(((o,r)=>{let l=(0,s.useRef)(null),i=n&&(0,s.useCallback)((e=>{l.current=function(e,t){return e&&(nb.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,c]=function(e,t){let n=new Set;return Rv.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Nv(e),Rv.dependencies=null,[e,n]}(o,t),u=wv(),d=()=>{let e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&u()},p=new zv(d,c),m=(0,s.useRef)();Ev((()=>(m.current=p,rb(c,(e=>lv(e,p))),()=>{m.current&&(rb(m.current.deps,(e=>iv(e,m.current))),Of.cancel(m.current.update))}))),(0,s.useEffect)(d,[]),(e=>{(0,s.useEffect)(e,Sv)})((()=>()=>{let e=m.current;rb(e.deps,(t=>iv(t,e)))}));let h=t.getComponentProps(a.getValue());return s.createElement(e,{...h,ref:i})}))},zv=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Of.write(this.update)}};var Vv=Symbol.for("AnimatedComponent"),Fv=e=>nb.str(e)?e:e&&nb.str(e.displayName)?e.displayName:nb.fun(e)&&e.name||null;function Hv(e,...t){return nb.fun(e)?e(...t):e}var Gv=(e,t)=>!0===e||!!(t&&e&&(nb.fun(e)?e(t):ib(e).includes(t))),Uv=(e,t)=>nb.obj(e)?t&&e[t]:e,$v=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,jv=e=>e,Wv=(e,t=jv)=>{let n=Kv;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let o={};for(let r of n){let n=t(e[r],r);nb.und(n)||(o[r]=n)}return o},Kv=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Zv={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 qv(e){let t=function(e){let t={},n=0;if(lb(e,((e,o)=>{Zv[o]||(t[o]=e,n++)})),n)return t}(e);if(t){let n={to:t};return lb(e,((e,o)=>o in t||(n[o]=e))),n}return{...e}}function Yv(e){return e=ev(e),nb.arr(e)?e.map(Yv):yv(e)?eb.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Xv(e){return nb.fun(e)||nb.arr(e)&&nb.obj(e[0])}var Qv={tension:170,friction:26,mass:1,damping:1,easing:Yb.linear,clamp:!1},Jv=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,Qv)}};function ek(e,t){if(nb.und(t.decay)){let n=!nb.und(t.tension)||!nb.und(t.friction);(n||!nb.und(t.frequency)||!nb.und(t.damping)||!nb.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var tk=[],nk=class{changed=!1;values=tk;toValues=null;fromValues=tk;to;from;config=new Jv;immediate=!1};function ok(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{let a,c,u=Gv(n.cancel??o?.cancel,t);if(u)m();else{nb.und(n.pause)||(r.paused=Gv(n.pause,t));let e=o?.pause;!0!==e&&(e=r.paused||Gv(e,t)),a=Hv(n.delay||0,t),e?(r.resumeQueue.add(p),l.pause()):(l.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),a=c.time-Of.now()}function p(){a>0&&!eb.skipAnimation?(r.delayed=!0,c=Of.setTimeout(m,a),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{l.start({...n,callId:e,cancel:u},i)}catch(e){s(e)}}}))}var rk=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?sk(e.get()):t.every((e=>e.noop))?lk(e.get()):ik(e.get(),t.every((e=>e.finished))),lk=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ik=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),sk=e=>({value:e,cancelled:!0,finished:!1});function ak(e,t,n,o){let{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,p=Wv(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),h=e=>{let t=r<=(n.cancelId||0)&&sk(o)||r!==n.asyncId&&ik(o,!1);if(t)throw e.result=t,u(e),e},g=(e,t)=>{let l=new uk,i=new dk;return(async()=>{if(eb.skipAnimation)throw ck(n),i.result=ik(o,!1),u(i),i;h(l);let s=nb.obj(e)?{...e}:{...t,to:e};s.parentId=r,lb(p,((e,t)=>{nb.und(s[t])&&(s[t]=e)}));let a=await o.start(s);return h(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};if(eb.skipAnimation)return ck(n),ik(o,!1);try{let t;t=nb.arr(e)?(async e=>{for(let t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(c),m]),d=ik(o.get(),!0,!1)}catch(e){if(e instanceof uk)d=e.result;else{if(!(e instanceof dk))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return nb.fun(i)&&Of.batchedUpdates((()=>{i(d,o,o.item)})),d})():a}function ck(e,t){sb(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var uk=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},dk=class extends Error{result;constructor(){super("SkipAnimationSignal")}},pk=e=>e instanceof hk,mk=1,hk=class extends ov{id=mk++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=xv(this);return e&&e.getValue()}to(...e){return eb.to(this,e)}interpolate(...e){return _v(`${vv}The "interpolate" function is deprecated in v9 (use "to" instead)`),eb.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){nv(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||_b.sort(this),nv(this,{type:"priority",parent:this,priority:e})}},gk=Symbol.for("SpringPhase"),fk=e=>(1&e[gk])>0,bk=e=>(2&e[gk])>0,vk=e=>(4&e[gk])>0,kk=(e,t)=>t?e[gk]|=3:e[gk]&=-3,_k=(e,t)=>t?e[gk]|=4:e[gk]&=-5,yk=class extends hk{key;animation=new nk;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!nb.und(e)||!nb.und(t)){let n=nb.obj(e)?{...e}:{...t,from:e};nb.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(bk(this)||this._state.asyncTo)||vk(this)}get goal(){return ev(this.animation.to)}get velocity(){let e=xv(this);return e instanceof Mv?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return fk(this)}get isAnimating(){return bk(this)}get isPaused(){return vk(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,o=this.animation,{config:r,toValues:l}=o,i=Iv(o.to);!i&&Jb(o.to)&&(l=ib(ev(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;let c=s.constructor==Pv?1:i?i[a].lastPosition:l[a],u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t,n=s.elapsedTime+=e,l=o.fromValues[a],i=null!=s.v0?s.v0:s.v0=nb.arr(r.velocity)?r.velocity[a]:r.velocity,p=r.precision||(l==c?.005:Math.min(1,.001*Math.abs(c-l)));if(nb.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*n);d=l+i/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,t=i*o}else{t=null==s.lastVelocity?i:s.lastVelocity;let n,o=r.restVelocity||p/10,a=r.clamp?0:r.bounce,m=!nb.und(a),h=l==c?s.v0>0:l<c,g=!1,f=1,b=Math.ceil(e/f);for(let e=0;e<b&&(n=Math.abs(t)>o,n||(u=Math.abs(c-d)<=p,!u));++e){m&&(g=d==c||d>c==h,g&&(t=-t*a,d=c)),t+=(1e-6*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*f,d+=t*f}}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,n=s.elapsedTime+=e)),o=(r.progress||0)+n/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=l+r.easing(o)*(c-l),t=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));let s=xv(this),a=s.getValue();if(t){let e=ev(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return Of.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(bk(this)){let{to:e,config:t}=this.animation;Of.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 nb.und(e)?(n=this.queue||[],this.queue=[]):n=[nb.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>rk(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),ck(this._state,e&&this._lastCallId),Of.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){let t=this.key||"",{to:n,from:o}=e;n=nb.obj(n)?n[t]:n,(null==n||Xv(n))&&(n=void 0),o=nb.obj(o)?o[t]:o,null==o&&(o=void 0);let r={to:n,from:o};return fk(this)||(e.reverse&&([n,o]=[o,n]),o=ev(o),nb.und(o)?xv(this)||this._set(n):this._set(o)),r}_update({...e},t){let{key:n,defaultProps:o}=this;e.default&&Object.assign(o,Wv(e,((e,t)=>/^on/.test(t)?Uv(e,n):e))),Bk(this,e,"onProps"),Ik(this,"onProps",e,this);let r=this._prepareNode(e);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?");let l=this._state;return ok(++this._lastCallId,{key:n,props:e,defaultProps:o,state:l,actions:{pause:()=>{vk(this)||(_k(this,!0),ub(l.pauseQueue),Ik(this,"onPause",ik(this,Ek(this,this.animation.to)),this))},resume:()=>{vk(this)&&(_k(this,!1),bk(this)&&this._resume(),ub(l.resumeQueue),Ik(this,"onResume",ik(this,Ek(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=wk(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(sk(this));let o=!nb.und(e.to),r=!nb.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(sk(this));this._lastToId=t.callId}let{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s,{to:u=a,from:d=c}=e;r&&!o&&(!t.default||nb.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!ob(d,c);p&&(s.from=d),d=ev(d);let m=!ob(u,a);m&&this._focus(u);let h=Xv(t.to),{config:g}=s,{decay:f,velocity:b}=g;(o||r)&&(g.velocity=0),t.config&&!h&&function(e,t,n){n&&(ek(n={...n},t),t={...n,...t}),ek(e,t),Object.assign(e,t);for(let t in Qv)null==e[t]&&(e[t]=Qv[t]);let{mass:o,frequency:r,damping:l}=e;nb.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(g,Hv(t.config,l),t.config!==i.config?Hv(i.config,l):void 0);let v=xv(this);if(!v||nb.und(u))return n(ik(this,!0));let k=nb.und(t.reset)?r&&!t.default:!nb.und(d)&&Gv(t.reset,l),_=k?d:this.get(),y=Yv(u),E=nb.num(y)||nb.arr(y)||yv(y),w=!h&&(!E||Gv(i.immediate||t.immediate,l));if(m){let e=Ov(u);if(e!==v.constructor){if(!w)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(y)}}let S=v.constructor,C=Jb(u),x=!1;if(!C){let e=k||!fk(this)&&p;(m||e)&&(x=ob(Yv(_),y),C=!x),(!ob(s.immediate,w)&&!w||!ob(g.decay,f)||!ob(g.velocity,b))&&(C=!0)}if(x&&bk(this)&&(s.changed&&!k?C=!0:C||this._stop(a)),!h&&((C||Jb(a))&&(s.values=v.getPayload(),s.toValues=Jb(u)?null:S==Pv?[1]:ib(y)),s.immediate!=w&&(s.immediate=w,!w&&!k&&this._set(a)),C)){let{onRest:e}=s;rb(xk,(e=>Bk(this,t,e)));let o=ik(this,Ek(this,a));ub(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Of.batchedUpdates((()=>{s.changed=!k,e?.(o,this),k?Hv(i.onRest,o):s.onStart?.(o,this)}))}k&&this._set(_),h?n(ak(t.to,t,this._state,this)):C?this._start():bk(this)&&!m?this._pendingCalls.add(n):n(lk(_))}_focus(e){let t=this.animation;e!==t.to&&(tv(this)&&this._detach(),t.to=e,tv(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Jb(t)&&(lv(t,this),pk(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Jb(e)&&iv(e,this)}_set(e,t=!0){let n=ev(e);if(!nb.und(n)){let e=xv(this);if(!e||!ob(n,e.getValue())){let o=Ov(n);e&&e.constructor==o?e.setValue(n):Bv(this,o.create(n)),e&&Of.batchedUpdates((()=>{this._onChange(n,t)}))}}return xv(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Ik(this,"onStart",ik(this,Ek(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Hv(this.animation.onChange,e,this)),Hv(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;xv(this).reset(ev(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),bk(this)||(kk(this,!0),vk(this)||this._resume())}_resume(){eb.skipAnimation?this.finish():_b.start(this)}_stop(e,t){if(bk(this)){kk(this,!1);let n=this.animation;rb(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),nv(this,{type:"idle",parent:this});let o=t?sk(this.get()):ik(this.get(),Ek(this,e??n.to));ub(this._pendingCalls,o),n.changed&&(n.changed=!1,Ik(this,"onRest",o,this))}}};function Ek(e,t){let n=Yv(t);return ob(Yv(e.get()),n)}function wk(e,t=e.loop,n=e.to){let o=Hv(t);if(o){let r=!0!==o&&qv(o),l=(r||e).reverse,i=!r||r.reset;return Sk({...e,loop:t,default:!1,pause:void 0,to:!l||Xv(n)?n:void 0,from:i?e.from:void 0,reset:i,...r})}}function Sk(e){let{to:t,from:n}=e=qv(e),o=new Set;return nb.obj(t)&&Ck(t,o),nb.obj(n)&&Ck(n,o),e.keys=o.size?Array.from(o):null,e}function Ck(e,t){lb(e,((e,n)=>null!=e&&t.add(n)))}var xk=["onStart","onRest","onChange","onPause","onResume"];function Bk(e,t,n){e.animation[n]=t[n]!==$v(t,n)?Uv(t[n],e.key):void 0}function Ik(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Tk=["onStart","onChange","onRest"],Mk=1,Pk=class{id=Mk++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({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(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];nb.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Sk(e)),this}start(e){let{queue:t}=this;return e?t=ib(e).map(Sk):this.queue=[],this._flush?this._flush(this,t):(Ok(this,t),Rk(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;rb(ib(t),(t=>n[t].stop(!!e)))}else ck(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(nb.und(e))this.start({pause:!0});else{let t=this.springs;rb(ib(e),(e=>t[e].pause()))}return this}resume(e){if(nb.und(e))this.start({pause:!1});else{let t=this.springs;rb(ib(e),(e=>t[e].resume()))}return this}each(e){lb(this.springs,e)}_onFrame(){let{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,sb(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&sb(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,sb(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)}Of.onFrame(this._onFrame)}};function Rk(e,t){return Promise.all(t.map((t=>Nk(e,t)))).then((t=>rk(e,t)))}async function Nk(e,t,n){let{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=nb.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);let u=nb.arr(r)||nb.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):rb(Tk,(n=>{let o=t[n];if(nb.fun(o)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let 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])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,ub(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===$v(t,"cancel");(u||m&&d.asyncId)&&p.push(ok(++e._lastAsyncId,{props:t,state:d,actions:{pause:tb,resume:tb,start(t,n){m?(ck(d,e._lastAsyncId),n(sk(e))):(t.onRest=s,n(ak(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let h=rk(e,await Promise.all(p));if(i&&h.finished&&(!n||!h.noop)){let n=wk(t,i,r);if(n)return Ok(e,[n]),Nk(e,n,!0)}return a&&Of.batchedUpdates((()=>a(h,e,e.item))),h}function Lk(e,t){let n=new yk;return n.key=e,t&&lv(n,t),n}function Ak(e,t,n){t.keys&&rb(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ok(e,t){rb(t,(t=>{Ak(e.springs,t,(t=>Lk(t,e)))}))}var Dk=({children:e,...t})=>{let n=(0,s.useContext)(zk),o=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,s.useState)((()=>({inputs:t,result:e()}))),o=(0,s.useRef)(),r=o.current,l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,s.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:o,immediate:r})),[o,r]);let{Provider:l}=zk;return s.createElement(l,{value:t},e)},zk=function(e,t){return Object.assign(e,s.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}(Dk,{});Dk.Provider=zk.Provider,Dk.Consumer=zk.Consumer;var Vk=class extends hk{constructor(e,t){super(),this.source=e,this.calc=Ub(...t);let n=this._get(),o=Ov(n);Bv(this,o.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();ob(t,this.get())||(xv(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Hk(this._active)&&Gk(this)}_get(){let e=nb.arr(this.source)?this.source.map(ev):ib(ev(this.source));return this.calc(...e)}_start(){this.idle&&!Hk(this._active)&&(this.idle=!1,rb(Iv(this),(e=>{e.done=!1})),eb.skipAnimation?(Of.batchedUpdates((()=>this.advance())),Gk(this)):_b.start(this))}_attach(){let e=1;rb(ib(this.source),(t=>{Jb(t)&&lv(t,this),pk(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){rb(ib(this.source),(e=>{Jb(e)&&iv(e,this)})),this._active.clear(),Gk(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=ib(this.source).reduce(((e,t)=>Math.max(e,(pk(t)?t.priority:0)+1)),0))}};function Fk(e){return!1!==e.idle}function Hk(e){return!e.size||Array.from(e).every(Fk)}function Gk(e){e.idle||(e.idle=!0,rb(Iv(e),(e=>{e.done=!0})),nv(e,{type:"idle",parent:e}))}eb.assign({createStringInterpolator:bv,to:(e,t)=>new Vk(e,t)});_b.advance;const Uk=window.ReactDOM;var $k=/^--/;function jk(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||$k.test(e)||Kk.hasOwnProperty(e)&&Kk[e]?(""+t).trim():t+"px"}var Wk={};var Kk={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},Zk=["Webkit","Ms","Moz","O"];Kk=Object.keys(Kk).reduce(((e,t)=>(Zk.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Kk);var qk=/^(matrix|translate|scale|rotate|skew)/,Yk=/^(translate)/,Xk=/^(rotate|skew)/,Qk=(e,t)=>nb.num(e)&&0!==e?e+t:e,Jk=(e,t)=>nb.arr(e)?e.every((e=>Jk(e,t))):nb.num(e)?e===t:parseFloat(e)===t,e_=class extends Nv{constructor({x:e,y:t,z:n,...o}){let r=[],l=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),l.push((e=>[`translate3d(${e.map((e=>Qk(e,"px"))).join(",")})`,Jk(e,0)]))),lb(o,((e,t)=>{if("transform"===t)r.push([e||""]),l.push((e=>[e,""===e]));else if(qk.test(t)){if(delete o[t],nb.und(e))return;let n=Yk.test(t)?"px":Xk.test(t)?"deg":"";r.push(ib(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Qk(r,n)})`,Jk(r,0)]:e=>[`${t}(${e.map((e=>Qk(e,n))).join(",")})`,Jk(e,t.startsWith("scale")?1:0)])}})),r.length&&(o.transform=new t_(r,l)),super(o)}},t_=class extends ov{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return rb(this.inputs,((n,o)=>{let r=ev(n[0]),[l,i]=this.transforms[o](nb.arr(r)?r:n.map(ev));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&rb(this.inputs,(e=>rb(e,(e=>Jb(e)&&lv(e,this)))))}observerRemoved(e){0==e&&rb(this.inputs,(e=>rb(e,(e=>Jb(e)&&iv(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),nv(this,e)}};eb.assign({batchedUpdates:Uk.unstable_batchedUpdates,createStringInterpolator:bv,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}});var n_=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Nv(e)),getComponentProps:o=(e=>e)}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{let t=Fv(e)||"Anonymous";return(e=nb.str(e)?l[e]||(l[e]=Dv(e,r)):e[Vv]||(e[Vv]=Dv(e,r))).displayName=`Animated(${t})`,e};return lb(e,((t,n)=>{nb.arr(e)&&(n=Fv(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;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:o,children:r,scrollTop:l,scrollLeft:i,viewBox:s,...a}=t,c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Wk[t]||(Wk[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==r&&(e.textContent=r);for(let t in o)if(o.hasOwnProperty(t)){let n=jk(t,o[t]);$k.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==l&&(e.scrollTop=l),void 0!==i&&(e.scrollLeft=i),void 0!==s&&e.setAttribute("viewBox",s)},createAnimatedStyle:e=>new e_(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),o_=n_.animated;function r_(e){return{top:e.offsetTop,left:e.offsetLeft}}const l_=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,u.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:l,isFirstMultiSelectedBlock:i,isBlockMultiSelected:s,isAncestorMultiSelected:a}=(0,d.useSelect)(Nr),{previous:c,prevRect:p}=(0,u.useMemo)((()=>({previous:n.current&&r_(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,u.useLayoutEffect)((()=>{if(!c||!n.current)return;const e=(0,As.getScrollContainer)(n.current),u=l(t),d=u||i(t);function m(){if(d&&p){const t=n.current.getBoundingClientRect().top-p.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||o()||r()>200)return void m();const h=u||s(t)||a(t)?"1":"",g=new Pk({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:o}=e;t=Math.round(t),o=Math.round(o);const r=0===t&&0===o;n.current.style.transformOrigin="center center",n.current.style.transform=r?null:`translate3d(${t}px,${o}px,0)`,n.current.style.zIndex=h,m()}});n.current.style.transform=void 0;const f=r_(n.current),b=Math.round(c.left-f.left),v=Math.round(c.top-f.top);return g.start({x:0,y:0,from:{x:b,y:v}}),()=>{g.stop(),g.set({x:0,y:0})}}),[c,p,t,o,r,l,i,s,a]),n},i_=(0,u.createContext)({}),s_=".block-editor-block-list__block",a_=".block-list-appender",c_=".block-editor-button-block-appender";function u_(e,t){return e.closest(s_)===t.closest(s_)}function d_(e,t){return t.closest([s_,a_,c_].join(","))===e}function p_(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(s_);return t?t.id.slice(6):void 0}function m_({clientId:e,initialPosition:t}){const n=(0,u.useRef)(),{isBlockSelected:o,isMultiSelecting:r}=(0,d.useSelect)(Nr);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==t)return;if(!n.current)return;const{ownerDocument:l}=n.current;if(d_(n.current,l.activeElement))return;const i=As.focus.tabbable.find(n.current).filter((e=>(0,As.isTextField)(e))),s=-1===t,a=i[s?i.length-1:0]||n.current;if(d_(n.current,a)){if(!n.current.getAttribute("contenteditable")){const e=As.focus.tabbable.findNext(n.current);if(e&&d_(n.current,e)&&(0,As.isFormElement)(e))return void e.focus()}(0,As.placeCaretAtHorizontalEdge)(a,s)}else n.current.focus()}),[t,e]),n}function h_(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function g_({isEnabled:e}){return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",h_),t.addEventListener("mouseover",h_),()=>{t.removeEventListener("mouseout",h_),t.removeEventListener("mouseover",h_),t.classList.remove("is-hovered")}}),[e])}function f_(e){const{isBlockSelected:t}=(0,d.useSelect)(Nr),{selectBlock:n,selectionChange:o}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):d_(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}function b_({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,d.useSelect)(Nr),{insertAfterBlock:r,removeBlock:l}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((n=>{if(t)return n.addEventListener("keydown",o),n.addEventListener("dragstart",i),()=>{n.removeEventListener("keydown",o),n.removeEventListener("dragstart",i)};function o(t){const{keyCode:o,target:i}=t;o!==zs.ENTER&&o!==zs.BACKSPACE&&o!==zs.DELETE||i!==n||(0,As.isTextField)(i)||(t.preventDefault(),o===zs.ENTER?r(e):l(e))}function i(e){e.preventDefault()}}),[e,t,n,o,r,l])}function v_(e){const{isNavigationMode:t,isBlockSelected:n}=(0,d.useSelect)(Nr),{setNavigationMode:o,selectBlock:r}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.removeEventListener("mousedown",i)}}),[e,t,n,o])}function k_(){const e=(0,u.useContext)(Kw);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function __({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=ie((0,d.useSelect)(Nr));return(0,p.useRefEffect)((o=>{if(!t)return;const r=t=>{(t.target===o||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=o.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return o.addEventListener("click",r),()=>o.removeEventListener("click",r)}),[t])}function y_(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:l,index:i,mode:s,name:a,blockApiVersion:c,blockTitle:d,isSelected:m,isSubtreeDisabled:h,isOutlineEnabled:g,hasOverlay:f,initialPosition:v,blockEditingMode:k,isHighlighted:_,isMultiSelected:E,isPartiallySelected:w,isReusable:S,isDragging:C,hasChildSelected:B,removeOutline:I,isBlockMovingMode:T,canInsertMovingBlock:M,isEditingDisabled:P,hasEditableOutline:R,isTemporarilyEditingAsBlocks:N,defaultClassName:L,templateLock:A}=(0,u.useContext)(i_),O=(0,x.sprintf)((0,x.__)("Block: %s"),d),D="html"!==s||t?"":"-visual",z=(0,p.useMergeRefs)([e.ref,m_({clientId:n,initialPosition:v}),gd(n),f_(n),b_({clientId:n,isSelected:m}),v_(n),g_({isEnabled:g}),k_(),l_({triggerAnimationOnChange:i,clientId:n}),(0,p.useDisabled)({isDisabled:!f}),__({clientId:n,isEnabled:"core/block"===a||"contentOnly"===A})]),V=y(),F=!!V[b]&&eg(a)?{"--wp-admin-theme-color":"var(--wp-bound-block-color)"}:{};return c<2&&V.clientId,{tabIndex:"disabled"===k?-1:0,...r,...e,ref:z,id:`block-${n}${D}`,role:"document","aria-label":O,"data-block":n,"data-type":a,"data-title":d,inert:h?"true":void 0,className:ml()("block-editor-block-list__block",{"wp-block":!l,"has-block-overlay":f,"is-selected":m,"is-highlighted":_,"is-multi-selected":E,"is-partially-selected":w,"is-reusable":S,"is-dragging":C,"has-child-selected":B,"remove-outline":I,"is-block-moving-mode":T,"can-insert-moving-block":M,"is-editing-disabled":P,"has-editable-outline":R,"is-content-locked-temporarily-editing-as-blocks":N},o,e.className,r.className,L),style:{...r.style,...e.style,...F}}}function E_({children:e,isHtml:t,...n}){return(0,s.createElement)("div",{...y_(n,{__unstableIsHtml:t})},e)}function w_({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:l,isSelectionEnabled:i,className:a,__unstableLayoutClassNames:p,name:m,isValid:h,attributes:g,wrapperProps:f,setAttributes:b,onReplace:v,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}){var E;const{mayDisplayControls:w,mayDisplayParentControls:S,themeSupportsLayout:C,...x}=(0,u.useContext)(i_),{removeBlock:B}=(0,d.useDispatch)(Nr),I=(0,u.useCallback)((()=>B(r)),[r]),T=Ui()||{};let M=(0,s.createElement)(yf,{name:m,isSelected:l,attributes:g,setAttributes:b,insertBlocksAfter:n?void 0:k,onReplace:o?v:void 0,onRemove:o?I:void 0,mergeBlocks:o?_:void 0,clientId:r,isSelectionEnabled:i,toggleSelection:y,__unstableLayoutClassNames:p,__unstableParentLayout:Object.keys(T).length?T:void 0,mayDisplayControls:w,mayDisplayParentControls:S,blockEditingMode:x.blockEditingMode});const P=(0,c.getBlockType)(m);P?.getEditWrapperProps&&(f=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=ml()(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(f,P.getEditWrapperProps(g)));const R=f&&!!f["data-align"]&&!C,N=a?.includes("is-position-sticky");let L;if(R&&(M=(0,s.createElement)("div",{className:ml()("wp-block",N&&a),"data-align":f["data-align"]},M)),h)L="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},M),(0,s.createElement)(E_,{isHtml:!0},(0,s.createElement)(Lf,{clientId:r}))):P?.apiVersion>1?M:(0,s.createElement)(E_,null,M);else{const t=e?(0,c.serializeRawBlock)(e):(0,c.getSaveContent)(P,g);L=(0,s.createElement)(E_,{className:"has-warning"},(0,s.createElement)(If,{clientId:r}),(0,s.createElement)(u.RawHTML,null,(0,As.safeHTML)(t)))}const{"data-align":A,...O}=null!==(E=f)&&void 0!==E?E:{};return O.className=ml()(O.className,A&&C&&`align${A}`,!(A&&N)&&a),(0,s.createElement)(i_.Provider,{value:{wrapperProps:O,isAligned:R,...x}},(0,s.createElement)(Rf,{fallback:(0,s.createElement)(E_,{className:"has-warning"},(0,s.createElement)(Mf,null))},L))}y_.save=c.__unstableGetBlockProps;const S_=(0,d.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:l,replaceBlocks:i,toggleSelection:s,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:u,removeBlock:d}=e(Nr);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Nr),l=r(),{clientId:i}=t,s=l.length?l:[i];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:l}=t,{getBlockIndex:i}=n.select(Nr),s=i(o);r(e,s+1,l)},onMerge(e){const{clientId:o,rootClientId:i}=t,{getPreviousBlockClientId:s,getNextBlockClientId:a,getBlock:p,getBlockAttributes:m,getBlockName:h,getBlockOrder:g,getBlockIndex:f,getBlockRootClientId:b,canInsertBlockType:v}=n.select(Nr);function k(e,t=!0){const o=b(e),l=g(e),[i]=l;1===l.length&&(0,c.isUnmodifiedBlock)(p(i))?d(e):n.batch((()=>{if(v(h(i),o))u([i],e,o,f(e));else{const n=(0,c.switchToBlockType)(p(i),(0,c.getDefaultBlockName)());n&&n.length&&(r(n,f(e),o,t),d(i,!1))}!g(e).length&&(0,c.isUnmodifiedBlock)(p(e))&&d(e,!1)}))}if(e){if(i){const e=a(i);if(e){if(h(i)!==h(e))return void l(i,e);{const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(e),e,i),d(e,!1)}))}}}const e=a(o);if(!e)return;g(e).length?k(e,!1):l(o,e)}else{const e=s(o);if(e)l(e,o);else if(i){const e=s(i);if(e&&h(i)===h(e)){const t=m(i),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(g(i),i,e),d(i,!1)}))}k(i)}else d(o)}},onReplace(e,n,o){e.length&&!(0,c.isUnmodifiedDefaultBlock)(e[e.length-1])&&a();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;i([t.clientId],r,n,o)},toggleSelection(e){s(e)}}}));w_=(0,p.compose)(S_,(0,_l.withFilters)("editor.BlockListBlock"))(w_);const C_=(0,u.memo)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,d.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:l,getTemplateLock:i,getBlockWithoutAttributes:s,getBlockAttributes:a,canRemoveBlock:u,canMoveBlock:d,getSettings:p,__unstableGetTemporarilyEditingAsBlocks:m,getBlockEditingMode:h,getBlockName:g,isFirstMultiSelectedBlock:f,getMultiSelectedBlockClientIds:b,hasSelectedInnerBlock:v,getBlockIndex:k,isTyping:_,isBlockMultiSelected:y,isBlockSubtreeDisabled:E,isBlockHighlighted:w,__unstableIsFullySelected:S,__unstableSelectionHasUnmergeableBlock:C,isBlockBeingDragged:x,isDragging:B,hasBlockMovingClientId:I,canInsertBlockType:T,__unstableHasActiveBlockOverlayActive:M,__unstableGetEditorMode:P,getSelectedBlocksInitialCaretPosition:R}=ie(e(Nr)),N=s(t);if(!N)return;const{hasBlockSupport:L,getActiveBlockVariation:A}=e(c.store),O=o(t),D=u(t,n),z=d(t,n),V=a(t),{name:F,isValid:H}=N,G=(0,c.getBlockType)(F),U=A(F,V),{outlineMode:$,supportsLayout:j}=p(),W=y(t),K=v(t,!0),Z=_(),q=G?.apiVersion>1,Y=I(),X=h(t);return{mode:r(t),isSelectionEnabled:l(),isLocked:!!i(n),templateLock:i(t),canRemove:D,canMove:z,blockWithoutAttributes:N,name:F,attributes:V,isValid:H,isSelected:O,themeSupportsLayout:j,isTemporarilyEditingAsBlocks:m()===t,blockEditingMode:X,mayDisplayControls:O||f(t)&&b().every((e=>g(e)===F)),mayDisplayParentControls:L(g(t),"__experimentalExposeControlsToChildren",!1)&&v(t),index:k(t),blockApiVersion:G?.apiVersion||1,blockTitle:U?.title||G?.title,isSubtreeDisabled:"disabled"===X&&E(t),isOutlineEnabled:$,hasOverlay:M(t)&&!B(),initialPosition:O&&"edit"===P()?R():void 0,isHighlighted:w(t),isMultiSelected:W,isPartiallySelected:W&&!S()&&!C(),isReusable:(0,c.isReusableBlock)(G),isDragging:x(t),hasChildSelected:K,removeOutline:O&&$&&Z,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&T(g(Y),n),isEditingDisabled:"disabled"===X,hasEditableOutline:"disabled"!==X&&"disabled"===h(n),className:q?V.className:void 0,defaultClassName:q?(0,c.getBlockDefaultClassName)(F):void 0}}),[t,n]),{mode:r,isSelectionEnabled:l,isLocked:i,canRemove:a,canMove:p,blockWithoutAttributes:m,name:h,attributes:g,isValid:f,isSelected:b,themeSupportsLayout:v,isTemporarilyEditingAsBlocks:k,blockEditingMode:_,mayDisplayControls:y,mayDisplayParentControls:E,index:w,blockApiVersion:S,blockTitle:C,isSubtreeDisabled:x,isOutlineEnabled:B,hasOverlay:I,initialPosition:T,isHighlighted:M,isMultiSelected:P,isPartiallySelected:R,isReusable:N,isDragging:L,hasChildSelected:A,removeOutline:O,isBlockMovingMode:D,canInsertMovingBlock:z,templateLock:V,isEditingDisabled:F,hasEditableOutline:H,className:G,defaultClassName:U}=o,$=(0,u.useMemo)((()=>({...m,attributes:g})),[m,g]);if(!o)return null;const j={clientId:t,className:G,index:w,mode:r,name:h,blockApiVersion:S,blockTitle:C,isSelected:b,isSubtreeDisabled:x,isOutlineEnabled:B,hasOverlay:I,initialPosition:T,blockEditingMode:_,isHighlighted:M,isMultiSelected:P,isPartiallySelected:R,isReusable:N,isDragging:L,hasChildSelected:A,removeOutline:O,isBlockMovingMode:D,canInsertMovingBlock:z,templateLock:V,isEditingDisabled:F,hasEditableOutline:H,isTemporarilyEditingAsBlocks:k,defaultClassName:U,mayDisplayControls:y,mayDisplayParentControls:E,themeSupportsLayout:v};return(0,s.createElement)(i_.Provider,{value:j},(0,s.createElement)(w_,{...e,mode:r,isSelectionEnabled:l,isLocked:i,canRemove:a,canMove:p,block:$,name:h,attributes:g,isValid:f,isSelected:b}))})),x_=window.wp.htmlEntities,B_=[(0,u.createInterpolateElement)((0,x.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,x.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,x.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,x.__)("Drag files into the editor to automatically insert media blocks."),(0,x.__)("Change a block's type by pressing the block icon on the toolbar.")];const I_=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*B_.length));return(0,s.createElement)(_l.Tip,null,B_[e])},T_=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),M_=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));const P_=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&(w()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(Nr);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:i}=(0,d.useDispatch)(Nr);return(0,s.createElement)("div",{className:ml()("block-editor-block-card",r)},l&&(0,s.createElement)(_l.Button,{onClick:()=>i(l),label:(0,x.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,x.isRTL)()?T_:M_,size:"small"}),(0,s.createElement)(qh,{icon:t,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},e),n&&(0,s.createElement)("span",{className:"block-editor-block-card__description"},n)))},R_=(0,p.createHigherOrderComponent)((e=>(0,d.withRegistry)((({useSubRegistry:t=!0,registry:n,...o})=>{if(!t)return(0,s.createElement)(e,{registry:n,...o});const[r,l]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,d.createRegistry)({},n);e.registerStore(oe,Rr),l(e)}),[n]),r?(0,s.createElement)(d.RegistryProvider,{value:r},(0,s.createElement)(e,{registry:r,...o})):null}))),"withRegistryProvider"),N_=()=>{};function L_({clientId:e=null,value:t,selection:n,onChange:o=N_,onInput:r=N_}){const l=(0,d.useRegistry)(),{resetBlocks:i,resetSelection:s,replaceInnerBlocks:a,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=l.dispatch(Nr),{getBlockName:h,getBlocks:g,getSelectionStart:f,getSelectionEnd:b}=l.select(Nr),v=(0,d.useSelect)((t=>!e||t(Nr).areInnerBlocksControlled(e)),[e]),k=(0,u.useRef)({incoming:null,outgoing:[]}),_=(0,u.useRef)(!1),y=()=>{t&&(m(),e?l.batch((()=>{p(e,!0);const n=t.map((e=>(0,c.cloneBlock)(e)));_.current&&(k.current.incoming=n),m(),a(e,n)})):(_.current&&(k.current.incoming=t),i(t)))},E=(0,u.useRef)(r),w=(0,u.useRef)(o);(0,u.useEffect)((()=>{E.current=r,w.current=o}),[r,o]),(0,u.useEffect)((()=>{k.current.outgoing.includes(t)?k.current.outgoing[k.current.outgoing.length-1]===t&&(k.current.outgoing=[]):g(e)!==t&&(k.current.outgoing=[],y(),n&&s(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]),(0,u.useEffect)((()=>{v||(k.current.outgoing=[],y())}),[v]),(0,u.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:o,areInnerBlocksControlled:r}=l.select(Nr);let i=g(e),s=n(),a=!1;_.current=!0;const c=l.subscribe((()=>{if(null!==e&&null===h(e))return;if(!(!e||r(e)))return;const l=n(),c=g(e),u=c!==i;if(i=c,u&&(k.current.incoming||o()))return k.current.incoming=null,void(s=l);if(u||a&&!u&&l&&!s){s=l,k.current.outgoing.push(i);const e=s?w.current:E.current,n=wn.has(i);n&&wn.delete(i),e(i,{selection:{selectionStart:f(),selectionEnd:b(),initialPosition:t()},undoIgnore:n})}a=u}),Nr);return()=>{_.current=!1,c()}}),[l,e]),(0,u.useEffect)((()=>()=>{m(),e?(p(e,!1),m(),a(e,[])):i([])}),[])}const A_=window.wp.keyboardShortcuts;function O_(){return null}O_.Register=function(){const{registerShortcut:e}=(0,d.useDispatch)(A_.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,x.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,x.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,x.__)("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,x.__)("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,x.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,x.__)("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,x.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,x.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,x.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,x.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,x.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};const D_=O_,z_=R_((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=ie((0,d.useDispatch)(Nr));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[n,o,r]),L_(e),(0,s.createElement)(_l.SlotFillProvider,{passthrough:!0},!n?.__unstableIsPreviewMode&&(0,s.createElement)(D_.Register,null),(0,s.createElement)(hd,null,t))})),V_=e=>(0,s.createElement)(z_,{...e,stripExperimentalSettings:!0},e.children);function F_(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,d.useSelect)(Nr),{clearSelectedBlock:o}=(0,d.useDispatch)(Nr),{clearBlockSelection:r}=e();return(0,p.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)};function l(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function H_(e){return(0,s.createElement)("div",{ref:F_(),...e})}function G_(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Nr);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function U_(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,d.useSelect)(G_,[]);return(0,p.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function $_(e,t,n,o){let r,l=As.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&u_(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!As.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 j_(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,d.useSelect)(Nr),{selectBlock:l}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((i=>{let s;function a(){s=null}function c(a){if(a.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:h}=a,g=c===zs.UP,f=c===zs.DOWN,b=c===zs.LEFT,v=c===zs.RIGHT,k=g||b,_=b||v,y=g||f,E=_||y,w=d||p||m||h,S=y?As.isVerticalEdge:As.isHorizontalEdge,{ownerDocument:C}=i,{defaultView:x}=C;if(!E)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(k?l(e()):l(t(),-1))}if(!function(e,t,n){const o=t===zs.UP||t===zs.DOWN,{tagName:r}=e,l=e.getAttribute("type");if(o&&!n)return"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(l);if("INPUT"===r)return["button","checkbox","number","color","file","image","radio","reset","submit"].includes(l);return"TEXTAREA"!==r}(u,c,w))return;y?s||(s=(0,As.computeCaretRect)(x)):s=null;const B=(0,As.isRTL)(u)?!k:k,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=$_(e,t,i);return n&&p_(n)})(u,k)&&S(u,k)&&(i.contentEditable=!0,i.focus());else if(!y||!(0,As.isVerticalEdge)(u,k)||m&&!(0,As.isHorizontalEdge)(u,B)||I){if(_&&x.getSelection().isCollapsed&&(0,As.isHorizontalEdge)(u,B)&&!I){const e=$_(u,B,i);(0,As.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=$_(u,k,i,!0);e&&((0,As.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:s),a.preventDefault())}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}function W_(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,d.useSelect)(Nr),{multiSelect:o,selectBlock:r}=(0,d.useDispatch)(Nr),l=(0,A_.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((i=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,As.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,u=n(c),d=e(u);a.length!==d.length?o(d[0],d[d.length-1]):u&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function K_(e,t){e.contentEditable=t,t&&e.focus()}function Z_(){const{startMultiSelect:e,stopMultiSelect:t}=(0,d.useDispatch)(Nr),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:l}=(0,d.useSelect)(Nr);return(0,p.useRefEffect)((i=>{const{ownerDocument:s}=i,{defaultView:a}=s;let c,u;function d(){t(),a.removeEventListener("mouseup",d),u=a.requestAnimationFrame((()=>{if(!o())return;K_(i,!1);const e=a.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,o=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(o))}}))}function p({buttons:t,target:o,relatedTarget:s}){o.contains(s)||r()||1===t&&(l()||i!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",d),K_(i,!0)))}return i.addEventListener("mouseout",p),()=>{i.removeEventListener("mouseout",p),a.removeEventListener("mouseup",d),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function q_(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function Y_(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function X_(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,d.useDispatch)(Nr),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:l}=(0,d.useSelect)(Nr);return(0,p.useRefEffect)((i=>{const{ownerDocument:s}=i,{defaultView:a}=s;function c(s){const c=a.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(c);if(!i.contains(u)||!i.contains(d))return;const p=s.shiftKey&&"mouseup"===s.type;if(c.isCollapsed&&!p){if("true"===i.contentEditable&&!l()){q_(i,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let m=p_(u),h=p_(d);if(p){const e=r(),t=p_(s.target),n=t!==h;(m===h&&c.isCollapsed||!h||n)&&(h=t),m!==e&&(m=e)}if(void 0===m&&void 0===h)return void q_(i,!1);if(m===h)l()?e(m,m):t(m);else{const t=[...o(m),m],r=[...o(h),h],l=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[l]!==m||r[l]!==h)return void e(t[l],r[l]);const i=Y_(u),s=Y_(d);if(i&&s){var g,f;const e=c.getRangeAt(0),t=(0,Y.create)({element:i,range:e,__unstableIsEditableTree:!0}),o=(0,Y.create)({element:s,range:e,__unstableIsEditableTree:!0}),r=null!==(g=t.start)&&void 0!==g?g:t.end,l=null!==(f=o.start)&&void 0!==f?f:o.end;n({start:{clientId:m,attributeKey:i.dataset.wpBlockAttributeKey,offset:r},end:{clientId:h,attributeKey:s.dataset.wpBlockAttributeKey,offset:l}})}else e(m,h)}}return s.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{s.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}}),[e,t,n,o])}function Q_(){const{selectBlock:e}=(0,d.useDispatch)(Nr),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,d.useSelect)(Nr);return(0,p.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=p_(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function J_(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,d.useSelect)(Nr),{replaceBlocks:r,__unstableSplitSelection:l,removeBlocks:i,__unstableDeleteSelection:s,__unstableExpandSelection:a}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((u=>{function d(e){"true"===u.contentEditable&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===zs.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,c.createBlock)((0,c.getDefaultBlockName)())):l()):d.keyCode===zs.BACKSPACE||d.keyCode===zs.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?i(t()):n()?s(d.keyCode===zs.DELETE):a()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===zs.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?s():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function ey(){const{getBlockName:e}=(0,d.useSelect)(Nr),{getBlockType:t}=(0,d.useSelect)(c.store),{createSuccessNotice:n}=(0,d.useDispatch)(Os.store);return(0,u.useCallback)(((o,r)=>{let l="";if(1===r.length){const n=r[0],i=t(e(n))?.title;l="copy"===o?(0,x.sprintf)((0,x.__)('Copied "%s" to clipboard.'),i):(0,x.sprintf)((0,x.__)('Moved "%s" to clipboard.'),i)}else l="copy"===o?(0,x.sprintf)((0,x._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,x.sprintf)((0,x._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function ty({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}n=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const o=(e=e.substring(n+20)).indexOf("\x3c!--EndFragment--\x3e");return o>-1&&(e=e.substring(0,o)),e}(n),n=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(22):e}(n);const o=(0,As.getFilesFromDataTransfer)(e);return o.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(o,n)?{files:o}:{html:n,plainText:t,files:[]}}const ny=Symbol("requiresWrapperOnCopy");function oy(e,t,n){let o=t;const[r]=t;if(r){if(n.select(c.store).getBlockType(r.name)[ny]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:l}=n.select(Nr),i=e(r.clientId),s=t(i);s&&(o=(0,c.createBlock)(s,l(i),o))}}const l=(0,c.serialize)(o);e.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,As.__unstableStripHTML)(e).trim().replace(/\n\n+/g,"\n\n")}(l)),e.clipboardData.setData("text/html",l)}function ry(e,t){const{plainText:n,html:o,files:r}=ty(e);let l=[];if(r.length){const e=(0,c.getBlockTransforms)("from");l=r.reduce(((t,n)=>{const o=(0,c.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat()}else l=(0,c.pasteHandler)({HTML:o,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return l}function ly(){const e=(0,d.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:o,getSettings:r,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a,canInsertBlockType:c}=(0,d.useSelect)(Nr),{flashBlock:u,removeBlocks:m,replaceBlocks:h,__unstableDeleteSelection:g,__unstableExpandSelection:f,insertBlocks:b}=(0,d.useDispatch)(Nr),v=ey();return(0,p.useRefEffect)((d=>{function p(p){if(p.defaultPrevented)return;const k=n();if(0===k.length)return;if(!o()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,As.documentHasUncollapsedSelection)(t):(0,As.documentHasSelection)(t))return}if(!d.contains(p.target.ownerDocument.activeElement))return;p.preventDefault();const _=s(),y=i()||l(),E=!y&&!_;if("copy"===p.type||"cut"===p.type)if(1===k.length&&u(k[0]),E)f();else{let n;if(v(p.type,k),y)n=t(k);else{const[e,o]=a();n=[e,...t(k.slice(1,k.length-1)),o]}oy(p,n,e)}if("cut"===p.type)y&&!E?m(k):(p.target.ownerDocument.activeElement.contentEditable=!1,g());else if("paste"===p.type){const{__experimentalCanUserUseUnfilteredHTML:e}=r(),t=ry(p,e);if(1===k.length){const[e]=k;if(t.every((t=>c(t.name,e))))return void b(t,void 0,e)}h(k,t,t.length-1,-1)}}return d.ownerDocument.addEventListener("copy",p),d.ownerDocument.addEventListener("cut",p),d.ownerDocument.addEventListener("paste",p),()=>{d.ownerDocument.removeEventListener("copy",p),d.ownerDocument.removeEventListener("cut",p),d.ownerDocument.removeEventListener("paste",p)}}),[])}function iy(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:l}=(0,d.useSelect)(Nr),{setNavigationMode:i,setLastFocus:a}=ie((0,d.useDispatch)(Nr)),c=(0,d.useSelect)((e=>e(Nr).isNavigationMode()),[]),{getLastFocus:m}=ie((0,d.useSelect)(Nr)),h=c?void 0:"0",g=(0,u.useRef)();function f(t){if(g.current)g.current=null;else if(o())e.current.focus();else if(r())m()?.current.focus();else{i(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,o=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=As.focus.tabbable.find(e.current);r.length&&(o?r[0]:r[r.length-1]).focus()}}const b=(0,s.createElement)("div",{ref:t,tabIndex:h,onFocus:f}),v=(0,s.createElement)("div",{ref:n,tabIndex:h,onFocus:f}),k=(0,p.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===zs.ESCAPE&&!o())return e.preventDefault(),void i(!0);if(e.keyCode!==zs.TAB)return;const l=e.shiftKey,a=l?"findPrevious":"findNext";if(!o()&&!r())return void(e.target===s&&i(!0));const c=As.focus.tabbable[a](e.target),u=e.target.closest("[data-block]"),d=u&&c&&(u_(u,c)||d_(u,c));if((0,As.isFormElement)(c)&&d)return;const p=l?t:n;g.current=!0,p.current.focus({preventScroll:!0})}function u(e){a({...m(),current:e.target});const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==l()||s.focus()}function d(o){if(o.keyCode!==zs.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",l=As.focus.tabbable[r](o.target);l!==t.current&&l!==n.current||(o.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:p}=s,{defaultView:h}=p;return h.addEventListener("keydown",d),s.addEventListener("keydown",c),s.addEventListener("focusout",u),()=>{h.removeEventListener("keydown",d),s.removeEventListener("keydown",c),s.removeEventListener("focusout",u)}}),[]);return[b,(0,p.useMergeRefs)([e,k]),v]}(),o=(0,d.useSelect)((e=>e(Nr).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,ly(),J_(),Z_(),X_(),Q_(),U_(),W_(),j_(),(0,p.useRefEffect)((e=>{if(e.tabIndex=0,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,x.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}const sy=(0,u.forwardRef)((function({children:e,...t},n){const[o,r,l]=iy();return(0,s.createElement)(s.Fragment,null,o,(0,s.createElement)("div",{...t,ref:(0,p.useMergeRefs)([r,n]),className:ml()(t.className,"block-editor-writing-flow")},e),l)}));let ay=null;function cy(e,t,n){const o={};for(const t in e)o[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();o.clientX+=e.left,o.clientY+=e.top}const r=new t(e.type,o);o.defaultPrevented&&r.preventDefault();!n.dispatchEvent(r)&&e.preventDefault()}function uy(e){return(0,p.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],l={};for(const e of r)l[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;cy(e,window[t],n)},o.addEventListener(e,l[e]);return()=>{for(const e of r)o.removeEventListener(e,l[e])}}))}function dy({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,expand:l=!1,readonly:i,forwardedRef:a,...c}){const{resolvedAssets:m,isPreviewMode:h}=(0,d.useSelect)((e=>{const t=e(Nr).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:g="",scripts:f=""}=m,[b,v]=(0,u.useState)(),[k,_]=(0,u.useState)([]),y=F_(),[E,w,S]=iy(),[C,{height:B}]=(0,p.useResizeObserver)(),I=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:l}=o;t=o,y(l),_(Array.from(r.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),o.dir=r.dir;for(const e of ay||(ay=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:o})=>n?e(o):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(o)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.push(o.cloneNode(!0))}}return e}),[]),ay))o.getElementById(e.id)||(o.head.appendChild(e.cloneNode(!0)),h||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{v(e.contentDocument)},e.addEventListener("load",o),()=>{delete e._load,e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),T=(0,p.useDisabled)({isDisabled:!i}),M=(0,p.useMergeRefs)([uy(b),e,y,w,T]),P=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>html{height:auto!important;min-height:100%;}body{margin:0}</style>\n\t\t${g}\n\t\t${f}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[R,N]=(0,u.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([P],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[P]);(0,u.useEffect)((()=>N),[N]);const L=B*(1-o)/2;return(0,s.createElement)(s.Fragment,null,n>=0&&E,(0,s.createElement)("iframe",{...c,style:{border:0,...c.style,height:l?B:c.style?.height,marginTop:1!==o?-L+r:c.style?.marginTop,marginBottom:1!==o?-L+r:c.style?.marginBottom,transform:1!==o?`scale( ${o} )`:c.style?.transform,transition:"all .3s"},ref:(0,p.useMergeRefs)([a,I]),tabIndex:n,src:R,title:(0,x.__)("Editor canvas"),onKeyDown:e=>{c.onKeyDown?c.onKeyDown(e):e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),cy(e,window.KeyboardEvent,e.currentTarget))}},b&&(0,u.createPortal)((0,s.createElement)("body",{ref:M,className:ml()("block-editor-iframe__body","editor-styles-wrapper",...k)},C,(0,s.createElement)(_l.__experimentalStyleProvider,{document:b},t)),b.documentElement)),n>=0&&S)}const py=(0,u.forwardRef)((function(e,t){return(0,d.useSelect)((e=>e(Nr).getSettings().__internalIsInitialized),[])?(0,s.createElement)(dy,{...e,forwardedRef:t}):null}));var my=n(4529);const hy=my,gy=(my.stringify,my.fromJSON,my.plugin,my.parse,my.list,my.document,my.comment,my.atRule,my.rule,my.decl,my.root,my.CssSyntaxError);my.Declaration,my.Container,my.Processor,my.Document,my.Comment,my.Warning,my.AtRule,my.Result,my.Input,my.Rule,my.Root,my.Node;var fy=n(8036),by=n.n(fy),vy=n(5404),ky=n.n(vy);const _y=new WeakMap;const yy=(e,t="")=>e.map((e=>{if(_y.has(e))return _y.get(e);const n=function({css:e,ignoredSelectors:t=[],baseURL:n},o=""){if(!o&&!n)return e;try{return hy([o&&by()(o,{ignoredSelectors:[...t,o]}),n&&ky()({rootUrl:n})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof gy?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t);return _y.set(e,n),n}));function Ey(e,t){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,l=t?n.querySelector(t):r;let i;if(l)i=o?.getComputedStyle(l,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const s=Vc(i);s.luminance()>.5||0===s.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}function wy({styles:e,scope:t}){const n=(0,d.useSelect)((e=>ie(e(Nr)).getStyleOverrides()),[]),[o,r]=(0,u.useMemo)((()=>{const o=Object.values(null!=e?e:[]);for(const[e,t]of n){const n=o.findIndex((({id:t})=>e===t)),r={...t,id:e};-1===n?o.push(r):o[n]=r}return[yy(o.filter((e=>e?.css)),t),o.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,n,t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Ey(o,t)}),o.map(((e,t)=>(0,s.createElement)("style",{key:t},e))),(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:r}}))}let Sy;Hc([Gc,jc]);const Cy=2e3,xy=[];function By({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=xy}){e||(e=t);const[r,{height:l}]=(0,p.useResizeObserver)(),{styles:i}=(0,d.useSelect)((e=>({styles:e(Nr).getSettings().styles})),[]),a=(0,u.useMemo)((()=>i?[...i,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:i),[i,o]);Sy=Sy||(0,u.memo)(Xw);const c=t/e,m=l?t/(l*c):0;return(0,s.createElement)(_l.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${c})`,aspectRatio:m,maxHeight:l>Cy?Cy*c:void 0,minHeight:n}},(0,s.createElement)(py,{contentRef:(0,p.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:l,pointerEvents:"none",maxHeight:Cy,minHeight:0!==c&&c<1&&n?n/c:n}},(0,s.createElement)(wy,{styles:a}),r,(0,s.createElement)(Sy,{renderAppender:!1})))}function Iy(e){const[t,{width:n}]=(0,p.useResizeObserver)();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,s.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,s.createElement)(By,{...e,containerWidth:n})))}const Ty=(0,u.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=[],__experimentalMinHeight:r,__experimentalPadding:l}){r&&(n=r,w()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],w()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const i=(0,d.useSelect)((e=>e(Nr).getSettings()),[]),a=(0,u.useMemo)((()=>({...i,focusMode:!1,__unstableIsPreviewMode:!0})),[i]),c=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,s.createElement)(z_,{value:c,settings:a},(0,s.createElement)(Iy,{viewportWidth:t,minHeight:n,additionalStyles:o})):null}));function My({blocks:e,props:t={},layout:n}){const o=(0,d.useSelect)((e=>e(Nr).getSettings()),[]),r=(0,u.useMemo)((()=>({...o,styles:void 0,focusMode:!1,__unstableIsPreviewMode:!0})),[o]),l=(0,p.useDisabled)(),i=(0,p.useMergeRefs)([t.ref,l]),a=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),c=(0,s.createElement)(z_,{value:a,settings:r},(0,s.createElement)(wy,null),(0,s.createElement)(Jw,{renderAppender:!1,layout:n}));return{...t,ref:i,className:ml()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?c:null}}const Py=function({item:e}){var t;const{name:n,title:o,icon:r,description:l,initialAttributes:i,example:a}=e,d=(0,c.isReusableBlock)(e),p=(0,u.useMemo)((()=>a?(0,c.getBlockFromExample)(n,{attributes:{...a.attributes,...i},innerBlocks:a.innerBlocks}):(0,c.createBlock)(n,i)),[n,a,i]);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||a?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Ty,{blocks:p,viewportWidth:null!==(t=a?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 24px; }"}]})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,x.__)("No preview available."))),!d&&(0,s.createElement)(P_,{title:o,icon:r,description:l}))},{CompositeItemV2:Ry}=ie(_l.privateApis);const Ny=(0,u.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){return(0,s.createElement)(Ry,{ref:r,role:"option",accessibleWhenDisabled:!0,...o,render:o=>{const r={...o,tabIndex:e?0:o.tabIndex};return t?(0,s.createElement)(t,{...r},n):"function"==typeof n?n(r):(0,s.createElement)(_l.Button,{...r},n)}})})),Ly=(0,s.createElement)(Z.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Ay({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,x.__)("Pattern");return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,s.createElement)(_l.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(_l.FlexItem,null,t?(0,s.createElement)(qh,{icon:t}):r||(0,x.sprintf)((0,x._n)("%d block","%d blocks",e),e)),(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(qh,{icon:Ly})),o&&(0,s.createElement)(_l.FlexItem,{className:"block-editor-block-draggable-chip__disabled"},(0,s.createElement)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})))))}const Oy=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const l={type:"inserter",blocks:t},i=(0,d.useSelect)((e=>{const{getBlockType:n}=e(c.store);return 1===t.length&&n(t[0].name)?.icon}),[t]),{startDragging:a,stopDragging:u}=ie((0,d.useDispatch)(Nr));return(0,s.createElement)(_l.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,onDragStart:e=>{a();const n=r?.type===Fn.user&&"unsynced"!==r?.syncStatus?[(0,c.createBlock)("core/block",{ref:r.id})]:t;e.dataTransfer.setData("text/html",(0,c.serialize)(n))},onDragEnd:()=>{u()},__experimentalDragComponent:(0,s.createElement)(Ay,{count:t.length,icon:n||!r&&i,isPattern:!!r})},(({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})))};const Dy=(0,u.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:l,...i}){const a=(0,u.useRef)(!1),d=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},p=(0,u.useMemo)((()=>[(0,c.createBlock)(n.name,n.initialAttributes,(0,c.createBlocksFromInnerBlocksTemplate)(n.innerBlocks))]),[n.name,n.initialAttributes,n.innerBlocks]),m=(0,c.isReusableBlock)(n)&&"unsynced"!==n.syncStatus||(0,c.isTemplatePart)(n);return(0,s.createElement)(Oy,{isEnabled:l&&!n.isDisabled,blocks:p,icon:n.icon},(({draggable:l,onDragStart:c,onDragEnd:u})=>(0,s.createElement)("div",{className:ml()("block-editor-block-types-list__list-item",{"is-synced":m}),draggable:l,onDragStart:e=>{a.current=!0,c&&(r(null),c(e))},onDragEnd:e=>{a.current=!1,u&&u(e)}},(0,s.createElement)(Ny,{isFirst:t,className:ml()("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,zs.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===zs.ENTER&&(e.preventDefault(),o(n,(0,zs.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{a.current||r(n)},onMouseLeave:()=>r(null),...i},(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:d},(0,s.createElement)(qh,{icon:n.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(_l.__experimentalTruncate,{numberOfLines:3},n.title))))))}));const zy=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,vo.speak)((0,x.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)},...e})})),{CompositeGroupV2:Vy}=ie(_l.privateApis);const Fy=(0,u.forwardRef)((function(e,t){return(0,s.createElement)(Vy,{role:"presentation",ref:t,...e})}));const Hy=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:l,isDraggable:i=!0}){const a="block-editor-block-types-list",u=(0,p.useInstanceId)(e,a);return(0,s.createElement)(zy,{className:a,"aria-label":l},function(e,t){const n=[];for(let o=0,r=e.length;o<r;o+=t)n.push(e.slice(o,o+t));return n}(t,3).map(((e,t)=>(0,s.createElement)(Fy,{key:t},e.map(((e,r)=>(0,s.createElement)(Dy,{key:e.id,item:e,className:(0,c.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:i&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${u}-${t}`})))))),r)};const Gy=function({title:e,icon:t,children:n}){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},e),(0,s.createElement)(_l.Icon,{icon:t})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},n))},{CompositeV2:Uy,useCompositeStoreV2:$y}=ie(_l.privateApis);const jy=function({children:e}){const t=$y({focusShift:!0,focusWrap:"horizontal"});return(0,s.createElement)(Uy,{store:t,render:(0,s.createElement)(s.Fragment,null)},e)},Wy=[];const Ky=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[r,l,i,a]=qg(e,t),c=(0,u.useMemo)((()=>ne(r,"frecency","desc").slice(0,6)),[r]),d=(0,u.useMemo)((()=>r.filter((e=>!e.category))),[r]),m=(0,u.useMemo)((()=>(0,p.pipe)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>e.reduce(((e,t)=>{const{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{})))(r)),[r]),h=(0,u.useMemo)((()=>{const e={...i};return Object.keys(i).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,i]);(0,u.useEffect)((()=>()=>n(null)),[]);const g=(0,p.useAsyncList)(l),f=l.length===g.length,b=(0,u.useMemo)((()=>Object.entries(i)),[i]),v=(0,p.useAsyncList)(f?b:Wy);return(0,s.createElement)(jy,null,(0,s.createElement)("div",null,o&&!!c.length&&(0,s.createElement)(Gy,{title:(0,x._x)("Most used","blocks")},(0,s.createElement)(Hy,{items:c,onSelect:a,onHover:n,label:(0,x._x)("Most used","blocks")})),g.map((e=>{const t=m[e.slug];return t&&t.length?(0,s.createElement)(Gy,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Hy,{items:t,onSelect:a,onHover:n,label:e.title})):null})),f&&d.length>0&&(0,s.createElement)(Gy,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,x.__)("Uncategorized")},(0,s.createElement)(Hy,{items:d,onSelect:a,onHover:n,label:(0,x.__)("Uncategorized")})),v.map((([e,t])=>{const o=h[e];return o&&o.length?(0,s.createElement)(Gy,{key:e,title:t.title,icon:t.icon},(0,s.createElement)(Hy,{items:o,onSelect:a,onHover:n,label:t.title})):null}))))};function Zy({selectedCategory:e,patternCategories:t,onClickCategory:n}){const o="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${o}__categories-list`},t.map((({name:t,label:r})=>(0,s.createElement)(_l.Button,{key:t,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)}},r))))}function qy({searchValue:e,setSearchValue:t}){return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(_l.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,x.__)("Search for patterns"),placeholder:(0,x.__)("Search")}))}const Yy=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:o,setSearchValue:r}){return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(qy,{searchValue:o,setSearchValue:r}),!o&&(0,s.createElement)(Zy,{selectedCategory:e,patternCategories:t,onClickCategory:n}))};function Xy({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,s.createElement)(_l.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper"},(0,s.createElement)(_l.__experimentalText,{variant:"muted"},(0,x.sprintf)((0,x._n)("%s item","%s items",o),o)),t>1&&(0,s.createElement)(_l.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination"},(0,s.createElement)(_l.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous"},(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,x.__)("First page")},(0,s.createElement)("span",null,"«")),(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,x.__)("Previous page")},(0,s.createElement)("span",null,"‹"))),(0,s.createElement)(_l.__experimentalText,{variant:"muted"},(0,x.sprintf)((0,x._x)("%1$s of %2$s","paging"),e,t)),(0,s.createElement)(_l.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next"},(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,x.__)("Next page")},(0,s.createElement)("span",null,"›")),(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,x.__)("Last page"),size:"default"},(0,s.createElement)("span",null,"»")))))}const{CompositeV2:Qy,CompositeItemV2:Jy,useCompositeStoreV2:eE}=ie(_l.privateApis),tE=({showTooltip:e,title:t,children:n})=>e?(0,s.createElement)(_l.Tooltip,{text:t},n):(0,s.createElement)(s.Fragment,null,n);function nE({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTooltip:l}){const[i,a]=(0,u.useState)(!1),{blocks:c,viewportWidth:d}=n,m=`block-editor-block-patterns-list__item-description-${(0,p.useInstanceId)(nE)}`;return(0,s.createElement)(Oy,{isEnabled:t,blocks:c,pattern:n},(({draggable:t,onDragStart:u,onDragEnd:p})=>(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{a(!0),u&&(r?.(null),u(e))},onDragEnd:e=>{a(!1),p&&p(e)}},(0,s.createElement)(tE,{showTooltip:l&&!n.type!==Fn.user,title:n.title},(0,s.createElement)(Jy,{render:(0,s.createElement)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?m:void 0,className:ml()("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===Fn.user&&!n.syncStatus})}),id:e,onClick:()=>{o(n,c),r?.(null)},onMouseEnter:()=>{i||r?.(n)},onMouseLeave:()=>r?.(null)},(0,s.createElement)(Ty,{blocks:c,viewportWidth:d}),(0,s.createElement)(_l.__experimentalHStack,{className:"block-editor-patterns__pattern-details"},n.type===Fn.user&&!n.syncStatus&&(0,s.createElement)("div",{className:"block-editor-patterns__pattern-icon-wrapper"},(0,s.createElement)(Ti,{className:"block-editor-patterns__pattern-icon",icon:q})),(!l||n.type===Fn.user)&&(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title)),!!n.description&&(0,s.createElement)(_l.VisuallyHidden,{id:m},n.description))))))}function oE(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const rE=(0,u.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:l,label:i=(0,x.__)("Block patterns"),showTitlesAsTooltip:a,pagingProps:c},d){const p=eE({orientation:l}),{setActiveId:m}=p;return(0,u.useEffect)((()=>{m(void 0)}),[m,n,t]),(0,s.createElement)(Qy,{store:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:d},t.map((t=>n.includes(t)?(0,s.createElement)(nE,{key:t.name,id:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,showTooltip:a}):(0,s.createElement)(oE,{key:t.name}))),c&&(0,s.createElement)(Xy,{...c}))}));const lE=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:l=!0,selectBlockOnInsert:i=!0}){const{getSelectedBlock:s}=(0,d.useSelect)(Nr),{destinationRootClientId:a,destinationIndex:p}=(0,d.useSelect)((r=>{const{getSelectedBlockClientId:l,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=r(Nr),c=l();let u,d=e;return void 0!==t?u=t:n?u=s(n):!o&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,o]),{replaceBlocks:m,insertBlocks:h,showInsertionPoint:g,hideInsertionPoint:f}=(0,d.useDispatch)(Nr),b=(0,u.useCallback)(((e,t,n=!1)=>{const u=s();!o&&u&&(0,c.isUnmodifiedDefaultBlock)(u)?m(u.clientId,e,null,l||n?0:null,t):h(e,p,a,i,l||n?0:null,t);const d=Array.isArray(e)?e.length:1,g=(0,x.sprintf)((0,x._n)("%d block added.","%d blocks added.",d),d);(0,vo.speak)(g),r&&r(e)}),[o,s,m,h,a,p,r,l,i]),v=(0,u.useCallback)((e=>{e?g(a,p):f()}),[g,f,a,p]);return[a,b,v]},iE=(e,t)=>{const{patternCategories:n,patterns:o,userPatternCategories:r}=(0,d.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Nr),{__experimentalUserPatternCategories:r,__experimentalBlockPatternCategories:l}=o();return{patterns:n(t),userPatternCategories:r,patternCategories:l}}),[t]),l=(0,u.useMemo)((()=>{const e=[...n];return r?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[n,r]),{createSuccessNotice:i}=(0,d.useDispatch)(Os.store),s=(0,u.useCallback)(((t,n)=>{const o=t.type===Fn.user&&"unsynced"!==t.syncStatus?[(0,c.createBlock)("core/block",{ref:t.id})]:n;e((null!=o?o:[]).map((e=>(0,c.cloneBlock)(e))),t.name),i((0,x.sprintf)((0,x.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[i,e]);return[o,l,s]},sE=20,aE=5;function cE(e,t,n,o=""){const[r,l]=(0,u.useState)(1),i=(0,p.usePrevious)(t),s=(0,p.usePrevious)(o);i===t&&s===o||1===r||l(1);const a=e.length,c=r-1,d=(0,u.useMemo)((()=>e.slice(c*sE,c*sE+sE)),[c,e]),m=(0,p.useAsyncList)(d,{step:aE}),h=Math.ceil(e.length/sE);return(0,u.useEffect)((function(){const e=(0,As.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:a,categoryPatterns:d,categoryPatternsAsyncList:m,numPages:h,changePage:e=>{const t=(0,As.getScrollContainer)(n?.current);t?.scrollTo(0,0),l(e)},currentPage:r}}function uE({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,s.createElement)(_l.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,x.sprintf)((0,x._n)("%d pattern found","%d patterns found",t),t)):null}const dE=function({searchValue:e,selectedCategory:t,patternCategories:n}){const o=(0,u.useRef)(),r=(0,p.useDebounce)(vo.speak,500),[l,i]=lE({shouldFocusBlock:!0}),[a,,c]=iE(i,l),d=(0,u.useMemo)((()=>n.map((e=>e.name))),[n]),m=(0,u.useMemo)((()=>{const n=a.filter((e=>{if(t===Gn.name)return!0;if(t===Un.name&&e.type===Fn.user)return!0;if("uncategorized"===t){const t=e.categories.some((e=>d.includes(e)));return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?Kg(n,e):n}),[e,a,t,d]);(0,u.useEffect)((()=>{if(!e)return;const t=m.length,n=(0,x.sprintf)((0,x._n)("%d result found.","%d results found.",t),t);r(n)}),[e,r,m.length]);const h=cE(m,t,o),[g,f]=(0,u.useState)(e);e!==g&&(f(e),h.changePage(1));const b=!!m?.length;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list",ref:o},(0,s.createElement)(uE,{filterValue:e,filteredBlockPatternsLength:m.length}),(0,s.createElement)(jy,null,b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(rE,{shownPatterns:h.categoryPatternsAsyncList,blockPatterns:h.categoryPatterns,onClickPattern:c,isDraggable:!1}),(0,s.createElement)(Xy,{...h}))))};function pE(e,t="all"){const[n,o]=iE(void 0,e),r=(0,u.useMemo)((()=>"all"===t?n:n.filter((e=>!$n(e,t)))),[t,n]),l=(0,u.useMemo)((()=>{const e=o.filter((e=>r.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return r.some((e=>!function(e,t){return!(!e.categories||!e.categories.length)&&e.categories.some((e=>t.some((t=>t.name===e))))}(e,o)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,x._x)("Uncategorized")}),r.some((e=>e.type===Fn.user))&&e.unshift(Un),r.length>0&&e.unshift({name:Gn.name,label:Gn.label}),(0,vo.speak)((0,x.sprintf)((0,x._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r]);return l}function mE({initialCategory:e,rootClientId:t}){const[n,o]=(0,u.useState)(""),[r,l]=(0,u.useState)("all"),[i,a]=(0,u.useState)(e?.name),c=pE(t,r);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Yy,{selectedCategory:i,patternCategories:c,onClickCategory:a,searchValue:n,setSearchValue:o,patternSourceFilter:r,setPatternSourceFilter:l}),(0,s.createElement)(dE,{searchValue:n,selectedCategory:i,patternCategories:c,patternSourceFilter:r}))}const hE=function({onModalClose:e,...t}){return(0,s.createElement)(_l.Modal,{title:(0,x.__)("Patterns"),onRequestClose:e,isFullScreen:!0},(0,s.createElement)(mE,{...t}))};function gE({title:e}){return(0,s.createElement)(_l.__experimentalVStack,{spacing:0},(0,s.createElement)(_l.__experimentalView,null,(0,s.createElement)(_l.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(_l.__experimentalHStack,{spacing:2},(0,s.createElement)(_l.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,x.isRTL)()?T_:M_,isSmall:!0,"aria-label":(0,x.__)("Navigate to the previous view")}),(0,s.createElement)(_l.__experimentalSpacer,null,(0,s.createElement)(_l.__experimentalHeading,{level:5},e))))))}function fE({categories:e,children:t}){return(0,s.createElement)(_l.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,s.createElement)(_l.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(_l.__experimentalItemGroup,null,e.map((e=>(0,s.createElement)(_l.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:_l.__experimentalItem,isAction:!0},(0,s.createElement)(_l.__experimentalHStack,null,(0,s.createElement)(_l.FlexBlock,null,e.label),(0,s.createElement)(Ti,{icon:(0,x.isRTL)()?M_:T_}))))))),e.map((e=>(0,s.createElement)(_l.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,s.createElement)(gE,{title:(0,x.__)("Back")}),t(e)))))}const bE=e=>"all"!==e,vE=e=>e.name===Un.name;function kE({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:l}){const i=l.name===Un.name?Fn.user:o,a=bE(i),c=vE(l),d=(0,u.useMemo)((()=>[{value:"all",label:(0,x._x)("All","patterns")},{value:Hn.full,label:(0,x._x)("Synced","patterns"),disabled:a},{value:Hn.unsynced,label:(0,x._x)("Not synced","patterns"),disabled:a}]),[a]),p=(0,u.useMemo)((()=>[{value:"all",label:(0,x._x)("All","patterns"),disabled:c},{value:Fn.directory,label:(0,x.__)("Pattern Directory"),disabled:c},{value:Fn.theme,label:(0,x.__)("Theme & Plugins"),disabled:c},{value:Fn.user,label:(0,x.__)("User")}]),[c]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.DropdownMenu,{popoverProps:{placement:"right-end"},label:"Filter patterns",icon:(0,s.createElement)(Ti,{icon:(0,s.createElement)(_l.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(_l.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"#1E1E1E"}))})},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Source")},(0,s.createElement)(_l.MenuItemsChoice,{choices:p,onSelect:n=>{var o;t(o=n),bE(o)&&e("all"),r.current?.scrollTo(0,0)},value:i})),(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Type")},(0,s.createElement)(_l.MenuItemsChoice,{choices:d,onSelect:t=>{e(t),r.current?.scrollTo(0,0)},value:n})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,u.createInterpolateElement)((0,x.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,s.createElement)(_l.ExternalLink,{href:(0,x.__)("https://wordpress.org/patterns/")})}))))))}const _E=()=>{};function yE({rootClientId:e,onInsert:t,onHover:n=_E,category:o,showTitlesAsTooltip:r}){const[l,,i]=iE(t,e),[a,c]=(0,u.useState)("all"),[d,p]=(0,u.useState)("all"),m=pE(e,d),h=(0,u.useRef)(),g=(0,u.useMemo)((()=>l.filter((e=>!$n(e,d,a)&&(o.name===Gn.name||(o.name===Un.name&&e.type===Fn.user||("uncategorized"===o.name?!e.categories||!e.categories.some((e=>m.some((t=>t.name===e)))):e.categories?.includes(o.name))))))),[l,m,o.name,d,a]),f=cE(g,o,h),{changePage:b}=f;(0,u.useEffect)((()=>()=>n(null)),[]);const v=(0,u.useCallback)((e=>{c(e),b(1)}),[c,b]),k=(0,u.useCallback)((e=>{p(e),b(1)}),[p,b]);return(0,s.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,s.createElement)(_l.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header"},(0,s.createElement)(_l.__experimentalHStack,null,(0,s.createElement)(_l.FlexBlock,null,(0,s.createElement)(_l.__experimentalHeading,{level:4,as:"div"},o.label)),(0,s.createElement)(kE,{patternSyncFilter:a,patternSourceFilter:d,setPatternSyncFilter:v,setPatternSourceFilter:k,scrollContainerRef:h,category:o})),!g.length&&(0,s.createElement)(_l.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results"},(0,x.__)("No results found"))),g.length>0&&(0,s.createElement)(rE,{ref:h,shownPatterns:f.categoryPatternsAsyncList,blockPatterns:f.categoryPatterns,onClickPattern:i,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:d,pagingProps:f}))}const EE=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o}){const[r,l]=(0,u.useState)(!1),i=pE(o),a=t||i[0],c=(0,p.useViewportMatch)("medium","<");return(0,s.createElement)(s.Fragment,null,!c&&(0,s.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,s.createElement)("nav",{"aria-label":(0,x.__)("Block pattern categories"),className:"block-editor-inserter__block-patterns-tabs"},(0,s.createElement)(_l.__experimentalItemGroup,{role:"list"},i.map((n=>(0,s.createElement)(_l.__experimentalItem,{role:"listitem",key:n.name,onClick:()=>e(n),className:n===t?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":n.label,"aria-current":n===t?"true":void 0},(0,s.createElement)(_l.__experimentalHStack,null,(0,s.createElement)(_l.FlexBlock,null,n.label),(0,s.createElement)(Ti,{icon:(0,x.isRTL)()?M_:T_}))))),(0,s.createElement)("div",{role:"listitem"},(0,s.createElement)(_l.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>l(!0),variant:"secondary"},(0,x.__)("Explore all patterns")))))),c&&(0,s.createElement)(fE,{categories:i},(e=>(0,s.createElement)(yE,{key:e.name,onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),r&&(0,s.createElement)(hE,{initialCategory:a,patternCategories:i,onModalClose:()=>l(!1),rootClientId:o}))};function wE({rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:l}){const i=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=As.focus.tabbable.find(i.current);e?.focus()}));return()=>clearTimeout(e)}),[o]),(0,s.createElement)("div",{ref:i,className:"block-editor-inserter__patterns-category-dialog"},(0,s.createElement)(yE,{key:o.name,rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:l}))}function SE(e){const[t,n]=(0,u.useState)([]),o=(0,d.useSelect)((e=>ie(e(Nr)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:l,canInsertAudio:i}=(0,d.useSelect)((t=>{const{canInsertBlockType:n}=t(Nr);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,u.useEffect)((()=>{(async()=>{const e=[];if(!o)return;const t=new Map(await Promise.all(o.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),s={image:r,video:l,audio:i};o.forEach((n=>{s[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,l,i,o]),t}const CE=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),xE={image:"img",video:"video",audio:"audio"};function BE(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},o=e.url,r=e.alt||void 0;"image"===t?(n.url=o,n.alt=r):["video","audio"].includes(t)&&(n.src=o);const l=xE[t],i=(0,s.createElement)(l,{src:e.previewUrl||o,alt:r,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=o)}});return[(0,c.createBlock)(`core/${t}`,n),i]}const IE=["image"],TE=25,ME={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"},{CompositeItemV2:PE}=ie(_l.privateApis);function RE({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,s.createElement)(_l.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,x.__)("Options"),popoverProps:ME,icon:Ef},(()=>(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(_l.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:CE},(0,x.sprintf)((0,x.__)("Report %s"),e.mediaType)))))}function NE({onClose:e,onSubmit:t}){return(0,s.createElement)(_l.Modal,{title:(0,x.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,s.createElement)(_l.__experimentalVStack,{spacing:3},(0,s.createElement)("p",null,(0,x.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,s.createElement)("p",null,(0,x.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,s.createElement)(_l.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:e},(0,x.__)("Cancel"))),(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(_l.Button,{variant:"primary",onClick:t},(0,x.__)("Insert")))))}function LE({media:e,onClick:t,category:n}){const[o,r]=(0,u.useState)(!1),[l,i]=(0,u.useState)(!1),[a,p]=(0,u.useState)(!1),[m,h]=(0,u.useMemo)((()=>BE(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:g,createSuccessNotice:f}=(0,d.useDispatch)(Os.store),b=(0,d.useSelect)((e=>e(Nr).getSettings().mediaUpload),[]),v=(0,u.useCallback)((e=>{if(a)return;const n=(0,c.cloneBlock)(e),{id:o,url:l,caption:i}=n.attributes;o?t(n):(p(!0),window.fetch(l).then((e=>e.blob())).then((e=>{b({filesList:[e],additionalData:{caption:i},onFileChange([e]){(0,Ls.isBlobURL)(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),f((0,x.__)("Image uploaded and inserted."),{type:"snackbar"}),p(!1))},allowedTypes:IE,onError(e){g(e,{type:"snackbar"}),p(!1)}})})).catch((()=>{r(!0),p(!1)})))}),[a,t,b,g,f]),k="string"==typeof e.title?e.title:e.title?.rendered||(0,x.__)("no title");let _;if(k.length>TE){const e="...";_=k.slice(0,TE-e.length)+e}const y=(0,u.useCallback)((()=>i(!0)),[]),E=(0,u.useCallback)((()=>i(!1)),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Oy,{isEnabled:!0,blocks:[m]},(({draggable:t,onDragStart:o,onDragEnd:r})=>(0,s.createElement)("div",{className:ml()("block-editor-inserter__media-list__list-item",{"is-hovered":l}),draggable:t,onDragStart:o,onDragEnd:r},(0,s.createElement)("div",{onMouseEnter:y,onMouseLeave:E},(0,s.createElement)(_l.Tooltip,{text:_||k},(0,s.createElement)(PE,{render:(0,s.createElement)("div",{"aria-label":k,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>v(m)},(0,s.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},h,a&&(0,s.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,s.createElement)(_l.Spinner,null))))),!a&&(0,s.createElement)(RE,{category:n,media:e}))))),o&&(0,s.createElement)(NE,{onClose:()=>r(!1),onSubmit:()=>{t((0,c.cloneBlock)(m)),f((0,x.__)("Image inserted."),{type:"snackbar"}),r(!1)}}))}const{CompositeV2:AE,useCompositeStoreV2:OE}=ie(_l.privateApis);const DE=function({mediaList:e,category:t,onClick:n,label:o=(0,x.__)("Media List")}){const r=OE();return(0,s.createElement)(AE,{store:r,role:"listbox",className:"block-editor-inserter__media-list","aria-label":o},e.map(((e,o)=>(0,s.createElement)(LE,{key:e.id||e.sourceId||o,media:e,category:t,onClick:n}))))};const zE=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Ti,{className:"block-editor-inserter__no-results-icon",icon:Zh}),(0,s.createElement)("p",null,(0,x.__)("No results found.")))},VE=10;function FE({rootClientId:e,onInsert:t,category:n}){const o=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=As.focus.tabbable.find(o.current);e?.focus()}));return()=>clearTimeout(e)}),[n]),(0,s.createElement)("div",{ref:o,className:"block-editor-inserter__media-dialog"},(0,s.createElement)(HE,{rootClientId:e,onInsert:t,category:n}))}function HE({rootClientId:e,onInsert:t,category:n}){const[o,r,l]=(0,p.useDebouncedInput)(),{mediaList:i,isLoading:a}=function(e,t={}){const[n,o]=(0,u.useState)(),[r,l]=(0,u.useState)(!1),i=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});i.current=n,l(!0),o([]);const r=await(e.fetch?.(t));n===i.current&&(o(r),l(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:l?20:VE,search:l}),c="block-editor-inserter__media-panel",d=n.labels.search_items||(0,x.__)("Search");return(0,s.createElement)("div",{className:c},(0,s.createElement)(_l.SearchControl,{className:`${c}-search`,onChange:r,value:o,label:d,placeholder:d}),a&&(0,s.createElement)("div",{className:`${c}-spinner`},(0,s.createElement)(_l.Spinner,null)),!a&&!i?.length&&(0,s.createElement)(zE,null),!a&&!!i?.length&&(0,s.createElement)(DE,{rootClientId:e,onClick:t,mediaList:i,category:n}))}const GE=["image","video","audio"];const UE=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o}){const r=SE(e),l=(0,p.useViewportMatch)("medium","<"),i="block-editor-inserter__media-tabs",a=(0,u.useCallback)((e=>{if(!e?.url)return;const[t]=BE(e,e.type);o(t)}),[o]),c=(0,u.useMemo)((()=>r.map((e=>({...e,label:e.labels.name})))),[r]);return(0,s.createElement)(s.Fragment,null,!l&&(0,s.createElement)("div",{className:`${i}-container`},(0,s.createElement)("nav",{"aria-label":(0,x.__)("Media categories")},(0,s.createElement)(_l.__experimentalItemGroup,{role:"list",className:i},r.map((e=>(0,s.createElement)(_l.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>n(e),className:ml()(`${i}__media-category`,{"is-selected":t===e}),"aria-label":e.labels.name,"aria-current":e===t?"true":void 0},(0,s.createElement)(_l.__experimentalHStack,null,(0,s.createElement)(_l.FlexBlock,null,e.labels.name),(0,s.createElement)(Ti,{icon:(0,x.isRTL)()?M_:T_}))))),(0,s.createElement)("div",{role:"listitem"},(0,s.createElement)(Us,null,(0,s.createElement)(Gs,{multiple:!1,onSelect:a,allowedTypes:GE,render:({open:e})=>(0,s.createElement)(_l.Button,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,x.__)("Open Media Library"))})))))),l&&(0,s.createElement)(fE,{categories:c},(t=>(0,s.createElement)(HE,{onInsert:o,rootClientId:e,category:t}))))},{Fill:$E,Slot:jE}=(0,_l.createSlotFill)("__unstableInserterMenuExtension");$E.Slot=jE;const WE=$E,KE=[];const ZE=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:h=!1,isDraggable:g=!0,shouldFocusBlock:f=!0,prioritizePatterns:b,selectBlockOnInsert:v}){const k=(0,p.useDebounce)(vo.speak,500),{prioritizedBlocks:_}=(0,d.useSelect)((e=>{const t=e(Nr).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||KE}}),[r]),[y,E]=lE({onSelect:t,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:f,selectBlockOnInsert:v}),[w,S,C,B]=qg(y,E),[I,,T]=iE(E,y),M=(0,u.useMemo)((()=>{if(0===c)return[];const t=Kg(I,e);return void 0!==c?t.slice(0,c):t}),[e,I,c]);let P=m;b&&M.length>2&&(P=0);const R=(0,u.useMemo)((()=>{if(0===P)return[];let t=ne(w.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&_.length&&(t=Yg(t,_));const n=Wg(t,S,C,e);return void 0!==P?n.slice(0,P):n}),[e,w,S,C,P,_]);(0,u.useEffect)((()=>{if(!e)return;const t=R.length+M.length,n=(0,x.sprintf)((0,x._n)("%d result found.","%d results found.",t),t);k(n)}),[e,k,R,M]);const N=(0,p.useAsyncList)(R,{step:9}),L=(0,p.useAsyncList)(N.length===R.length?M:KE),A=R.length>0||M.length>0,O=!!R.length&&(0,s.createElement)(Gy,{title:(0,s.createElement)(_l.VisuallyHidden,null,(0,x.__)("Blocks"))},(0,s.createElement)(Hy,{items:N,onSelect:B,onHover:n,label:(0,x.__)("Blocks"),isDraggable:g})),D=!!M.length&&(0,s.createElement)(Gy,{title:(0,s.createElement)(_l.VisuallyHidden,null,(0,x.__)("Block patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(rE,{shownPatterns:L,blockPatterns:M,onClickPattern:T,onHover:o,isDraggable:g})));return(0,s.createElement)(jy,null,!h&&!A&&(0,s.createElement)(zE,null),b?D:O,!!R.length&&!!M.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?O:D,h&&(0,s.createElement)(WE.Slot,{fillProps:{onSelect:B,onHover:n,filterValue:e,hasItems:A,rootClientId:y}},(e=>e.length?e:A?null:(0,s.createElement)(zE,null))))},{Tabs:qE}=ie(_l.privateApis),YE={name:"blocks",title:(0,x.__)("Blocks")},XE={name:"patterns",title:(0,x.__)("Patterns")},QE={name:"media",title:(0,x.__)("Media")};const JE=function({showPatterns:e=!1,showMedia:t=!1,onSelect:n,tabsContents:o}){const r=[YE,e&&XE,t&&QE].filter(Boolean);return(0,s.createElement)("div",{className:"block-editor-inserter__tabs"},(0,s.createElement)(qE,{onSelect:n},(0,s.createElement)(qE.TabList,null,r.map((e=>(0,s.createElement)(qE.Tab,{key:e.name,tabId:e.name},e.title)))),r.map((e=>(0,s.createElement)(qE.TabPanel,{key:e.name,tabId:e.name,focusable:!1},o[e.name])))))};const ew=(0,u.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalFilterValue:a="",shouldFocusBlock:c=!0},m){const[h,g,f]=(0,p.useDebouncedInput)(a),[b,v]=(0,u.useState)(null),[k,_]=(0,u.useState)(null),[y,E]=(0,u.useState)("all"),[w,S]=(0,u.useState)(null),[C,B]=(0,u.useState)(null),[I,T,M]=lE({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:c}),{showPatterns:P}=(0,d.useSelect)((e=>{const{hasAllowedPatterns:t}=ie(e(Nr));return{showPatterns:t(I)}}),[I]),R=SE(I).length>0,N=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),r()}),[T,r]),L=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),r()}),[T,r]),A=(0,u.useCallback)((e=>{M(!!e),v(e)}),[M,v]),O=(0,u.useCallback)((e=>{M(!!e)}),[M]),D=(0,u.useCallback)(((e,t)=>{_(e),E(t)}),[_]),z=(0,u.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Ky,{rootClientId:I,onInsert:N,onHover:A,showMostUsedBlocks:i})),l&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(_l.VisuallyHidden,{as:"h2"},(0,x.__)("A tip for using the block editor")),(0,s.createElement)(I_,null)))),[I,N,A,i,l]),V=(0,u.useMemo)((()=>(0,s.createElement)(EE,{rootClientId:I,onInsert:L,onSelectCategory:D,selectedCategory:k})),[I,L,D,k]),F=(0,u.useMemo)((()=>(0,s.createElement)(UE,{rootClientId:I,selectedCategory:w,onSelectCategory:S,onInsert:N})),[I,N,w,S]),H=(0,u.useMemo)((()=>({blocks:z,patterns:V,media:F})),[z,F,V]),G=(0,u.useRef)();(0,u.useImperativeHandle)(m,(()=>({focusSearch:()=>{G.current.focus()}})));const U="patterns"===C&&!f&&k,$=!f&&(P||R),j="media"===C&&!f&&w;return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:ml()("block-editor-inserter__main-area",{"show-as-tabs":$})},(0,s.createElement)(_l.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{b&&v(null),g(e)},value:h,label:(0,x.__)("Search for blocks and patterns"),placeholder:(0,x.__)("Search"),ref:G}),!!f&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,s.createElement)(ZE,{filterValue:f,onSelect:r,onHover:A,onHoverPattern:O,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:c})),$&&(0,s.createElement)(JE,{showPatterns:P,showMedia:R,onSelect:e=>{"patterns"!==e&&_(null),B(e)},tabsContents:H}),!f&&!$&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},z)),j&&(0,s.createElement)(FE,{rootClientId:I,onInsert:N,category:w}),l&&b&&(0,s.createElement)(_l.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1},(0,s.createElement)(Py,{item:b})),U&&(0,s.createElement)(wE,{rootClientId:I,onInsert:L,onHover:O,category:k,patternFilter:y,showTitlesAsTooltip:!0}))}));function tw({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:l,hasSearch:i=!0}){const[a,c]=(0,u.useState)(""),[p,m]=lE({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:l}),[h]=qg(p,m),[g]=iE(m,p),{setInserterIsOpened:f,insertionIndex:b}=(0,d.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(Nr),l=t(),i=o(n),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[n]),v=g.length&&(!!a||r),k=i&&(v&&g.length>6||h.length>6);(0,u.useEffect)((()=>{f&&f(!1)}),[f]);let _=0;return v&&(_=r?4:2),(0,s.createElement)("div",{className:ml()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":f})},k&&(0,s.createElement)(_l.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:a,onChange:e=>{c(e)},label:(0,x.__)("Search for blocks and patterns"),placeholder:(0,x.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(ZE,{filterValue:a,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:_,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:l})),f&&(0,s.createElement)(_l.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{f({rootClientId:t,insertionIndex:b,filterValue:a})},"aria-label":(0,x.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,x.__)("Browse all")))}const nw=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:l={},prioritizePatterns:i})=>{const{as:a=_l.Button,label:c,onClick:u,...d}=l;let p=c;return!p&&r?p=(0,x.sprintf)((0,x._x)("Add %s","directly add the only allowed block"),o):!p&&i?p=(0,x.__)("Add pattern"):p||(p=(0,x._x)("Add block","Generic label for block inserter button")),(0,s.createElement)(a,{icon:na,label:p,tooltipPosition:"bottom",onClick:function(t){e&&e(t),u&&u(t)},className:"block-editor-inserter__toggle","aria-haspopup":!r&&"true","aria-expanded":!r&&n,disabled:t,...d})};class ow extends u.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:o,hasSingleBlockType:r,directInsertBlock:l,toggleProps:i,hasItems:s,renderToggle:a=nw,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!s,blockTitle:o,hasSingleBlockType:r,directInsertBlock:l,toggleProps:i,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:l,prioritizePatterns:i,onSelectOrClose:a,selectBlockOnInsert:c}=this.props;return l?(0,s.createElement)(tw,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;a&&"function"==typeof a&&a(n),e()},rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:c}):(0,s.createElement)(ew,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(_l.Dropdown,{className:"block-editor-inserter",contentClassName:ml()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,x.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const rw=(0,p.compose)([(0,d.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:l,getAllowedBlocks:i,getDirectInsertBlock:s,getSettings:a}=e(Nr),{getBlockVariations:u}=e(c.store),d=i(n=n||r(t)||void 0),p=o&&s(n),m=a(),h=1===d?.length&&0===u(d[0].name,"inserter")?.length;let g=!1;return h&&(g=d[0]),{hasItems:l(n),hasSingleBlockType:h,blockTitle:g?g.title:"",allowedBlockType:g,directInsertBlock:p,rootClientId:n,prioritizePatterns:m.__experimentalPreferPatternsOnRoot&&!n}})),(0,d.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:l,hasSingleBlockType:i,allowedBlockType:s,directInsertBlock:a,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!i&&!a)return;const{insertBlock:p}=e(Nr);let m;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:l}=n(Nr);if(!e||!r&&!o)return{};const i={};let s={};if(r){const e=t(r),n=t(l(r));e?.name===n?.name&&(s=n?.attributes||{})}else{const e=t(o);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];a&&a?.name===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(a.attributesToCopy);m=(0,c.createBlock)(a.name,{...a.attributes||{},...e})}else m=(0,c.createBlock)(s.name);p(m,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:i,getBlockRootClientId:s}=n(Nr);if(r)return e(r);const a=t();return!l&&a&&s(a)===o?e(a)+1:i(o).length}(),o,d),u&&u({clientId:m?.clientId});const h=(0,x.sprintf)((0,x.__)("%s block added"),s.title);(0,vo.speak)(h)}}))),(0,p.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(ow),lw=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(rw,{ref:t,...e}))),iw="\ufeff";function sw({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:o}=(0,d.useSelect)((t=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=t(Nr),l=!n(e),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(e),placeholder:i}}),[e]),{insertDefaultBlock:r,startTyping:l}=(0,d.useDispatch)(Nr);if(n)return null;const i=(0,x_.decodeEntities)(o)||(0,x.__)("Type / to choose a block"),a=()=>{r(void 0,e),l()};return(0,s.createElement)("div",{"data-root-client-id":e||"",className:ml()("block-editor-default-block-appender",{"has-visible-prompt":t})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,x.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{zs.ENTER!==e.keyCode&&zs.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()}},t?i:iw),(0,s.createElement)(lw,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}function aw({rootClientId:e,className:t,onFocus:n,tabIndex:o},r){return(0,s.createElement)(lw,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:l,isOpen:i,blockTitle:a,hasSingleBlockType:c})=>{let u;u=c?(0,x.sprintf)((0,x._x)("Add %s","directly add the only allowed block"),a):(0,x._x)("Add block","Generic label for block inserter button");const d=!c;let p=(0,s.createElement)(_l.Button,{ref:r,onFocus:n,tabIndex:o,className:ml()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":d?"true":void 0,"aria-expanded":d?i:void 0,disabled:l,label:u},!c&&(0,s.createElement)(_l.VisuallyHidden,{as:"span"},u),(0,s.createElement)(Ti,{icon:na}));return(d||c)&&(p=(0,s.createElement)(_l.Tooltip,{text:u},p)),p},isAppender:!0})}const cw=(0,u.forwardRef)(((e,t)=>(w()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),aw(e,t)))),uw=(0,u.forwardRef)(aw);function dw({rootClientId:e}){return(0,d.useSelect)((t=>t(Nr).canInsertBlockType((0,c.getDefaultBlockName)(),e)))?(0,s.createElement)(sw,{rootClientId:e}):(0,s.createElement)(uw,{rootClientId:e,className:"block-list-appender__toggle"})}function pw({rootClientId:e,CustomAppender:t,className:n,tagName:o="div"}){const r=(0,d.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(Nr),l=n();return o()&&e===l?.rootClientId&&0===r(e)}),[e]);return(0,s.createElement)(o,{tabIndex:-1,className:ml()("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0},t?(0,s.createElement)(t,null):(0,s.createElement)(dw,{rootClientId:e}))}const mw=Number.MAX_SAFE_INTEGER;(0,u.createContext)();const hw=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,operation:l="insert",nearestSide:i="right",...a}){const[c,p]=(0,u.useReducer)((e=>(e+1)%mw),0),{orientation:m,rootClientId:h,isVisible:g}=(0,d.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:l}=n(Nr),i=r(null!=e?e:t);return{orientation:o(i)?.orientation||"vertical",rootClientId:i,isVisible:l(e)&&l(t)}}),[e,t]),f=bd(e),b=bd(t),v="vertical"===m,k=(0,u.useMemo)((()=>{if(c<0||!f&&!b||!g)return;return{contextElement:"group"===l?b||f:f||b,getBoundingClientRect(){const e=f?f.getBoundingClientRect():null,t=b?b.getBoundingClientRect():null;let n=0,o=0,r=0,s=0;if("group"===l){const l=t||e;o=l.top,r=0,s=l.bottom-l.top,n="left"===i?l.left-2:l.right-2}else v?(o=e?e.bottom:t.top,r=e?e.width:t.width,s=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,s=e?e.height:t.height,(0,x.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0));return new window.DOMRect(n,o,r,s)}}}),[f,b,c,v,g,l,i]),_=hm(r);return(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(p);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,u.useLayoutEffect)((()=>{if(!b)return;const e=new window.MutationObserver(p);return e.observe(b,{attributes:!0}),()=>{e.disconnect()}}),[b]),(0,u.useLayoutEffect)((()=>{if(f)return f.ownerDocument.defaultView.addEventListener("resize",p),()=>{f.ownerDocument.defaultView?.removeEventListener("resize",p)}}),[f]),(f||b)&&g?(0,s.createElement)(_l.Popover,{ref:_,animate:!1,anchor:k,focusOnMount:!1,__unstableSlotName:o,inline:!o,key:t+"--"+h,...a,className:ml()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"},(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},n)):null},gw={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};const fw=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(Nr),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,p.useReducedMotion)();return(0,s.createElement)(fm,{clientId:n,__unstableCoverTarget:!0,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone"},(0,s.createElement)(_l.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?gw.show:gw.hide,animate:gw.show,exit:o?gw.show:gw.exit,className:"block-editor-block-popover__drop-zone-foreground"}))},bw=(0,u.createContext)();function vw({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:o="right"}){const{selectBlock:r,hideInsertionPoint:l}=(0,d.useDispatch)(Nr),i=(0,u.useContext)(bw),a=(0,u.useRef)(),{orientation:c,previousClientId:m,nextClientId:h,rootClientId:g,isInserterShown:f,isDistractionFree:b,isNavigationMode:v}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:l,getNextBlockClientId:i,getSettings:s,isNavigationMode:a}=e(Nr),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=l(d);for(;r(p);)p=i(p);const m=s();return{previousClientId:d,nextClientId:p,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:a(),isDistractionFree:m.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),{getBlockEditingMode:k}=(0,d.useSelect)(Nr),_=(0,p.useReducedMotion)();const y={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:f?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},E={start:{scale:_?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(b&&!v)return null;const w="horizontal"===c||"group"===n?"is-horizontal":"is-vertical",S=ml()("block-editor-block-list__insertion-point",w);return(0,s.createElement)(hw,{previousClientId:m,nextClientId:h,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:o},(0,s.createElement)(_l.__unstableMotion.div,{layout:!_,initial:_?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:function(e){e.target===a.current&&h&&"disabled"!==k(h)&&r(h,-1)},onFocus:function(e){e.target!==a.current&&(i.current=!0)},className:ml()(S,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==a.current||i.current||l()}},(0,s.createElement)(_l.__unstableMotion.div,{variants:y,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),f&&(0,s.createElement)(_l.__unstableMotion.div,{variants:E,className:ml()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(lw,{position:"bottom center",clientId:h,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1}}))))}function kw(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,d.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(Nr),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,s.createElement)(fw,{key:`${t.rootClientId}-${t.index}`,...e}):(0,s.createElement)(vw,{operation:t.operation,nearestSide:t.nearestSide,...e})}function _w(){const e=(0,u.useContext)(bw),t=(0,d.useSelect)((e=>e(Nr).getSettings().isDistractionFree||"zoom-out"===e(Nr).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:l,getTemplateLock:i,__unstableIsWithinBlockOverlay:s,getBlockEditingMode:a,getBlockName:c}=(0,d.useSelect)(Nr),{showInsertionPoint:m,hideInsertionPoint:h}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((u=>{if(!t)return u.addEventListener("mousemove",d),()=>{u.removeEventListener("mousemove",d)};function d(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void h();let u;if(!t.target.classList.contains("is-root-container")){u=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")}if(i(u)||"disabled"===a(u)||"core/block"===c(u))return;const d=n(u)?.orientation||"vertical",p=t.clientY,g=t.clientX;let f=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===d&&t.top>p||e.classList.contains("wp-block")&&"horizontal"===d&&((0,x.isRTL)()?t.right<g:t.left>g)}));if(!f)return void h();if(!f.id&&(f=f.firstElementChild,!f))return void h();const b=f.id.slice(6);if(!b||s(b))return;if(l().includes(b))return;const v=f.getBoundingClientRect();if("horizontal"===d&&(t.clientY>v.bottom||t.clientY<v.top)||"vertical"===d&&(t.clientX>v.right||t.clientX<v.left))return void h();const k=o(b);0!==k?m(u,k,{__unstableWithInserter:!0}):h()}}),[e,n,o,r,m,h,l,t])}const yw=(0,p.createHigherOrderComponent)((e=>t=>{const{clientId:n}=y();return(0,s.createElement)(e,{...t,clientId:n})}),"withClientId"),Ew=yw((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:o,isToggle:r})=>(0,s.createElement)(uw,{className:ml()({"block-list-appender__toggle":r}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:o}))),ww=(0,p.compose)([yw,(0,d.withSelect)(((e,{clientId:t})=>{const{getBlockOrder:n}=e(Nr),o=n(t);return{lastBlockClientId:o[o.length-1]}}))])((({clientId:e})=>(0,s.createElement)(sw,{rootClientId:e}))),Sw=new WeakMap;function Cw(e,t,n,o,r,l,i,s,a,c,p,m){const{updateBlockListSettings:h}=(0,d.useDispatch)(Nr),g=(0,d.useRegistry)(),f=function(e){const[t,n]=(0,u.useState)(e);return js()(t,e)||n(e),t}(n),b=(0,u.useMemo)((()=>o),o),v=void 0===a||"contentOnly"===t?t:a;(0,u.useLayoutEffect)((()=>{const t={allowedBlocks:f,prioritizedInserterBlocks:b,templateLock:v};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==p)t.orientation=p;else{const e=Vi(m?.type);t.orientation=e.getOrientation(m)}void 0!==i&&(w()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=i),void 0!==r&&(t.defaultBlock=r),void 0!==s&&(w()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=s),void 0!==l&&(t.directInsert=l),Sw.get(g)||Sw.set(g,[]),Sw.get(g).push([e,t]),window.queueMicrotask((()=>{Sw.get(g)?.length&&g.batch((()=>{Sw.get(g).forEach((e=>{h(...e)})),Sw.set(g,[])}))}))}),[e,f,b,v,r,l,i,s,c,p,h,m,g])}function xw(e,t,n,o,r,l,i,s,a){return u=>{const{srcRootClientId:d,srcClientIds:p,type:m,blocks:h}=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}(u);if("inserter"===m){i();const e=h.map((e=>(0,c.cloneBlock)(e)));l(e,!0,null)}if("block"===m){const i=n(p[0]);if(d===e&&i===t)return;if(p.includes(e)||o(p).some((t=>t===e)))return;if("group"===s){const e=p.map((e=>a(e)));return void l(e,!0,null,p)}const c=d===e,u=p.length;r(p,d,c&&i<t?t-u:t)}}}function Bw(e,t,n={}){const{operation:o="insert",nearestSide:r="right"}=n,{canInsertBlockType:l,getBlockIndex:i,getClientIdsOfDescendants:s,getBlockOrder:a,getBlocksByClientId:p,getSettings:m,getBlock:h,isGroupable:g}=(0,d.useSelect)(Nr),{getGroupingBlockName:f}=(0,d.useSelect)(c.store),{insertBlocks:b,moveBlocksToPosition:v,updateBlockAttributes:k,clearSelectedBlock:_,replaceBlocks:y,removeBlocks:E}=(0,d.useDispatch)(Nr),w=(0,d.useRegistry)(),S=(0,u.useCallback)(((n,i=!0,s=0,u=[])=>{Array.isArray(n)||(n=[n]);const d=a(e)[t],p=n.map((e=>e.clientId)),m=g([...p,d]);if("replace"===o)y(d,n,void 0,s);else if("group"===o&&m){const t=h(d);"left"===r?n.push(t):n.unshift(t);const o=n.map((e=>(0,c.createBlock)(e.name,e.attributes,e.innerBlocks))),i=n.every((e=>"core/image"===e.name)),a=l("core/gallery",e),p=(0,c.createBlock)(i&&a?"core/gallery":f(),{layout:{type:"flex",flexWrap:i&&a?null:"nowrap"}},o);y([d,...u],p,void 0,s)}else b(n,t,e,i,s)}),[a,e,t,g,o,y,h,r,l,f,b]),C=(0,u.useCallback)(((n,r,l)=>{if("replace"===o){const o=p(n),r=a(e)[t];w.batch((()=>{E(n,!1),y(r,o,void 0,0)}))}else v(n,r,e,l)}),[o,a,p,v,w,E,y,t,e]),x=xw(e,t,i,s,C,S,_,o,h),B=function(e,t,n,o,r){return l=>{if(!t().mediaUpload)return;const i=(0,c.findTransform)((0,c.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(l)));if(i){const e=i.transform(l,n);r(e)}}}(e,m,k,l,S),I=function(e){return t=>{const n=(0,c.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(S);return e=>{const t=(0,As.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?I(n):t.length?B(t):x(e)}}function Iw(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const l=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}(e,t,n);(void 0===o||l<o)&&(o=l,r=n)})),[o,r]}function Tw(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Mw=30,Pw=120,Rw=120;function Nw(e,t,n,o){let r=!0;if(t){const e=t?.map((({name:e})=>e));r=n.every((t=>e?.includes(t)))}const l=n.map((t=>e(t))).every((e=>{const[t]=e?.parent||[];return!t||t===o}));return r&&l}function Lw({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,d.useRegistry)(),[l,i]=(0,u.useState)({index:null,operation:"insert"}),{getBlockType:s}=(0,d.useSelect)(c.store),{getBlockListSettings:a,getBlocks:m,getBlockIndex:h,getDraggedBlockClientIds:g,getBlockNamesByClientId:f,getAllowedBlocks:b,isDragging:v}=ie((0,d.useSelect)(Nr)),{showInsertionPoint:k,hideInsertionPoint:_,startDragging:y,stopDragging:E}=ie((0,d.useDispatch)(Nr)),w=Bw("before"===l.operation||"after"===l.operation?n:t,l.index,{operation:l.operation,nearestSide:l.nearestSide}),S=(0,p.useThrottle)((0,u.useCallback)(((o,l)=>{v()||y();const u=b(t),d=f([t])[0],p=f(g());if(!Nw(s,u,p,d))return;const _=m(t);if(0===_.length)return void r.batch((()=>{i({index:0,operation:"insert"}),k(t,0,{operation:"insert"})}));const E=_.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,c.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>l.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:h(t),blockOrientation:a(t)?.orientation}})),[w,S,C]=function(e,t,n="vertical",o={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let l=0,i="before",s=1/0,a=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:p=0}=o;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,o]=Iw(t,e,["top","bottom"]);if(e.height>Pw&&n<Mw){if("top"===o)return[p,"before"];if("bottom"===o)return[p+1,"after"]}}const m=(0,x.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,o]=Iw(t,e,["left","right"]);if(e.width>Rw&&n<Mw){if(m&&"right"===o||!m&&"left"===o)return[p,"before"];if(m&&"left"===o||!m&&"right"===o)return[p+1,"after"]}}e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:o,blockIndex:u,blockOrientation:d})=>{const p=o();let[h,g]=Iw(t,p,r);const[f,b]=Iw(t,p,["left","right"]),v=Tw(t,p);e&&v?h=0:"vertical"===n&&"horizontal"!==d&&(v&&f<Mw||!v&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,p))&&(a=u,c=b),h<s&&(i="bottom"===g||!m&&"right"===g||m&&"left"===g?"after":"before",s=h,l=u)}));const h=l+("after"===i?1:-1),g=!!e[l]?.isUnmodifiedDefaultBlock,f=!!e[h]?.isUnmodifiedDefaultBlock;if(null!==a)return[a,"group",c];if(!g&&!f)return["after"===i?l+1:l,"insert"];return[g?l:h,"replace"]}(E,{x:o.clientX,y:o.clientY},a(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?a(n)?.orientation:void 0,rootBlockIndex:h(t)});r.batch((()=>{i({index:w,operation:S,nearestSide:C});const e=["before","after"].includes(S)?n:t;k(e,w,{operation:S,nearestSide:C})}))}),[b,t,f,g,s,m,a,e,n,h,r,k,v,y]),200);return(0,p.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:w,onDragOver(e){S(e,e.currentTarget.ownerDocument)},onDragLeave(){S.cancel(),_()},onDragEnd(){S.cancel(),E(),_()}})}const Aw={};function Ow({children:e,clientId:t}){const n=function(e){return(0,d.useSelect)((t=>{const n=t(Nr).getBlock(e);if(!n)return;const o=t(c.store).getBlockType(n.name);return o&&0!==Object.keys(o.providesContext).length?Object.fromEntries(Object.entries(o.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t);return(0,s.createElement)(ff,{value:n},e)}const Dw=(0,u.memo)(Jw);function zw(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:l,__experimentalDefaultBlock:i,__experimentalDirectInsert:a,template:p,templateLock:m,wrapperRef:h,templateInsertUpdatesSelection:g,__experimentalCaptureToolbars:f,__experimentalAppenderTagName:b,renderAppender:v,orientation:k,placeholder:_,layout:y,name:E,blockType:w,parentLock:S,defaultLayout:x}=e;Cw(t,S,n,o,r,l,i,a,m,f,k,y),function(e,t,n,o){const{getBlocks:r,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:i}=(0,d.useSelect)(Nr),{replaceInnerBlocks:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,d.useDispatch)(Nr),p=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=r(e),m=0===d.length||"all"===n||"contentOnly"===n,h=!C()(t,p.current);if(!m||!h)return;p.current=t;const g=(0,c.synchronizeBlocksWithTemplate)(d,t);C()(g,d)||(a(),s(e,g,0===d.length&&o&&0!==g.length&&i(e),l()))})),()=>{u=!0}}),[t,n,e])}(t,p,m,g);const B=(0,c.getBlockSupport)(E,"layout")||(0,c.getBlockSupport)(E,"__experimentalLayout")||Aw,{allowSizingOnChildren:I=!1}=B,T=y||B,M=(0,u.useMemo)((()=>({...x,...T,...I&&{allowSizingOnChildren:!0}})),[x,T,I]),P=(0,s.createElement)(Dw,{rootClientId:t,renderAppender:v,__experimentalAppenderTagName:b,layout:M,wrapperRef:h,placeholder:_});return 0===Object.keys(w.providesContext).length?P:(0,s.createElement)(Ow,{clientId:t},P)}function Vw(e){return L_(e),(0,s.createElement)(zw,{...e})}const Fw=(0,u.forwardRef)(((e,t)=>{const n=Hw({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",{...n}))}));function Hw(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:l,layout:i=null,__unstableLayoutClassNames:a=""}=y(),u=(0,d.useSelect)((e=>{if(!l)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:r,getTemplateLock:i,getBlockRootClientId:s,getBlockEditingMode:a,getBlockSettings:u,isDragging:d}=ie(e(Nr)),{hasBlockSupport:p,getBlockType:m}=e(c.store),h=t(l),g="navigation"===r(),f=a(l),b=s(l),[v]=u(l,"layout");return{__experimentalCaptureToolbars:p(h,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==h&&!n(l)&&!o(l,!0)&&g&&!d(),name:h,blockType:m(h),parentLock:i(b),parentClientId:b,isDropZoneDisabled:"disabled"===f,defaultLayout:v}}),[l]),{__experimentalCaptureToolbars:m,hasOverlay:h,name:g,blockType:f,parentLock:b,parentClientId:v,isDropZoneDisabled:k,defaultLayout:_}=u,E=Lw({dropZoneElement:r,rootClientId:l,parentClientId:v,isDisabled:k}),w=(0,p.useMergeRefs)([e.ref,o?null:E]),S={__experimentalCaptureToolbars:m,layout:i,name:g,blockType:f,parentLock:b,defaultLayout:_,...t},C=S.value&&S.onChange?Vw:zw;return{...e,ref:w,className:ml()(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":h}),children:l?(0,s.createElement)(C,{...S,clientId:l}):(0,s.createElement)(Jw,{...t})}}Hw.save=c.__unstableGetInnerBlocksProps,Fw.DefaultBlockAppender=ww,Fw.ButtonBlockAppender=Ew,Fw.Content=()=>Hw.save().children;const Gw=Fw,Uw=new Set([zs.UP,zs.RIGHT,zs.DOWN,zs.LEFT,zs.ENTER,zs.BACKSPACE]);function $w(){const e=(0,d.useSelect)((e=>e(Nr).isTyping()),[]),{stopTyping:t}=(0,d.useDispatch)(Nr);return(0,p.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 jw(){const{isTyping:e,hasInlineToolbar:t}=(0,d.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(Nr);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,d.useDispatch)(Nr),r=$w(),l=(0,p.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l,s=i.getSelection();if(e){let c;function u(e){const{target:t}=e;c=i.setTimeout((()=>{(0,As.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==zs.ESCAPE&&t!==zs.TAB||o()}function p(){s.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||l.addEventListener("selectionchange",p),()=>{i.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),l.removeEventListener("selectionchange",p)}}function a(e){const{type:t,target:o}=e;(0,As.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Uw.has(t)}(e))&&n()}return r.addEventListener("keypress",a),r.addEventListener("keydown",a),()=>{r.removeEventListener("keypress",a),r.removeEventListener("keydown",a)}}),[e,t,n,o]);return(0,p.useMergeRefs)([r,l])}const Ww=function({children:e}){return(0,s.createElement)("div",{ref:jw()},e)},Kw=(0,u.createContext)(),Zw=new WeakMap;function qw({className:e,...t}){const n=(0,p.useViewportMatch)("medium"),{isOutlineMode:o,isFocusMode:r,editorMode:l}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(Nr),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),i=(0,d.useRegistry)(),{setBlockVisibility:a}=(0,d.useDispatch)(Nr),c=(0,p.useDebounce)((0,u.useCallback)((()=>{const e={};Zw.get(i).forEach((([t,n])=>{e[t]=n})),a(e)}),[i]),300,{trailing:!0}),m=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{Zw.get(i)||Zw.set(i,[]);for(const t of e){const e=t.target.getAttribute("data-block");Zw.get(i).push([e,t.isIntersecting])}c()}))}),[]),h=Hw({ref:(0,p.useMergeRefs)([F_(),_w(),jw()]),className:ml()("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r&&n,"is-navigate-mode":"navigation"===l})},t);return(0,s.createElement)(Kw.Provider,{value:m},(0,s.createElement)("div",{...h}))}function Yw({clientId:e}){const{stopEditingAsBlocks:t}=ie((0,d.useDispatch)(Nr)),n=(0,d.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(Nr);return n(e)||o(e,!0)}),[e]);return(0,u.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function Xw(e){return(0,s.createElement)(_,{value:v},(0,s.createElement)(qw,{...e}))}function Qw({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=Fi}){const l=!1!==n,i=!!n,{order:a,selectedBlocks:c,visibleBlocks:u,temporarilyEditingAsBlocks:p,shouldRenderAppender:m}=(0,d.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientId:o,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:s,__unstableGetTemporarilyEditingAsBlocks:a,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(Nr),p=o();return{order:n(t),selectedBlocks:r(),visibleBlocks:s(),temporarilyEditingAsBlocks:a(),shouldRenderAppender:l&&(i?!c(t)&&"disabled"!==u(t)&&"zoom-out"!==d():t===p||!t&&!p)}}),[t,l,i]);return(0,s.createElement)(Gi,{value:r},a.map((e=>(0,s.createElement)(d.AsyncModeProvider,{key:e,value:!u.has(e)&&!c.includes(e)},(0,s.createElement)(C_,{rootClientId:t,clientId:e})))),a.length<1&&e,!!p&&(0,s.createElement)(Yw,{clientId:p}),m&&(0,s.createElement)(pw,{tagName:o,rootClientId:t,CustomAppender:n}))}function Jw(e){return(0,s.createElement)(d.AsyncModeProvider,{value:!1},(0,s.createElement)(Qw,{...e}))}const eS={placement:"top-start"},tS={...eS,flip:!1,shift:!0},nS={...eS,flip:!0,shift:!1};function oS(e,t,n,o,r){if(!e||!t)return tS;const l=n?.scrollTop||0,i=t.getBoundingClientRect(),s=l+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=s+o,u=i.top>c,d=i.height>a-o;return r||!u&&!d?nS:tS}function rS({contentElement:e,clientId:t}){const n=bd(t),[o,r]=(0,u.useState)(0),{blockIndex:l,isSticky:i}=(0,d.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(Nr);return{blockIndex:n(t),isSticky:gh(o(t))}}),[t]),s=(0,u.useMemo)((()=>{if(e)return(0,As.getScrollContainer)(e)}),[e]),[a,c]=(0,u.useState)((()=>oS(e,n,s,o,i))),m=(0,p.useRefEffect)((e=>{r(e.offsetHeight)}),[]),h=(0,u.useCallback)((()=>c(oS(e,n,s,o,i))),[e,n,s,o]);return(0,u.useLayoutEffect)(h,[l,h]),(0,u.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",h);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(h),o.observe(n)),()=>{t?.removeEventHandler?.("resize",h),o&&o.disconnect()}}),[h,e,n]),{...a,ref:m}}function lS(e){const t=(0,d.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:l,getBlockInsertionPoint:i,getBlockOrder:s,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(Nr),u=o(e),d=r(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));let m=!1;if(l()){const t=i();m=s(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:m,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function iS({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:l}=lS(e),i=rS({contentElement:t?.current,clientId:e});return(0,s.createElement)(fm,{clientId:n||e,__unstableCoverTarget:!0,bottomClientId:r,className:ml()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,resize:!1,shift:!1,...i},(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(lw,{position:"bottom right",rootClientId:l,clientId:e,__experimentalIsQuick:!0})))}const sS=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:o,elementId:r,onDragStart:l,onDragEnd:i,fadeWhenDisabled:a=!1,dragComponent:m})=>{const{srcRootClientId:h,isDraggable:g,icon:f,visibleInserter:b,getBlockType:v}=(0,d.useSelect)((e=>{const{canMoveBlocks:t,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:l,isBlockInsertionPointVisible:i}=e(Nr),{getBlockType:s,getActiveBlockVariation:a}=e(c.store),u=o(n[0]),d=r(n[0]),p=a(d,l(n[0]));return{srcRootClientId:u,isDraggable:t(n,u),icon:p?.icon||s(d)?.icon,visibleInserter:i(),getBlockType:s}}),[n]),k=(0,u.useRef)(!1),[_,y,E]=function(){const e=(0,u.useRef)(null),t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(null);return(0,u.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,u.useCallback)((r=>{e.current=r.clientY,n.current=(0,As.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,u.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0),o=0===e||0===n?0:n/e;t.current=-25*o}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{getAllowedBlocks:w,getBlockNamesByClientId:S,getBlockRootClientId:C}=(0,d.useSelect)(Nr),{startDraggingBlocks:x,stopDraggingBlocks:B}=(0,d.useDispatch)(Nr);(0,u.useEffect)((()=>()=>{k.current&&B()}),[]);const I=fd(n[0]),T=I.current?.closest("body");if((0,u.useEffect)((()=>{if(!T||!a)return;const e=(0,p.throttle)((e=>{if(!e.target.closest("[data-block]"))return;const t=S(n),o=e.target.closest("[data-block]").getAttribute("data-block"),r=w(o),l=S([o])[0];let i;if(0===r?.length){const e=C(o),n=S([e])[0],r=w(e);i=Nw(v,r,t,n)}else i=Nw(v,r,t,l);i||b?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")}),200);return T.addEventListener("dragover",e),()=>{T.removeEventListener("dragover",e)}}),[n,T,a,w,S,C,v,b]),!g)return t({draggable:!1});const M={type:"block",srcClientIds:n,srcRootClientId:h};return(0,s.createElement)(_l.Draggable,{appendToOwnerDocument:e,cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:M,onDragStart:e=>{window.requestAnimationFrame((()=>{x(n),k.current=!0,_(e),l&&l()}))},onDragOver:y,onDragEnd:()=>{B(),k.current=!1,E(),i&&i()},__experimentalDragComponent:void 0!==m?m:(0,s.createElement)(Ay,{count:n.length,icon:f,fadeWhenDisabled:!0}),elementId:r},(({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})))},aS=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),cS=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),uS=(e,t)=>"up"===e?"horizontal"===t?(0,x.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,x.isRTL)()?"left":"right":"down":null;function dS(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,x.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=uS("down",l);if("down"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=uS("down",l);if("down"===e)return(0,x.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,x.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,x.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=uS("up",l);if("up"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,x.sprintf)((0,x.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=uS("up",l);if("up"===e)return(0,x.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,x.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,x.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,x.sprintf)((0,x.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=uS("down",i);if("down"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=uS("down",i);if("down"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=uS("up",i);if("up"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,x.sprintf)((0,x.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=uS("up",i);if("up"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,x.sprintf)((0,x.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const pS=(e,t)=>"up"===e?"horizontal"===t?(0,x.isRTL)()?T_:M_:aS:"down"===e?"horizontal"===t?(0,x.isRTL)()?M_:T_:cS:null,mS=(e,t)=>"up"===e?"horizontal"===t?(0,x.isRTL)()?(0,x.__)("Move right"):(0,x.__)("Move left"):(0,x.__)("Move up"):"down"===e?"horizontal"===t?(0,x.isRTL)()?(0,x.__)("Move left"):(0,x.__)("Move right"):(0,x.__)("Move down"):null,hS=(0,u.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const l=(0,p.useInstanceId)(hS),i=Array.isArray(e)?e:[e],a=i.length,{blockType:u,isDisabled:m,rootClientId:h,isFirst:g,isLast:f,firstIndex:b,orientation:v="vertical"}=(0,d.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:l,getBlock:s,getBlockListSettings:a}=e(Nr),u=i[0],d=r(u),p=o(u),m=o(i[i.length-1]),h=l(d),g=s(u),f=0===p,b=m===h.length-1,{orientation:v}=a(d)||{};return{blockType:g?(0,c.getBlockType)(g.name):null,isDisabled:"up"===t?f:b,rootClientId:d,firstIndex:p,isFirst:f,isLast:b,orientation:n||v}}),[e,t]),{moveBlocksDown:k,moveBlocksUp:_}=(0,d.useDispatch)(Nr),y="up"===t?_:k,E=`block-editor-block-mover-button__description-${l}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.Button,{ref:r,className:ml()("block-editor-block-mover-button",`is-${t}-button`),icon:pS(t,v),label:mS(t,v),"aria-describedby":E,...o,onClick:m?null:t=>{y(e,h),o.onClick&&o.onClick(t)},disabled:m,__experimentalIsFocusable:!0}),(0,s.createElement)(_l.VisuallyHidden,{id:E},dS(a,u&&u.title,b,g,f,"up"===t?-1:1,v)))})),gS=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(hS,{direction:"up",ref:t,...e}))),fS=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(hS,{direction:"down",ref:t,...e})));const bS=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:o,isFirst:r,isLast:l,orientation:i}=(0,d.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:l,getBlockRootClientId:i}=t(Nr),s=Array.isArray(e)?e:[e],a=s[0],c=i(a),u=n(a),d=n(s[s.length-1]),p=l(c);return{canMove:r(e,c),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:o(c)?.orientation}}),[e]);if(!n||r&&l&&!o)return null;const a=(0,x.__)("Drag");return(0,s.createElement)(_l.ToolbarGroup,{className:ml()("block-editor-block-mover",{"is-horizontal":"horizontal"===i})},!t&&(0,s.createElement)(sS,{clientIds:e,fadeWhenDisabled:!0},(e=>(0,s.createElement)(_l.Button,{icon:Ly,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:a,tabIndex:"-1",...e}))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(_l.ToolbarItem,null,(t=>(0,s.createElement)(gS,{clientIds:e,...t}))),(0,s.createElement)(_l.ToolbarItem,null,(t=>(0,s.createElement)(fS,{clientIds:e,...t})))))},{clearTimeout:vS,setTimeout:kS}=window,_S=200;function yS({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=_S}){const{getSelectedBlockClientId:r,getBlockRootClientId:l}=(0,d.useSelect)(Nr),{toggleBlockHighlight:i}=(0,d.useDispatch)(Nr),s=(0,u.useRef)(),a=(0,d.useSelect)((e=>e(Nr).getSettings().isDistractionFree),[]),c=e=>{if(e&&a)return;const t=r(),o=n?l(t):t;i(o,e)},p=()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n},m=()=>{const e=s.current;e&&vS&&vS(e)};return(0,u.useEffect)((()=>()=>{c(!1),m()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),m(),c(!0)},debouncedHideGestures:e=>{e&&e.stopPropagation(),m(),s.current=kS((()=>{p()&&c(!1)}),o)}}}function ES({ref:e,highlightParent:t=!1,debounceTimeout:n=_S}){const[o,r]=(0,u.useState)(!1),{debouncedShowGestures:l,debouncedHideGestures:i}=yS({ref:e,debounceTimeout:n,isFocused:o,highlightParent:t}),s=(0,u.useRef)(!1),a=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,u.useEffect)((()=>{const t=e.current,n=()=>{a()&&(r(!0),l())},o=()=>{a()||(r(!1),i())};return t&&!s.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",o,!0),s.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",o))}}),[e,s,r,l,i]),{onMouseMove:l,onMouseLeave:i}}function wS(){const{selectBlock:e}=(0,d.useDispatch)(Nr),{firstParentClientId:t,isVisible:n}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getBlockEditingMode:r}=e(Nr),{hasBlockSupport:l}=e(c.store),i=n(o()),s=i[i.length-1],a=t(s),u=(0,c.getBlockType)(a);return{firstParentClientId:s,isVisible:s&&"default"===r(s)&&l(u,"__experimentalParentSelector",!0)}}),[]),o=ih(t),r=(0,u.useRef)(),l=ES({ref:r,highlightParent:!0});return n?(0,s.createElement)("div",{className:"block-editor-block-parent-selector",key:t,ref:r,...l},(0,s.createElement)(_l.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,x.sprintf)((0,x.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,s.createElement)(qh,{icon:o?.icon})})):null}const SS=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"}));function CS({blocks:e}){return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(_l.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,x.__)("Preview")),(0,s.createElement)(Ty,{viewportWidth:500,blocks:e})))))}const xS={};function BS({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l}=e;return(0,s.createElement)(_l.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,s.createElement)(qh,{icon:r,showColors:!0}),l)}const IS=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,u.useState)();return(0,s.createElement)(s.Fragment,null,o&&(0,s.createElement)(CS,{blocks:(0,c.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,s.createElement)(BS,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:r}))))};function TS({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,s.createElement)(MS,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:n})))}function MS({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l,isDisabled:i}=e;return(0,s.createElement)(_l.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,s.createElement)(qh,{icon:r,showColors:!0}),l)}const PS=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:l})=>{const[i,a]=(0,u.useState)(),{priorityTextTransformations:d,restTransformations:p}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,u.useMemo)((()=>{const n=Object.keys(t),o=e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]});if(1===o.priorityTextTransformations.length&&"core/quote"===o.priorityTextTransformations[0].name){const e=o.priorityTextTransformations.pop();o.restTransformations.push(e)}return o}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),m=d.length&&p.length,h=!!p.length&&(0,s.createElement)(TS,{restTransformations:p,onSelect:o,setHoveredTransformItemName:a});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Transform to"),className:e},i&&(0,s.createElement)(CS,{blocks:(0,c.switchToBlockType)(l,i)}),!!n?.length&&(0,s.createElement)(IS,{transformations:n,blocks:l,onSelect:r}),d.map((e=>(0,s.createElement)(MS,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!m&&h),!!m&&(0,s.createElement)(_l.MenuGroup,{className:e},h))};function RS(e,t,n){const o=new(vp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function NS(e){return e?.find((e=>e.isDefault))}function LS({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:l}=(0,d.useSelect)((t=>{const{getBlock:n}=t(Nr),o=n(e);if(!o)return{};const r=(0,c.getBlockType)(o.name),{getBlockStyles:l}=t(c.store);return{block:o,blockType:r,styles:l(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:i}=(0,d.useDispatch)(Nr),s=function(e){return e&&0!==e.length?NS(e)?e:[{name:"default",label:(0,x._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(vp())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=e?.find((({name:e})=>e===t));if(o)return o}return NS(e)}(s,l),p=function(e,t){return(0,u.useMemo)((()=>{const n=t?.example,o=t?.name;return n&&o?(0,c.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,c.cloneBlock)(e):void 0}),[t?.example?e?.name:e,t])}(o,r);return{onSelect:n=>{const o=RS(l,a,n);i(e,{className:o}),t()},stylesToRender:s,activeStyle:a,genericPreviewBlock:p,className:l}}const AS=()=>{};function OS({clientId:e,onSwitch:t=AS}){const{onSelect:n,stylesToRender:o,activeStyle:r}=LS({clientId:e,onSwitch:t});return o&&0!==o.length?(0,s.createElement)(s.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,s.createElement)(_l.MenuItem,{key:e.name,icon:r.name===e.name?uu:null,onClick:()=>n(e)},(0,s.createElement)(_l.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function DS({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,s.createElement)(_l.MenuGroup,{label:(0,x.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(OS,{clientId:n,onSwitch:t}))}const zS=(e,t,n=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=zS(e,t,n);if(o)return o}}},VS=(e,t)=>{const n=((e,t)=>{const n=(0,c.__experimentalGetBlockAttributesNamesByRole)(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}},FS=(e,t)=>(0,u.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,c.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=zS(r,t.name,o);if(n){e=!0,o.add(n.clientId),VS(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]),{CompositeV2:HS,CompositeItemV2:GS,useCompositeStoreV2:US}=ie(_l.privateApis);function $S({patterns:e,onSelect:t}){return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(_l.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview"},(0,s.createElement)(jS,{patterns:e,onSelect:t})))))}function jS({patterns:e,onSelect:t}){const n=US();return(0,s.createElement)(HS,{store:n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,x.__)("Patterns list")},e.map((e=>(0,s.createElement)(WS,{key:e.name,pattern:e,onSelect:t}))))}function WS({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,p.useInstanceId)(WS,`${n}-list__item-description`);return(0,s.createElement)("div",{className:`${n}-list__list-item`},(0,s.createElement)(GS,{render:(0,s.createElement)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?o:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks)},(0,s.createElement)(Ty,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,s.createElement)("div",{className:`${n}-list__item-title`},e.title)),!!e.description&&(0,s.createElement)(_l.VisuallyHidden,{id:o},e.description))}const KS=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,u.useState)(!1),l=FS(t,e);return l.length?(0,s.createElement)(_l.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,s.createElement)($S,{patterns:l,onSelect:n}),(0,s.createElement)(_l.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:T_},(0,x.__)("Patterns"))):null};function ZS({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:o}){const{replaceBlocks:r,multiSelect:l,updateBlockAttributes:i}=(0,d.useDispatch)(Nr),{possibleBlockTransformations:a,patterns:p,blocks:m}=(0,d.useSelect)((e=>{const{getBlocksByClientId:n,getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:l}=e(Nr),i=o(Array.isArray(t)?t[0]:t),s=n(t);return{blocks:s,possibleBlockTransformations:r(s,i),patterns:l(s,i)}}),[t]),h=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,d.useSelect)((n=>{const{getBlockRootClientId:o,getBlockAttributes:r,canRemoveBlocks:l}=n(Nr),{getActiveBlockVariation:i,getBlockVariations:s}=n(c.store),a=o(Array.isArray(e)?e[0]:e),u=l(e,a);if(1!==t.length||!u)return xS;const[d]=t;return{blockVariationTransformations:s(d.name,"transform"),activeBlockVariation:i(d.name,r(d.clientId))}}),[e,t]);return(0,u.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:t,blocks:m});function g(e){e.length>1&&l(e[0].clientId,e[e.length-1].clientId)}const f=1===m.length&&(0,c.isTemplatePart)(m[0]),b=!!a.length&&o&&!f,v=!!h?.length,k=!!p?.length&&o,_=b||v;return n||_||k?(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,s.createElement)(KS,{blocks:m,patterns:p,onSelect:n=>{!function(e){r(t,e),g(e)}(n),e()}}),_&&(0,s.createElement)(PS,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:a,possibleBlockVariationTransformations:h,blocks:m,onSelect:n=>{!function(e){const n=(0,c.switchToBlockType)(m,e);r(t,n),g(n)}(n),e()},onSelectVariation:t=>{!function(e){i(m[0].clientId,{...h.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,s.createElement)(DS,{hoveredBlock:m[0],onSwitch:e})):(0,s.createElement)("p",{className:"block-editor-block-switcher__no-transforms"},(0,x.__)("No transforms."))}const qS=({clientIds:e})=>{const{canRemove:t,hasBlockStyles:n,icon:o,invalidBlocks:r,isReusable:l,isTemplate:i}=(0,d.useSelect)((t=>{const{getBlockRootClientId:n,getBlocksByClientId:o,getBlockAttributes:r,canRemoveBlocks:l}=t(Nr),{getBlockStyles:i,getBlockType:s,getActiveBlockVariation:a}=t(c.store),u=o(e);if(!u.length||u.some((e=>!e)))return{invalidBlocks:!0};const d=n(Array.isArray(e)?e[0]:e),[{name:p}]=u,m=1===u.length,h=s(p);let g;if(m){const t=a(p,r(e[0]));g=t?.icon||h.icon}else{g=1===new Set(u.map((({name:e})=>e))).size?h.icon:SS}return{canRemove:l(e,d),hasBlockStyles:m&&!!i(p)?.length,icon:g,isReusable:m&&(0,c.isReusableBlock)(u[0]),isTemplate:m&&(0,c.isTemplatePart)(u[0])}}),[e]),a=df({clientId:e?.[0],maximumLength:35});if(r)return null;const u=1===e.length,p=u?a:(0,x.__)("Multiple blocks selected");if(!n&&!t)return(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:p,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qh,{icon:o,showColors:!0}),(l||i)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},a))}));const m=u?(0,x.__)("Change block type or style"):(0,x.sprintf)((0,x._n)("Change type of %d block","Change type of %d blocks",e.length),e.length);return(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarItem,null,(r=>(0,s.createElement)(_l.DropdownMenu,{className:"block-editor-block-switcher",label:p,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qh,{icon:o,className:"block-editor-block-switcher__toggle",showColors:!0}),(l||i)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},a)),toggleProps:{describedBy:m,...r},menuProps:{orientation:"both"}},(({onClose:o})=>(0,s.createElement)(ZS,{onClose:o,clientIds:e,hasBlockStyles:n,canRemove:t}))))))},{Fill:YS,Slot:XS}=(0,_l.createSlotFill)("__unstableBlockToolbarLastItem");YS.Slot=XS;const QS=YS,JS="align",eC="__experimentalBorder",tC="color",nC="customClassName",oC="typography.__experimentalFontFamily",rC="typography.fontSize",lC="layout",iC=["shadow",...["typography.lineHeight",rC,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",oC,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing"],eC,tC,"spacing"];const sC={align:e=>(0,c.hasBlockSupport)(e,JS),borderColor:e=>function(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,eC);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=(0,c.getBlockSupport)(e,tC);return t&&!1!==t.background},textColor:e=>{const t=(0,c.getBlockSupport)(e,tC);return t&&!1!==t.text},gradient:e=>{const t=(0,c.getBlockSupport)(e,tC);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,c.hasBlockSupport)(e,nC,!0),fontFamily:e=>(0,c.hasBlockSupport)(e,oC),fontSize:e=>(0,c.hasBlockSupport)(e,rC),layout:e=>(0,c.hasBlockSupport)(e,lC),style:e=>iC.some((t=>(0,c.hasBlockSupport)(e,t)))};function aC(e,t){return Object.entries(sC).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function cC(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,aC(t[o],e[o])),cC(e[o].innerBlocks,t[o].innerBlocks,n)}function uC(){const e=(0,d.useRegistry)(),{updateBlockAttributes:t}=(0,d.useDispatch)(Nr),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,d.useDispatch)(Os.store);return(0,u.useCallback)((async l=>{let i="";try{if(!window.navigator.clipboard)return void r((0,x.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});i=await window.navigator.clipboard.readText()}catch(e){return void r((0,x.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!i||!function(e){try{const t=(0,c.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(i))return void o((0,x.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,c.parse)(i);if(1===s.length?e.batch((()=>{cC(l,l.map((()=>s[0])),t)})):e.batch((()=>{cC(l,s,t)})),1===l.length){const e=(0,c.getBlockType)(l[0].name)?.title;n((0,x.sprintf)((0,x.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,x.sprintf)((0,x.__)("Pasted styles to %d blocks."),l.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}function dC({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:o,getGroupingBlockName:r}=(0,d.useSelect)(c.store),l=(0,d.useSelect)((t=>{const{canInsertBlockType:n,getBlockRootClientId:r,getBlocksByClientId:l,getDirectInsertBlock:i,canMoveBlocks:s,canRemoveBlocks:a}=t(Nr),u=l(e),d=r(e[0]),p=n(o(),d),m=d?i(d):null;return{canMove:s(e,d),canRemove:a(e,d),canInsertBlock:p||!!m,canCopyStyles:u.every((e=>!!e&&((0,c.hasBlockSupport)(e.name,"color")||(0,c.hasBlockSupport)(e.name,"typography")))),canDuplicate:u.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&n(e.name,d)))}}),[e,o]),{getBlocksByClientId:i,getBlocks:s}=(0,d.useSelect)(Nr),{canMove:a,canRemove:u,canInsertBlock:p,canCopyStyles:m,canDuplicate:h}=l,{removeBlocks:g,replaceBlocks:f,duplicateBlocks:b,insertAfterBlock:v,insertBeforeBlock:k,flashBlock:_,setBlockMovingClientId:y,setNavigationMode:E,selectBlock:w}=(0,d.useDispatch)(Nr),S=ey(),C=uC();return t({canCopyStyles:m,canDuplicate:h,canInsertBlock:p,canMove:a,canRemove:u,onDuplicate:()=>b(e,n),onRemove:()=>g(e,n),onInsertBefore(){const t=Array.isArray(e)?e[0]:t;k(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;v(t)},onMoveTo(){E(!0),w(e[0]),y(e[0])},onGroup(){if(!e.length)return;const t=r(),n=(0,c.switchToBlockType)(i(e),t);n&&f(e,n)},onUngroup(){if(!e.length)return;const t=s(e[0]);t.length&&f(e,t)},onCopy(){1===e.length&&_(e[0]),S("copy",e)},async onPasteStyles(){await C(i(e))}})}const pC=function({clientId:e}){const t=(0,d.useSelect)((t=>t(Nr).getBlock(e)),[e]),{replaceBlocks:n}=(0,d.useDispatch)(Nr);return t&&"core/html"===t.name?(0,s.createElement)(_l.MenuItem,{onClick:()=>n(e,(0,c.rawHandler)({HTML:(0,c.getBlockContent)(t)}))},(0,x.__)("Convert to Blocks")):null},{Fill:mC,Slot:hC}=(0,_l.createSlotFill)("__unstableBlockSettingsMenuFirstItem");mC.Slot=hC;const gC=mC,fC={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function bC({clientIds:e,onCopy:t,label:n}){const{getBlocksByClientId:o}=(0,d.useSelect)(Nr),r=(0,p.useCopyToClipboard)((()=>(0,c.serialize)(o(e))),t),l=n||(0,x.__)("Copy");return(0,s.createElement)(_l.MenuItem,{ref:r},l)}function vC({parentClientId:e,parentBlockType:t}){const n=(0,p.useViewportMatch)("medium","<"),{selectBlock:o}=(0,d.useDispatch)(Nr),r=(0,u.useRef)(),l=ES({ref:r,highlightParent:!0});return n?(0,s.createElement)(_l.MenuItem,{...l,ref:r,icon:(0,s.createElement)(qh,{icon:t.icon}),onClick:()=>o(e)},(0,x.sprintf)((0,x.__)("Select parent block (%s)"),t.title)):null}function kC({block:e,clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...l}){const i=e?.clientId,a=Array.isArray(t)?t:[t],m=a.length,h=a[0],{firstParentClientId:g,onlyBlock:f,parentBlockType:b,previousBlockClientId:v,selectedBlockClientIds:k}=(0,d.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:l,getBlockAttributes:i}=e(Nr),{getActiveBlockVariation:s}=e(c.store),a=o(h),u=a&&n(a);return{firstParentClientId:a,onlyBlock:1===t(a),parentBlockType:a&&(s(u,i(a))||(0,c.getBlockType)(u)),previousBlockClientId:r(h),selectedBlockClientIds:l()}}),[h]),{getBlockOrder:_,getSelectedBlockClientIds:y}=(0,d.useSelect)(Nr),E=(0,d.useSelect)((e=>ie(e(Nr)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:w}=ie((0,d.useDispatch)(Nr)),S=(0,d.useSelect)((e=>{const{getShortcutRepresentation:t}=e(A_.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")}}),[]),C=(0,A_.__unstableUseShortcutEventMatch)(),B=k.length>0,I=(0,u.useCallback)((async e=>{if(n){const t=await e;t&&t[0]&&n(t[0],!1)}}),[n]),T=(0,u.useCallback)((()=>{if(n){let e=v||g;e||(e=_()[0]);const t=B&&0===y().length;n(e,t)}}),[n,v,g,_,B,y]),M=k?.includes(g),P=i?E===i||!1:void 0,R=(0,u.useCallback)((e=>{e&&E!==i?w(i):!e&&E&&E===i&&w(void 0)}),[i,E,w]);return(0,s.createElement)(dC,{clientIds:t,__experimentalUpdateSelection:!n},(({canCopyStyles:e,canDuplicate:n,canInsertBlock:i,canMove:a,canRemove:c,onDuplicate:d,onInsertAfter:v,onInsertBefore:k,onRemove:_,onCopy:y,onPasteStyles:E,onMoveTo:B})=>(0,s.createElement)(_l.DropdownMenu,{icon:Ef,label:(0,x.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:fC,open:P,onToggle:R,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(C("core/block-editor/remove",e)&&c?(e.preventDefault(),T(_())):C("core/block-editor/duplicate",e)&&n?(e.preventDefault(),I(d())):C("core/block-editor/insert-after",e)&&i?(e.preventDefault(),w(void 0),v()):C("core/block-editor/insert-before",e)&&i&&(e.preventDefault(),w(void 0),k()))}},...l},(({onClose:l})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(gC.Slot,{fillProps:{onClose:l}}),!M&&!!g&&(0,s.createElement)(vC,{parentClientId:g,parentBlockType:b}),1===m&&(0,s.createElement)(pC,{clientId:h}),(0,s.createElement)(bC,{clientIds:t,onCopy:y}),n&&(0,s.createElement)(_l.MenuItem,{onClick:(0,p.pipe)(l,d,I),shortcut:S.duplicate},(0,x.__)("Duplicate")),i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.MenuItem,{onClick:(0,p.pipe)(l,k),shortcut:S.insertBefore},(0,x.__)("Add before")),(0,s.createElement)(_l.MenuItem,{onClick:(0,p.pipe)(l,v),shortcut:S.insertAfter},(0,x.__)("Add after")))),e&&(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(bC,{clientIds:t,onCopy:y,label:(0,x.__)("Copy styles")}),(0,s.createElement)(_l.MenuItem,{onClick:E},(0,x.__)("Paste styles"))),(0,s.createElement)(jh.Slot,{fillProps:{onClose:l,canMove:a,onMoveTo:B,onlyBlock:f,count:m,firstBlockClientId:h},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:l}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:l}))),c&&(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(_l.MenuItem,{onClick:(0,p.pipe)(l,_,T),shortcut:S.remove},(0,x.__)("Delete"))))))))}const _C=kC;const yC=function({clientIds:e,...t}){return(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarItem,null,(n=>(0,s.createElement)(_C,{clientIds:e,toggleProps:n,...t}))))};function EC({clientId:e}){const{canLock:t,isLocked:n}=Th(e),[o,r]=(0,u.useReducer)((e=>!e),!1),l=(0,u.useRef)(!1);if((0,u.useEffect)((()=>{n&&(l.current=!0)}),[n]),!n&&!l.current)return null;let i=n?(0,x.__)("Unlock"):(0,x.__)("Lock");return!t&&n&&(i=(0,x.__)("Locked")),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(_l.ToolbarButton,{accessibleWhenDisabled:!0,disabled:!t,icon:n?Rh:Mh,label:i,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})),o&&(0,s.createElement)(Ah,{clientId:e,onClose:r}))}const wC=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.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"})),SC=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})),CC=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})),xC={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};const BC=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Bh(),{replaceBlocks:r}=(0,d.useDispatch)(Nr),{canRemove:l,variations:i}=(0,d.useSelect)((e=>{const{canRemoveBlocks:o}=e(Nr),{getBlockVariations:r}=e(c.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),a=o=>{const l=(0,c.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=xC[o],r(t,l))};if(!o||!l)return null;const u=!!i.find((({name:e})=>"group-row"===e)),p=!!i.find((({name:e})=>"group-stack"===e));return(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarButton,{icon:wC,label:(0,x._x)("Group","verb"),onClick:a}),u&&(0,s.createElement)(_l.ToolbarButton,{icon:SC,label:(0,x._x)("Row","single horizontal line"),onClick:()=>a("row")}),p&&(0,s.createElement)(_l.ToolbarButton,{icon:CC,label:(0,x._x)("Stack","verb"),onClick:()=>a("stack")}))};function IC({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,d.useSelect)((e=>!!t&&"html"===e(Nr).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,d.useDispatch)(Nr);return n?(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarButton,{onClick:()=>{o(t)}},(0,x.__)("Edit visually"))):null}const TC=(0,u.createContext)("");function MC(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function PC(e){return e.contains(e.ownerDocument.activeElement)}function RC({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:l,focusEditorOnEscape:i}){const[s]=(0,u.useState)(t),[a]=(0,u.useState)(o),c=(0,u.useCallback)((()=>{!function(e){const[t]=As.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,A_.useShortcut)("core/block-editor/focus-toolbar",(()=>{l&&c()})),(0,u.useEffect)((()=>{s&&c()}),[n,s,c]),(0,u.useEffect)((()=>{const t=e.current;let n=0;return s||PC(t)||(n=window.requestAnimationFrame((()=>{const e=MC(t),n=a||0;e[n]&&PC(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=MC(t).findIndex((e=>0===e.tabIndex));r(e)}}),[a,s,r,e]);const{getLastFocus:p}=ie((0,d.useSelect)(Nr));(0,u.useEffect)((()=>{const t=e.current;if(i){const e=e=>{const t=p();e.keyCode===zs.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[i,p,e])}function NC({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:l,...i}){const a=(0,u.useRef)(),c=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!As.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||w()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[e]);return(0,u.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[o,t,e]),t}(a);return RC({toolbarRef:a,focusOnMount:t,defaultIndex:r,onIndexChange:l,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,s.createElement)(_l.Toolbar,{label:i["aria-label"],ref:a,...i},e):(0,s.createElement)(_l.NavigableMenu,{orientation:"horizontal",role:"toolbar",ref:a,...i},e)}function LC(e="default"){const t=yl[e]?.Slot,n=(0,_l.__experimentalUseSlotFills)(t?.__unstableName);return t?!!n?.length:null}const AC=(0,s.createElement)(Z.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd"},(0,s.createElement)(Z.Path,{d:"M5 19L8 16L5 19Z"}),(0,s.createElement)(Z.Path,{d:"M16 8L19 5L16 8Z"}),(0,s.createElement)(Z.G,null,(0,s.createElement)(Z.Path,{d:"M5 19L8 16"}),(0,s.createElement)(Z.Path,{d:"M9.30003 17.3C9.523 17.5237 9.78794 17.7013 10.0797 17.8224C10.3714 17.9435 10.6842 18.0059 11 18.0059C11.3159 18.0059 11.6287 17.9435 11.9204 17.8224C12.2121 17.7013 12.4771 17.5237 12.7 17.3L15 15L9.00003 9L6.70003 11.3C6.47629 11.523 6.29876 11.7879 6.17763 12.0796C6.05649 12.3714 5.99414 12.6841 5.99414 13C5.99414 13.3159 6.05649 13.6286 6.17763 13.9204C6.29876 14.2121 6.47629 14.477 6.70003 14.7L9.30003 17.3Z"}),(0,s.createElement)(Z.Path,{d:"M16 8L19 5"}),(0,s.createElement)(Z.Path,{d:"M9 9.00003L15 15L17.3 12.7C17.5237 12.4771 17.7013 12.2121 17.8224 11.9204C17.9435 11.6287 18.0059 11.3159 18.0059 11C18.0059 10.6842 17.9435 10.3714 17.8224 10.0797C17.7013 9.78794 17.5237 9.523 17.3 9.30003L14.7 6.70003C14.477 6.47629 14.2121 6.29876 13.9204 6.17763C13.6286 6.05649 13.3159 5.99414 13 5.99414C12.6841 5.99414 12.3714 6.05649 12.0796 6.17763C11.7879 6.29876 11.523 6.47629 11.3 6.70003L9 9.00003Z"})));function OC(){return(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarItem,{as:"div","aria-label":(0,x._x)("Connected","block toolbar button label"),className:"block-editor-block-bindings-toolbar-indicator"},(0,s.createElement)(_l.Icon,{icon:AC,size:24})))}function DC({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:l,blockClientIds:i,isDefaultEditingMode:a,blockType:m,blockName:h,shouldShowVisualToolbar:g,showParentSelector:f,isUsingBindings:b}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:l,getBlockRootClientId:i,getBlockEditingMode:s,getBlockAttributes:a}=e(Nr),u=r(),d=u[0],p=i(d),m=o(d),h=m[m.length-1],g=t(h),f=(0,c.getBlockType)(g),b="default"===s(d),v=t(d),k=u.every((e=>l(e))),_=u.every((e=>"visual"===n(e))),y=!!a(d)?.metadata?.bindings;return{blockClientId:d,blockClientIds:u,isDefaultEditingMode:b,blockName:v,blockType:d&&(0,c.getBlockType)(v),shouldShowVisualToolbar:k&&_,rootClientId:p,showParentSelector:f&&"default"===s(h)&&(0,c.hasBlockSupport)(f,"__experimentalParentSelector",!0)&&1===u.length&&b,isUsingBindings:y}}),[]),v=(0,u.useRef)(null),k=(0,u.useRef)(),_=ES({ref:k}),y=!(0,p.useViewportMatch)("medium","<"),E=m&&(0,c.hasBlockSupport)(m,"__experimentalToolbar",!0),w=function(){let e=!1;for(const t in yl)LC(t)&&(e=!0);return e}();if(!E||!a&&!w)return null;const S=i.length>1,C=(0,c.isReusableBlock)(m)||(0,c.isTemplatePart)(m),B=ml()("block-editor-block-contextual-toolbar",{"has-parent":f}),I=ml()("block-editor-block-toolbar",{"is-synced":C});return(0,s.createElement)(NC,{focusEditorOnEscape:!0,className:B,"aria-label":(0,x.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,key:l},(0,s.createElement)("div",{ref:v,className:I},!S&&y&&a&&(0,s.createElement)(wS,null),b&&eg(h)&&(0,s.createElement)(OC,null),(g||S)&&a&&(0,s.createElement)("div",{ref:k,..._},(0,s.createElement)(_l.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(qS,{clientIds:i}),!S&&(0,s.createElement)(EC,{clientId:l}),(0,s.createElement)(bS,{clientIds:i,hideDragHandle:e}))),g&&S&&(0,s.createElement)(BC,null),g&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bl.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Bl.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Bl.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Bl.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Bl.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(TC.Provider,{value:m?.name},(0,s.createElement)(QS.Slot,null))),(0,s.createElement)(IC,{clientIds:i}),a&&(0,s.createElement)(yC,{clientIds:i})))}function zC({hideDragHandle:e,variant:t}){return(0,s.createElement)(DC,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function VC({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:l}=lS(e),i=(0,u.useRef)();(0,u.useEffect)((()=>{i.current=void 0}),[e]);const{stopTyping:a}=(0,d.useDispatch)(Nr),c=(0,u.useRef)(!1);(0,A_.useShortcut)("core/block-editor/focus-toolbar",(()=>{c.current=!0,a(!0)})),(0,u.useEffect)((()=>{c.current=!1}));const p=rS({contentElement:n?.current,clientId:e});return!t&&(0,s.createElement)(fm,{clientId:o||e,bottomClientId:l,className:ml()("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...p},(0,s.createElement)(DC,{focusOnMount:c.current,__experimentalInitialIndex:i.current,__experimentalOnIndexChange:e=>{i.current=e},variant:"toolbar"}))}const FC=function({clientId:e,rootClientId:t}){const n=(0,d.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:l,getBlockListSettings:i,__unstableGetEditorMode:s}=n(Nr),{getActiveBlockVariation:a,getBlockType:u}=n(c.store),d=r(e),{name:p,attributes:m}=o(e),h=u(p),g=i(t)?.orientation,f=a(p,m);return{blockMovingMode:l(),editorMode:s(),icon:f?.icon||h.icon,label:(0,c.__experimentalGetAccessibleBlockLabel)(h,m,d+1,g)}}),[e,t]),{label:o,icon:r,blockMovingMode:l,editorMode:i}=n,{setNavigationMode:a,removeBlock:p}=(0,d.useDispatch)(Nr),m=(0,u.useRef)();(0,u.useEffect)((()=>{m.current.focus(),(0,vo.speak)(o)}),[o]);const h=bd(e),{hasBlockMovingClientId:g,getBlockIndex:f,getBlockRootClientId:b,getClientIdsOfDescendants:v,getSelectedBlockClientId:k,getMultiSelectedBlocksEndClientId:_,getPreviousBlockClientId:y,getNextBlockClientId:E}=(0,d.useSelect)(Nr),{selectBlock:w,clearSelectedBlock:S,setBlockMovingClientId:C,moveBlockToPosition:B}=(0,d.useDispatch)(Nr),I=ml()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!l}),T=(0,x.__)("Drag");return(0,s.createElement)("div",{className:I},(0,s.createElement)(_l.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(qh,{icon:r,showColors:!0})),(0,s.createElement)(_l.FlexItem,null,"zoom-out"===i&&(0,s.createElement)(bS,{clientIds:[e],hideDragHandle:!0}),"navigation"===i&&(0,s.createElement)(sS,{clientIds:[e]},(e=>(0,s.createElement)(_l.Button,{icon:Ly,className:"block-selection-button_drag-handle","aria-hidden":"true",label:T,tabIndex:"-1",...e})))),(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(_l.Button,{ref:m,onClick:"navigation"===i?()=>a(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===zs.UP,r=n===zs.DOWN,l=n===zs.LEFT,s=n===zs.RIGHT,c=n===zs.TAB,u=n===zs.ESCAPE,d=n===zs.ENTER,m=n===zs.SPACE,x=t.shiftKey;if(u&&"navigation"===i)return a(!1),void t.preventDefault();if(n===zs.BACKSPACE||n===zs.DELETE)return p(e),void t.preventDefault();const I=k(),T=_(),M=y(T||I),P=E(T||I),R=c&&x||o,N=c&&!x||r,L=l,A=s;let O;if(R)O=M;else if(N)O=P;else if(L){var D;O=null!==(D=b(I))&&void 0!==D?D:I}else if(A){var z;O=null!==(z=v(I)[0])&&void 0!==z?z:I}const V=g();if(u&&V&&!t.defaultPrevented&&(C(null),t.preventDefault()),(d||m)&&V){const e=b(V),t=b(I),n=f(V);let o=f(I);n<o&&e===t&&(o-=1),B(V,e,t,o),w(V),C(null)}if((!V||I!==V||!A)&&(N||R||L||A))if(O)t.preventDefault(),w(O);else if(c&&I){let e;if(N){e=h;do{e=As.focus.tabbable.findNext(e)}while(e&&h.contains(e));e||(e=h.ownerDocument.defaultView.frameElement,e=As.focus.tabbable.findNext(e))}else e=As.focus.tabbable.findPrevious(h);e&&(t.preventDefault(),e.focus(),S())}},label:o,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(pf,{clientId:e,maximumLength:35})))))};function HC({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:l}=lS(e),i=rS({contentElement:t?.current,clientId:e});return(0,s.createElement)(fm,{clientId:n||e,bottomClientId:r,className:ml()("block-editor-block-list__block-popover",{"is-insertion-point-visible":o}),resize:!1,...i},(0,s.createElement)(FC,{clientId:e,rootClientId:l}))}const GC=function({__unstableContentRef:e}){const[t,n]=(0,u.useState)(!1),o=(0,d.useSelect)((e=>e(Nr).getBlockOrder()),[]);return(0,u.useEffect)((()=>{const e=setTimeout((()=>{n(!0)}),500);return()=>{clearTimeout(e)}}),[]),t?o.map(((t,n)=>n===o.length-1?null:(0,s.createElement)(hw,{key:t,previousClientId:t,nextClientId:o[n+1],__unstableContentRef:e},(0,s.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,s.createElement)(lw,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function UC(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getSettings:r,hasMultiSelection:l,__unstableGetEditorMode:i,isTyping:s}=e(Nr),a=t()||n(),{name:u="",attributes:d={}}=o(a)||{},p=i(),m=a&&u,h=(0,c.isUnmodifiedDefaultBlock)({name:u,attributes:d}),g=a&&!s()&&"edit"===p&&(0,c.isUnmodifiedDefaultBlock)({name:u,attributes:d}),f=m&&!l()&&("navigation"===p||"zoom-out"===p);return{clientId:a,hasFixedToolbar:r().hasFixedToolbar,isTyping:s(),isZoomOutMode:"zoom-out"===p,showEmptyBlockSideInserter:g,showBreadcrumb:!g&&f,showBlockToolbar:!r().hasFixedToolbar&&!g&&m&&!h&&!f}}function $C({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:l,isZoomOutMode:i,showEmptyBlockSideInserter:a,showBreadcrumb:c,showBlockToolbar:p}=(0,d.useSelect)(UC,[]),m=(0,A_.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:h,getBlockRootClientId:g}=(0,d.useSelect)(Nr),{duplicateBlocks:f,removeBlocks:b,insertAfterBlock:v,insertBeforeBlock:k,selectBlock:_,moveBlocksUp:y,moveBlocksDown:E}=(0,d.useDispatch)(Nr);const w=hm(t),S=hm(t);return(0,s.createElement)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(m("core/block-editor/move-up",e)){const t=h();if(t.length){e.preventDefault();const n=g(t[0]);y(t,n)}}else if(m("core/block-editor/move-down",e)){const t=h();if(t.length){e.preventDefault();const n=g(t[0]);E(t,n)}}else if(m("core/block-editor/duplicate",e)){const t=h();t.length&&(e.preventDefault(),f(t))}else if(m("core/block-editor/remove",e)){const t=h();t.length&&(e.preventDefault(),b(t))}else if(m("core/block-editor/insert-after",e)){const t=h();t.length&&(e.preventDefault(),v(t[t.length-1]))}else if(m("core/block-editor/insert-before",e)){const t=h();t.length&&(e.preventDefault(),k(t[0]))}else if(m("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=h();t.length>1&&(e.preventDefault(),_(t[0]))}}},(0,s.createElement)(bw.Provider,{value:(0,u.useRef)(!1)},!l&&(0,s.createElement)(kw,{__unstableContentRef:t}),a&&(0,s.createElement)(iS,{__unstableContentRef:t,clientId:o}),p&&(0,s.createElement)(VC,{__unstableContentRef:t,clientId:o,isTyping:l}),c&&(0,s.createElement)(HC,{__unstableContentRef:t,clientId:o}),!i&&!r&&(0,s.createElement)(_l.Popover.Slot,{name:"block-toolbar",ref:w}),e,(0,s.createElement)(_l.Popover.Slot,{name:"__unstable-block-tools-after",ref:S}),i&&(0,s.createElement)(GC,{__unstableContentRef:t})))}function jC({shouldIframe:e=!0,height:t="300px",children:n=(0,s.createElement)(Xw,null),styles:o,contentRef:r,iframeProps:l}){const i=$w(),a=F_(),c=(0,u.useRef)(),d=(0,p.useMergeRefs)([r,a,c]);return e?(0,s.createElement)($C,{__unstableContentRef:c,style:{height:t,display:"flex"}},(0,s.createElement)(py,{...l,ref:i,contentRef:d,style:{...l?.style},name:"editor-canvas"},(0,s.createElement)(wy,{styles:o}),n)):(0,s.createElement)($C,{__unstableContentRef:c,style:{height:t,display:"flex"}},(0,s.createElement)(wy,{styles:o,scope:".editor-styles-wrapper"}),(0,s.createElement)(sy,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"}},n))}const WC=function({children:e,height:t,styles:n}){return(0,s.createElement)(jC,{height:t,styles:n},e)},KC=()=>(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(_l.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"})),ZC=({style:e,className:t})=>(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e},(0,s.createElement)(KC,null))),qC=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(_l.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,x.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==zs.DOWN||(e.preventDefault(),n())},icon:(0,s.createElement)(t,null,(0,s.createElement)(e,null,(0,s.createElement)(ZC,null)))})),YC=({children:e,...t})=>(w()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(_l.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:qC(t),renderContent:()=>e})),XC=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),QC=(0,u.createContext)({}),JC=()=>(0,u.useContext)(QC);function ex({children:e,...t}){const n=(0,u.useRef)();return(0,u.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,s.createElement)("div",{hidden:!0,...t,ref:n},e)}const tx=(0,u.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:l,setInsertedBlock:i}=JC(),a=(0,p.useInstanceId)(tx),c=(0,d.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(Nr);return!!t(n)||"zoom-out"===o()}),[n]),m=df({clientId:n,context:"list-view"}),h=df({clientId:l?.clientId,context:"list-view"});if((0,u.useEffect)((()=>{h?.length&&(0,vo.speak)((0,x.sprintf)((0,x.__)("%s block inserted"),h),"assertive")}),[h]),c)return null;const g=`list-view-appender__${a}`,f=(0,x.sprintf)((0,x.__)("Append to %1$s block at position %2$d, Level %3$d"),m,t+1,e);return(0,s.createElement)("div",{className:"list-view-appender"},(0,s.createElement)(lw,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":g},onSelectOrClose:e=>{e?.clientId&&i(e)}}),(0,s.createElement)(ex,{id:g},f))})),nx=o_(_l.__experimentalTreeGridRow),ox=(0,u.forwardRef)((({isDragged:e,isSelected:t,position:n,level:o,rowCount:r,children:l,className:i,path:a,...c},u)=>{const d=l_({clientId:c["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),m=(0,p.useMergeRefs)([u,d]);return(0,s.createElement)(nx,{ref:m,className:ml()("block-editor-list-view-leaf",i),level:o,positionInSet:n,setSize:r,isExpanded:void 0,...c},l)})),rx=ox;const lx=(0,s.createElement)(Z.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z"})),ix=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"}));function sx({onClick:e}){return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander"},(0,s.createElement)(Ti,{icon:(0,x.isRTL)()?Zs:qs}))}const ax=3;function cx(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}function ux(e,t){const n=cx(e);return n?[n]:t?[]:function(e){if("core/gallery"!==e.name||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const e=cx(n);if(e&&t.push(e),t.length>=ax)return t}return t}(e)}const dx=(0,u.forwardRef)((function({className:e,block:{clientId:t,name:n},onClick:o,onContextMenu:r,onMouseDown:l,onToggleExpanded:i,tabIndex:a,onFocus:p,onDragStart:m,onDragEnd:h,draggable:g,isExpanded:f,ariaLabel:b,ariaDescribedBy:v,updateFocusAndSelection:k},_){const y=ih(t),E=df({clientId:t,context:"list-view"}),{isLocked:w}=Th(t),{canInsertBlockType:S,getSelectedBlockClientIds:C,getPreviousBlockClientId:B,getBlockRootClientId:I,getBlockOrder:T,getBlocksByClientId:M,getBlockAttributes:P,canRemoveBlocks:R}=(0,d.useSelect)(Nr),{duplicateBlocks:N,multiSelect:L,removeBlocks:A}=(0,d.useDispatch)(Nr),O=(0,A_.__unstableUseShortcutEventMatch)(),D="sticky"===y?.positionType,z=function({clientId:e,isExpanded:t}){const{block:n}=(0,d.useSelect)((t=>({block:t(Nr).getBlock(e)})),[e]);return(0,u.useMemo)((()=>ux(n,t)),[n,t])}({clientId:t,isExpanded:f}),{rootClientId:V}=JC(),F=P(t)?.metadata?.bindings,H=y?.positionLabel?(0,x.sprintf)((0,x.__)("Position: %1$s"),y.positionLabel):"";function G(){const e=C(),n=e.includes(t),o=n?e[0]:t,r=I(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.Button,{className:ml()("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:async function(e){if(e.keyCode===zs.ENTER||e.keyCode===zs.SPACE)o(e);else if(e.keyCode===zs.BACKSPACE||e.keyCode===zs.DELETE||O("core/block-editor/remove",e)){var t;const{blocksToUpdate:e,firstBlockClientId:n,firstBlockRootClientId:o,selectedBlockClientIds:r}=G();if(!R(e,o))return;let l=null!==(t=B(n))&&void 0!==t?t:o;A(e,!1);const i=r.length>0&&0===C().length;l||(l=T()[0]),k(l,i)}else if(O("core/block-editor/duplicate",e)){if(e.defaultPrevented)return;e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=G(),o=M(t).every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&S(e.name,n)));if(o){const e=await N(t,!1);e?.length&&k(e[0],!1)}}else if(O("core/block-editor/select-all",e)){if(e.defaultPrevented)return;e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=G(),o=T(t);if(!o.length)return;if(js()(n,o)&&t&&t!==V)return void k(t,!0);L(o[0],o[o.length-1],null)}},onMouseDown:l,ref:_,tabIndex:a,onFocus:p,onDragStart:e=>{e.dataTransfer.clearData(),m?.(e)},onDragEnd:h,draggable:g,href:`#block-${t}`,"aria-label":b,"aria-describedby":v,"aria-expanded":f},(0,s.createElement)(sx,{onClick:i}),(0,s.createElement)(qh,{icon:y?.icon,showColors:!0,context:"list-view"}),(0,s.createElement)(_l.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(_l.__experimentalTruncate,{ellipsizeMode:"auto"},E)),y?.anchor&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,s.createElement)(_l.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},y.anchor)),F&&eg(n)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__bindings"},(0,s.createElement)(Ti,{icon:AC})),H&&D&&(0,s.createElement)(_l.Tooltip,{text:H},(0,s.createElement)(Ti,{icon:lx})),z.length?(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0},z.map(((e,t)=>(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__image",key:e.clientId,style:{backgroundImage:`url(${e.url})`,zIndex:z.length-t}})))):null,w&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Ti,{icon:ix})))))})),px=(0,u.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:l,level:i,isExpanded:a,selectedClientIds:c,...u},p)=>{const{clientId:m}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:g}=(0,d.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Nr);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:f,insertedBlock:b,setInsertedBlock:v}=JC(),k=h&&g===m,_=ml()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=c.includes(m)?c:[m];return(0,s.createElement)(s.Fragment,null,f&&(0,s.createElement)(f,{block:n,insertedBlock:b,setInsertedBlock:v}),(0,s.createElement)(sS,{appendToOwnerDocument:!0,clientIds:y,cloneClassname:"block-editor-list-view-draggable-chip"},(({draggable:c,onDragStart:d,onDragEnd:m})=>(0,s.createElement)(dx,{ref:p,className:_,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:l,level:i,draggable:c,onDragStart:d,onDragEnd:m,isExpanded:a,...u}))))})),mx=px;function hx(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?As.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}const gx=(0,u.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:o,isDragged:r,isNesting:l,isSelected:i,isBranchSelected:a,selectBlock:m,position:h,level:g,rowCount:f,siblingBlockCount:b,showBlockMovers:v,path:k,isExpanded:_,selectedClientIds:y,isSyncedBranch:E}){const w=(0,u.useRef)(null),S=(0,u.useRef)(null),C=(0,u.useRef)(null),[B,I]=(0,u.useState)(!1),[T,M]=(0,u.useState)(),{isLocked:P,canEdit:R,canMove:N}=Th(t),L=i&&y[0]===t,A=i&&y[y.length-1]===t,{toggleBlockHighlight:O}=(0,d.useDispatch)(Nr),D=ih(t),z=D?.name||D?.title||(0,x.__)("Untitled"),{block:V,blockName:F,blockEditingMode:H}=(0,d.useSelect)((e=>{const{getBlock:n,getBlockName:o,getBlockEditingMode:r}=e(Nr);return{block:n(t),blockName:o(t),blockEditingMode:r(t)}}),[t]),G=(0,d.useSelect)((e=>e(Nr).getSettings().allowRightClickOverrides),[]),U=(0,c.hasBlockSupport)(F,"__experimentalToolbar",!0)&&"default"===H,$=`list-view-block-select-button__${(0,p.useInstanceId)(e)}`,{expand:j,collapse:W,BlockSettingsMenu:K,listViewInstanceId:Z,expandedState:q,setInsertedBlock:Y,treeGridElementRef:X}=JC(),Q=(0,u.useCallback)((()=>{I(!0),O(t,!0)}),[t,I,O]),J=(0,u.useCallback)((()=>{I(!1),O(t,!1)}),[t,I,O]),ee=(0,u.useCallback)((e=>{m(e,t),e.preventDefault()}),[t,m]),te=(0,u.useCallback)(((e,t)=>{t&&m(void 0,e,null,null),hx(e,X?.current)}),[m,X]),ne=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?W(t):!1===_&&j(t)}),[t,j,W,_]),oe=(0,u.useCallback)((e=>{U&&G&&(C.current?.click(),M(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[G,C,U]),re=(0,u.useCallback)((e=>{G&&2===e.button&&e.preventDefault()}),[G]),le=(0,u.useMemo)((()=>{const{ownerDocument:e}=S?.current||{};if(T&&e)return{ownerDocument:e,getBoundingClientRect:()=>T}}),[T]),ie=(0,u.useCallback)((()=>{M(void 0)}),[M]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,u.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,As.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const l=n.current.getBoundingClientRect(),i=t.getBoundingClientRect();(l.top<i.top||l.bottom>i.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:i,rowItemRef:S,selectedClientIds:y}),!V)return null;const se=((e,t,n)=>(0,x.sprintf)((0,x.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(h,b,g),ae=P?(0,x.sprintf)((0,x.__)("%s (locked)"),z):z,ce=(0,x.sprintf)((0,x.__)("Options for %s"),z),ue=v&&b>0,de=ml()("block-editor-list-view-block__mover-cell",{"is-visible":B||i}),pe=ml()("block-editor-list-view-block__menu-cell",{"is-visible":B||L});let me;ue?me=2:U||(me=3);const he=ml()({"is-selected":i,"is-first-selected":L,"is-last-selected":A,"is-branch-selected":a,"is-synced-branch":E,"is-dragging":r,"has-single-cell":!U,"is-synced":D?.isSynced,"is-draggable":N,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":o,"is-nesting":l}),ge=y.includes(t)?y:[t],fe=i&&1===y.length;return(0,s.createElement)(rx,{className:he,isDragged:r,onKeyDown:e=>{e.keyCode===zs.ESCAPE&&!e.defaultPrevented&&y.length>0&&(e.stopPropagation(),e.preventDefault(),m(e,void 0))},onMouseEnter:Q,onMouseLeave:J,onFocus:Q,onBlur:J,level:g,position:h,rowCount:f,path:k,id:`list-view-${Z}-block-${t}`,"data-block":t,"data-expanded":R?_:void 0,ref:S},(0,s.createElement)(_l.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:me,ref:w,"aria-selected":!!i},(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(mx,{block:V,onClick:ee,onContextMenu:oe,onMouseDown:re,onToggleExpanded:ne,isSelected:i,position:h,siblingBlockCount:b,level:g,ref:e,tabIndex:fe?0:t,onFocus:n,isExpanded:R?_:void 0,selectedClientIds:y,ariaLabel:ae,ariaDescribedBy:$,updateFocusAndSelection:te}),(0,s.createElement)(ex,{id:$},se)))),ue&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.__experimentalTreeGridCell,{className:de,withoutGridItem:!0},(0,s.createElement)(_l.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,s.createElement)(gS,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))),(0,s.createElement)(_l.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,s.createElement)(fS,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))))),U&&K&&(0,s.createElement)(_l.__experimentalTreeGridCell,{className:pe,"aria-selected":!!i,ref:C},(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)(K,{clientIds:ge,block:V,icon:Ef,label:ce,popoverProps:{anchor:le},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:ie,onFocus:n},disableOpenOnArrowDown:!0,expand:j,expandedState:q,setInsertedBlock:Y,__experimentalSelectBlock:te}))))}));function fx(e,t,n,o){var r;const l=n?.includes(e.clientId);if(l)return 0;return(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(bx(t,n,o),0):1}const bx=(e,t,n)=>(o,r)=>{var l;const i=t?.includes(r.clientId);if(i)return o;return(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+fx(r,e,t,n):o+1},vx=()=>{};const kx=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=vx,showBlockMovers:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:u=0,fixedListWindow:p,isExpanded:m,parentId:h,shouldShowInnerBlocks:g=!0,isSyncedBranch:f=!1,showAppender:b=!0}=t,v=ih(h),k=f||!!v?.isSynced,_=(0,d.useSelect)((e=>!h||e(Nr).canEditBlock(h)),[h]),{blockDropPosition:y,blockDropTargetIndex:E,firstDraggedBlockIndex:w,blockIndexes:S,expandedState:C,draggedClientIds:x}=JC();if(!_)return null;const B=b&&1===i,I=n.filter(Boolean),T=I.length,M=B?T+1:T;let P=u;return(0,s.createElement)(s.Fragment,null,I.map(((t,n)=>{var u;const{clientId:h,innerBlocks:f}=t;n>0&&(P+=fx(I[n-1],C,x,m));const b=!!x?.includes(h),{displacement:v,isAfterDraggedBlocks:_,isNesting:B}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:o,firstDraggedBlockIndex:r,isDragged:l}){let i,s,a;if(!l){s=!1;const l=e[o];a=l>r,null!=t&&void 0!==r?void 0!==l&&(i=l>=r&&l<t?"up":l<r&&l>=t?"down":"normal",s="number"==typeof t&&t-1===l&&"inside"===n):null===t&&void 0!==r?i=void 0!==l&&l>=r?"up":"normal":null!=t&&void 0===r?void 0!==l&&(i=l<t?"normal":"down"):null===t&&(i="normal")}return{displacement:i,isNesting:s,isAfterDraggedBlocks:a}}({blockIndexes:S,blockDropTargetIndex:E,blockDropPosition:y,clientId:h,firstDraggedBlockIndex:w,isDragged:b}),{itemInView:R}=p,N=R(P),L=n+1,A=a.length>0?`${a}_${L}`:`${L}`,O=!!f?.length,D=O&&g?null!==(u=C[h])&&void 0!==u?u:m:void 0,z=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,l),V=c||z&&O,F=b||N||z&&h===l[0];return(0,s.createElement)(d.AsyncModeProvider,{key:h,value:!z},F&&(0,s.createElement)(gx,{block:t,selectBlock:o,isSelected:z,isBranchSelected:V,isDragged:b,level:i,position:L,rowCount:M,siblingBlockCount:T,showBlockMovers:r,path:A,isExpanded:!b&&D,listPosition:P,selectedClientIds:l,isSyncedBranch:k,displacement:v,isAfterDraggedBlocks:_,isNesting:B}),!F&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),O&&D&&!b&&(0,s.createElement)(e,{parentId:h,blocks:f,selectBlock:o,showBlockMovers:r,level:i+1,path:A,listPosition:P+1,fixedListWindow:p,isBranchSelected:V,selectedClientIds:l,isExpanded:m,isSyncedBranch:k}))})),B&&(0,s.createElement)(_l.__experimentalTreeGridRow,{level:i,setSize:M,positionInSet:M,isExpanded:!0},(0,s.createElement)(_l.__experimentalTreeGridCell,null,(e=>(0,s.createElement)(tx,{clientId:h,nestingLevel:i,blockCount:T,...e})))))}));function _x({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const o=ih(e),r=df({clientId:e,context:"list-view"}),{rootClientId:l,clientId:i,dropPosition:a}=n||{},[c,d]=(0,u.useMemo)((()=>{if(!t.current)return[];return[l?t.current.querySelector(`[data-block="${l}"]`):void 0,i?t.current.querySelector(`[data-block="${i}"]`):void 0]}),[t,l,i]),p=d||c,m=(0,x.isRTL)(),h=(0,u.useCallback)(((e,t)=>{if(!p)return 0;let n=p.offsetWidth;const o=(0,As.getScrollContainer)(p,"horizontal"),r=p.ownerDocument,l=o===r.body||o===r.documentElement;if(o&&!l){const r=o.getBoundingClientRect(),l=(0,x.isRTL)()?r.right-e.right:e.left-r.left,i=o.clientWidth;if(i<n+l&&(n=i-l),!m&&e.left+t<r.left)return n-=r.left-e.left,n;if(m&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[m,p]),g=(0,u.useMemo)((()=>{if(!p)return{};const e=p.getBoundingClientRect();return{width:h(e,0)}}),[h,p]),f=(0,u.useMemo)((()=>{if(!p)return{};const e=(0,As.getScrollContainer)(p),t=p.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=p.getBoundingClientRect(),o=m?t.right-n.right:n.left-t.left;if(!m&&t.left>n.left)return{transform:`translateX( ${o}px )`};if(m&&t.right<n.right)return{transform:`translateX( ${-1*o}px )`}}return{}}),[m,p]),b=(0,u.useMemo)((()=>{if(!c)return 1;const e=parseInt(c.getAttribute("aria-level"),10);return e?e+1:1}),[c]),v=(0,u.useMemo)((()=>!!p&&p.classList.contains("is-branch-selected")),[p]),k=(0,u.useMemo)((()=>{if(p&&("top"===a||"bottom"===a||"inside"===a))return{contextElement:p,getBoundingClientRect(){const e=p.getBoundingClientRect();let t=e.left,n=0;const o=(0,As.getScrollContainer)(p,"horizontal"),r=p.ownerDocument,l=o===r.body||o===r.documentElement;if(o&&!l){const e=o.getBoundingClientRect(),n=m?o.offsetWidth-o.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===a?e.top-2*e.height:e.top;const i=h(e,0),s=e.height;return new window.DOMRect(t,n,i,s)}}}),[p,a,h,m]);return p?(0,s.createElement)(_l.Popover,{animate:!1,anchor:k,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0},(0,s.createElement)("div",{style:g,className:ml()("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":v})},(0,s.createElement)("div",{className:"block-editor-list-view-leaf","aria-level":b},(0,s.createElement)("div",{className:ml()("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f},(0,s.createElement)(sx,{onClick:()=>{}}),(0,s.createElement)(qh,{icon:o?.icon,showColors:!0,context:"list-view"}),(0,s.createElement)(_l.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1},(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(_l.__experimentalTruncate,{ellipsizeMode:"auto"},r)))),(0,s.createElement)("div",{className:"block-editor-list-view-block__menu-cell"})))):null}function yx(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,d.useDispatch)(Nr),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:l,getSelectedBlockClientIds:i,hasMultiSelection:s,hasSelectedBlock:a}=(0,d.useSelect)(Nr),{getBlockType:p}=(0,d.useSelect)(c.store);return{updateBlockSelection:(0,u.useCallback)((async(c,u,d,m)=>{if(!c?.shiftKey&&c?.keyCode!==zs.ESCAPE)return void n(u,m);c.preventDefault();const h="keydown"===c.type&&c.keyCode===zs.ESCAPE,g="keydown"===c.type&&(c.keyCode===zs.UP||c.keyCode===zs.DOWN||c.keyCode===zs.HOME||c.keyCode===zs.END);if(!g&&!a()&&!s())return void n(u,null);const f=i(),b=[...r(u),u];if((h||g&&!f.some((e=>b.includes(e))))&&await e(),!h){let e=l(),n=u;g&&(a()||s()||(e=u),d&&(n=d));const o=r(e),i=r(n),{start:c,end:p}=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]}}(e,n,o,i);await t(c,p,null)}const v=i();if((c.keyCode===zs.HOME||c.keyCode===zs.END)&&v.length>1)return;const k=f.filter((e=>!v.includes(e)));let _;if(1===k.length){const e=p(o(k[0]))?.title;e&&(_=(0,x.sprintf)((0,x.__)("%s deselected."),e))}else k.length>1&&(_=(0,x.sprintf)((0,x.__)("%s blocks deselected."),k.length));_&&(0,vo.speak)(_,"assertive")}),[e,o,p,r,l,i,s,a,t,n])}}const Ex=28;function wx(e,t){const n=e[t+1];return n&&n.isDraggedBlock?wx(e,t+1):n}const Sx=["top","bottom"];function Cx(e,t,n=!1){let o,r,l,i,s;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=Iw(t,c,Sx),p=Tw(t,c);if(void 0===l||u<l||p){l=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",i=n.element.getBoundingClientRect(),s=t-1):(r=a,o=d,i=c,s=t),p)break}}if(!r)return;const a=function(e,t){const n=[];let o=e;for(;o;)n.push({...o}),o=t.find((e=>e.clientId===o.rootClientId));return n}(r,e),c="bottom"===o;if(c&&r.canInsertDraggedBlocksAsChild&&(r.innerBlockCount>0&&r.isExpanded||function(e,t,n=1,o=!1){const r=o?t.right-n*Ex:t.left+n*Ex;return(o?e.x<r-Ex:e.x>r+Ex)&&e.y<t.bottom}(t,i,a.length,n))){const e=r.isExpanded?0:r.innerBlockCount||0;return{rootClientId:r.clientId,clientId:r.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&r.rootClientId&&function(e,t,n=1,o=!1){const r=o?t.right-n*Ex:t.left+n*Ex;return o?e.x>r:e.x<r}(t,i,a.length,n)){const l=wx(e,s),c=r.nestingLevel,u=l?l.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*Ex:t.left+n*Ex,l=o?r-e.x:e.x-r,i=Math.round(l/Ex);return Math.abs(i)}(t,i,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=r.blockIndex;if(a[p].nestingLevel===l?.nestingLevel)t=l?.blockIndex;else for(let n=s;n>=0;n--){const o=e[n];if(o.rootClientId===a[p].rootClientId){t=o.blockIndex+1;break}}return{rootClientId:a[p].rootClientId,clientId:r.clientId,blockIndex:t,dropPosition:o}}}}if(!r.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:r.rootClientId,clientId:r.clientId,blockIndex:r.blockIndex+u,dropPosition:o}}const xx={leading:!1,trailing:!0};function Bx({selectBlock:e}){const t=(0,d.useRegistry)(),{getBlockOrder:n,getBlockRootClientId:o,getBlocksByClientId:r,getPreviousBlockClientId:l,getSelectedBlockClientIds:i,getSettings:s,canInsertBlockType:a,canRemoveBlocks:c}=(0,d.useSelect)(Nr),{flashBlock:u,removeBlocks:m,replaceBlocks:h,insertBlocks:g}=(0,d.useDispatch)(Nr),f=ey();return(0,p.useRefEffect)((d=>{function p(t,n){n&&e(void 0,t,null,null),hx(t,d)}function b(e){if(e.defaultPrevented)return;if(!d.contains(e.target.ownerDocument.activeElement))return;const b=e.target.ownerDocument.activeElement?.closest("[role=row]"),v=b?.dataset?.block;if(!v)return;const{blocksToUpdate:k,firstBlockClientId:_,firstBlockRootClientId:y,originallySelectedBlockClientIds:E}=function(e){const t=i(),n=t.includes(e),r=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:r,firstBlockRootClientId:o(r),originallySelectedBlockClientIds:t}}(v);if(0!==k.length){if(e.preventDefault(),"copy"===e.type||"cut"===e.type){1===k.length&&u(k[0]),f(e.type,k);oy(e,r(k),t)}if("cut"===e.type){var w;if(!c(k,y))return;let e=null!==(w=l(_))&&void 0!==w?w:y;m(k,!1);const t=E.length>0&&0===i().length;e||(e=n()[0]),p(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=s(),n=ry(e,t);if(1===k.length){const[e]=k;if(n.every((t=>a(t.name,e))))return g(n,void 0,e),void p(n[0]?.clientId,!1)}h(k,n,n.length-1,-1),p(n[0]?.clientId,!1)}}}return d.ownerDocument.addEventListener("copy",b),d.ownerDocument.addEventListener("cut",b),d.ownerDocument.addEventListener("paste",b),()=>{d.ownerDocument.removeEventListener("copy",b),d.ownerDocument.removeEventListener("cut",b),d.ownerDocument.removeEventListener("paste",b)}}),[])}const Ix=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;const Tx=(0,u.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:l=!1,showAppender:i=!1,blockSettingsMenu:a=kC,rootClientId:c,description:m,onSelect:h,additionalBlockContent:g},f){n&&w()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const b=(0,p.useInstanceId)(e),{clientIdsTree:v,draggedClientIds:k,selectedClientIds:_}=function({blocks:e,rootClientId:t}){return(0,d.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:l}=ie(n(Nr));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:l(t)}}),[e,t])}({blocks:n,rootClientId:c}),y=function(e){const t=(0,u.useMemo)((()=>{const t={};let n=0;const o=e=>{e.forEach((e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&o(e.innerBlocks)}))};return o(e),t}),[e]);return t}(v),{getBlock:E}=(0,d.useSelect)(Nr),{visibleBlockCount:S,shouldShowInnerBlocks:C}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(Nr),r=k?.length>0?n(k).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[k]),{updateBlockSelection:B}=yx(),[I,T]=(0,u.useReducer)(Ix,{}),[M,P]=(0,u.useState)(null),{setSelectedTreeId:R}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,u.useState)(null),{selectedBlockParentClientIds:r}=(0,d.useSelect)((t=>{const{getBlockParents:n}=t(Nr);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,u.useEffect)((()=>{n!==e&&r?.length&&t({type:"expand",clientIds:r})}),[e,r,n,t]),{setSelectedTreeId:o}}({firstSelectedBlockClientId:_[0],setExpandedState:T}),N=(0,u.useCallback)(((e,t,n)=>{B(e,t,null,n),R(t),h&&h(E(t))}),[R,B,h,E]),{ref:L,target:A}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:o,getBlockIndex:r,getBlockCount:l,getDraggedBlockClientIds:i,canInsertBlocks:s}=(0,d.useSelect)(Nr),[a,c]=(0,u.useState)(),{rootClientId:m,blockIndex:h}=a||{},g=Bw(m,h),f=(0,x.isRTL)(),b=(0,p.usePrevious)(m),v=(0,u.useCallback)(((e,t)=>{const{rootClientId:o}=t||{};o&&("inside"!==t?.dropPosition||e[o]||n({type:"expand",clientIds:[o]}))}),[n]),k=(0,p.useThrottle)(v,500,xx);(0,u.useEffect)((()=>{"inside"===a?.dropPosition&&b===a?.rootClientId?k(t,a):k.cancel()}),[t,b,a,k]);const _=i(),y=(0,p.useThrottle)((0,u.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},i=!!_?.length,a=Cx(Array.from(t.querySelectorAll("[data-block]")).map((e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,a=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=o(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:r(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!i&&a,innerBlockCount:l(t),canInsertDraggedBlocksAsSibling:!i||s(_,u),canInsertDraggedBlocksAsChild:!i||s(_,t)}})),n,f);a&&c(a)}),[s,_,l,r,o,f]),50);return{ref:(0,p.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){a&&g(e)},onDragLeave(){y.cancel(),c(null)},onDragOver(e){y(e,e.currentTarget)},onDragEnd(){y.cancel(),c(void 0)}}),target:a}}({dropZoneElement:o,expandedState:I,setExpandedState:T}),O=(0,u.useRef)(),D=Bx({selectBlock:N}),z=(0,p.useMergeRefs)([D,O,L,f]);(0,u.useEffect)((()=>{_?.length&&hx(_[0],O?.current)}),[]);const V=(0,u.useCallback)((e=>{e&&T({type:"expand",clientIds:[e]})}),[T]),F=(0,u.useCallback)((e=>{e&&T({type:"collapse",clientIds:[e]})}),[T]),H=(0,u.useCallback)((e=>{V(e?.dataset?.block)}),[V]),G=(0,u.useCallback)((e=>{F(e?.dataset?.block)}),[F]),U=(0,u.useCallback)(((e,t,n)=>{e.shiftKey&&B(e,t?.dataset?.block,n?.dataset?.block)}),[B]),$=k?.[0],{blockDropTargetIndex:j,blockDropPosition:W,firstDraggedBlockIndex:K}=(0,u.useMemo)((()=>{let e,t;if(A?.clientId){const t=y[A.clientId];e=void 0===t||"top"===A?.dropPosition?t:t+1}else null===A&&(e=null);if($){const e=y[$];t=void 0===e||"top"===A?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:A?.dropPosition,firstDraggedBlockIndex:t}}),[A,y,$]),Z=(0,u.useMemo)((()=>({blockDropPosition:W,blockDropTargetIndex:j,blockIndexes:y,draggedClientIds:k,expandedState:I,expand:V,firstDraggedBlockIndex:K,collapse:F,BlockSettingsMenu:a,listViewInstanceId:b,AdditionalBlockContent:g,insertedBlock:M,setInsertedBlock:P,treeGridElementRef:O,rootClientId:c})),[W,j,y,k,I,V,K,F,a,b,g,M,P,c]),[q]=(0,p.__experimentalUseFixedWindowList)(O,36,S,{expandedState:I,useWindowing:!0,windowOverscan:40});if(!v.length&&!i)return null;const Y=m&&`block-editor-list-view-description-${b}`;return(0,s.createElement)(d.AsyncModeProvider,{value:!0},(0,s.createElement)(_x,{draggedBlockClientId:$,listViewRef:O,blockDropTarget:A}),m&&(0,s.createElement)(_l.VisuallyHidden,{id:Y},m),(0,s.createElement)(_l.__experimentalTreeGrid,{id:t,className:ml()("block-editor-list-view-tree",{"is-dragging":k?.length>0&&void 0!==j}),"aria-label":(0,x.__)("Block navigation structure"),ref:z,onCollapseRow:G,onExpandRow:H,onFocusRow:U,applicationAriaLabel:(0,x.__)("Block navigation structure"),"aria-describedby":Y,style:{"--wp-admin--list-view-dragged-items-height":k?.length?36*(k.length-1)+"px":null}},(0,s.createElement)(QC.Provider,{value:Z},(0,s.createElement)(kx,{blocks:v,parentId:c,selectBlock:N,showBlockMovers:r,fixedListWindow:q,selectedClientIds:_,isExpanded:l,shouldShowInnerBlocks:C,showAppender:i}))))})),Mx=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(Tx,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function Px({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,s.createElement)(_l.Button,{...r,ref:o,icon:XC,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,x.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}const Rx=(0,u.forwardRef)((function({isDisabled:e,...t},n){w()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,d.useSelect)((e=>!!e(Nr).getBlockCount()),[])&&!e;return(0,s.createElement)(_l.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,s.createElement)(Px,{...t,innerRef:n,isOpen:e,onToggle:r,isEnabled:o}),renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,x.__)("List view")),(0,s.createElement)(Mx,null))})}));function Nx({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,c.getBlockType)(e.name)?.example,l=RS(n,o,t),i=(0,u.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:l+" block-editor-block-styles__block-preview-container"},example:r})),[e,l]);return(0,s.createElement)(Py,{item:i})}const Lx=()=>{};const Ax=function({clientId:e,onSwitch:t=Lx,onHoverClassName:n=Lx}){const{onSelect:o,stylesToRender:r,activeStyle:l,genericPreviewBlock:i,className:a}=LS({clientId:e,onSwitch:t}),[c,d]=(0,u.useState)(null),m=(0,p.useViewportMatch)("medium","<");if(!r||0===r.length)return null;const h=(0,p.debounce)(d,250),g=e=>{var t;c!==e?(h(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):h.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(_l.Button,{__next40pxDefaultSize:!0,className:ml()("block-editor-block-styles__item",{"is-active":l.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>g(e),onFocus:()=>g(e),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>(e=>{o(e),n(null),d(null),h.cancel()})(e),"aria-current":l.name===e.name},(0,s.createElement)(_l.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!m&&(0,s.createElement)(_l.Popover,{placement:"left-start",offset:34,focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null)},(0,s.createElement)(Nx,{activeStyle:l,className:a,genericPreviewBlock:i,style:c}))))},Ox={0:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})),1:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),2:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})),3:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})),4:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),5:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})),6:(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"}))};function Dx({level:e}){return Ox[e]?(0,s.createElement)(_l.Icon,{icon:Ox[e]}):null}const zx=[1,2,3,4,5,6],Vx={className:"block-library-heading-level-dropdown"};function Fx({options:e=zx,value:t,onChange:n}){return(0,s.createElement)(_l.ToolbarDropdownMenu,{popoverProps:Vx,icon:(0,s.createElement)(Dx,{level:t}),label:(0,x.__)("Change level"),controls:e.map((e=>{{const o=e===t;return{icon:(0,s.createElement)(Dx,{level:e,isPressed:o}),title:0===e?(0,x.__)("Paragraph"):(0,x.sprintf)((0,x.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}}))})}const Hx=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"}));const Gx=function({icon:e=Hx,label:t=(0,x.__)("Choose variation"),instructions:n=(0,x.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:l}){const i=ml()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,s.createElement)(_l.Placeholder,{icon:e,label:t,instructions:n,className:i},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,x.__)("Block variations")},o.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(_l.Button,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>r(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),l&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(_l.Button,{variant:"link",onClick:()=>r()},(0,x.__)("Skip"))))},Ux=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})),$x="carousel",jx="grid",Wx=({onBlockPatternSelect:e})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(_l.Button,{variant:"primary",onClick:e},(0,x.__)("Choose"))),Kx=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(_l.Button,{icon:M_,label:(0,x.__)("Previous pattern"),onClick:e,disabled:0===n,__experimentalIsFocusable:!0}),(0,s.createElement)(_l.Button,{icon:T_,label:(0,x.__)("Next pattern"),onClick:t,disabled:n===o-1,__experimentalIsFocusable:!0})),Zx=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l,onBlockPatternSelect:i})=>{const a=e===$x,c=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(_l.Button,{icon:Xi,label:(0,x.__)("Carousel view"),onClick:()=>t($x),isPressed:a}),(0,s.createElement)(_l.Button,{icon:Ux,label:(0,x.__)("Grid view"),onClick:()=>t(jx),isPressed:e===jx}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},a&&(0,s.createElement)(Kx,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:l}),c,a&&(0,s.createElement)(Wx,{onBlockPatternSelect:i}))};const qx=function(e,t,n){return(0,d.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Nr),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])},{CompositeV2:Yx,CompositeItemV2:Xx,useCompositeStoreV2:Qx}=ie(_l.privateApis),Jx=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const l=Qx(),i="block-editor-block-pattern-setup__container";if(e===$x){const e=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel"},(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"carousel-container"},n.map(((n,o)=>(0,s.createElement)(tB,{active:o===t,className:e.get(o)||"",key:n.name,pattern:n}))))))}return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(Yx,{store:l,role:"listbox",className:i,"aria-label":(0,x.__)("Patterns list")},n.map((e=>(0,s.createElement)(eB,{key:e.name,pattern:e,onSelect:o,showTitles:r})))))};function eB({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:l,viewportWidth:i=700}=e,a=(0,p.useInstanceId)(eB,`${o}__item-description`);return(0,s.createElement)("div",{className:`${o}__list-item`},(0,s.createElement)(Xx,{render:(0,s.createElement)("div",{"aria-describedby":l?a:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(r)},(0,s.createElement)(Ty,{blocks:r,viewportWidth:i}),n&&(0,s.createElement)("div",{className:`${o}__item-title`},e.title),!!l&&(0,s.createElement)(_l.VisuallyHidden,{id:a},l)))}function tB({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:l,description:i}=n,a=(0,p.useInstanceId)(tB,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(Ty,{blocks:r,minHeight:o}),!!i&&(0,s.createElement)(_l.VisuallyHidden,{id:a},i))}const nB=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=$x,showTitles:l=!1})=>{const[i,a]=(0,u.useState)(r),[p,m]=(0,u.useState)(0),{replaceBlock:h}=(0,d.useDispatch)(Nr),g=qx(e,t,n);if(!g?.length)return null;const f=o||(t=>{const n=t.map((e=>(0,c.cloneBlock)(e)));h(e,n)});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${i}`},(0,s.createElement)(Jx,{viewMode:i,activeSlide:p,patterns:g,onBlockPatternSelect:f,showTitles:l}),(0,s.createElement)(Zx,{viewMode:i,setViewMode:a,activeSlide:p,totalSlides:g.length,handleNext:()=>{m((e=>Math.min(e+1,g.length-1)))},handlePrevious:()=>{m((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{f(g[p].blocks)}})))};function oB({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,s.createElement)("fieldset",{className:e},(0,s.createElement)(_l.VisuallyHidden,{as:"legend"},(0,x.__)("Transform to variation")),o.map((e=>(0,s.createElement)(_l.Button,{key:e.name,icon:(0,s.createElement)(qh,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,x.sprintf)((0,x.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0}))))}function rB({className:e,onSelectVariation:t,selectedValue:n,variations:o}){const r=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,s.createElement)(_l.DropdownMenu,{className:e,label:(0,x.__)("Transform to variation"),text:(0,x.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:cS,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${e}__container`},(0,s.createElement)(_l.MenuGroup,null,(0,s.createElement)(_l.MenuItemsChoice,{choices:r,value:n,onSelect:t})))))}function lB({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,s.createElement)("div",{className:e},(0,s.createElement)(_l.__experimentalToggleGroupControl,{label:(0,x.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},o.map((e=>(0,s.createElement)(_l.__experimentalToggleGroupControlOptionIcon,{key:e.name,icon:e.icon,value:e.name,label:n===e.name?e.title:(0,x.sprintf)((0,x.__)("Transform to %s"),e.title)})))))}const iB=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,d.useDispatch)(Nr),{activeBlockVariation:n,variations:o}=(0,d.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(c.store),{getBlockName:r,getBlockAttributes:l}=t(Nr),i=e&&r(e);return{activeBlockVariation:n(i,l(e)),variations:i&&o(i,"transform")}}),[e]),r=n?.name,l=(0,u.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===o.length)}),[o]);if(!o?.length)return null;const i=o.length>5,a=l?i?oB:lB:rB;return(0,s.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...o.find((({name:e})=>e===n)).attributes})},selectedValue:r,variations:o})},sB=(0,p.createHigherOrderComponent)((e=>t=>{const[n,o]=Ar("color.palette","color.custom"),{colors:r=n,disableCustomColors:l=!o}=t,i=r&&r.length>0||!l;return(0,s.createElement)(e,{...t,colors:r,disableCustomColors:l,hasColorsToChoose:i})}),"withColorContext"),aB=sB(_l.ColorPalette);function cB({onChange:e,value:t,...n}){return(0,s.createElement)(Xu,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}const uB=window.wp.date,dB=new Date(2022,0,25);function pB({format:e,defaultFormat:t,onChange:n}){return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(_l.VisuallyHidden,{as:"legend"},(0,x.__)("Date format")),(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Default format"),help:`${(0,x.__)("Example:")} ${(0,uB.dateI18n)(t,dB)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,s.createElement)(mB,{format:e,onChange:n}))}function mB({format:e,onChange:t}){var n;const o=[...new Set(["Y-m-d",(0,x._x)("n/j/Y","short date format"),(0,x._x)("n/j/Y g:i A","short date format with time"),(0,x._x)("M j, Y","medium date format"),(0,x._x)("M j, Y g:i A","medium date format with time"),(0,x._x)("F j, Y","long date format"),(0,x._x)("M j","short date format without the year")])],r=o.map(((e,t)=>({key:`suggested-${t}`,name:(0,uB.dateI18n)(e,dB),format:e}))),l={key:"custom",name:(0,x.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,x.__)("Enter your own date format")},[i,a]=(0,u.useState)((()=>!!e&&!o.includes(e)));return(0,s.createElement)(_l.__experimentalVStack,null,(0,s.createElement)(_l.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,x.__)("Choose a format"),options:[...r,l],value:i?l:null!==(n=r.find((t=>t.format===e)))&&void 0!==n?n:l,onChange:({selectedItem:e})=>{e===l?a(!0):(a(!1),t(e.format))}}),i&&(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,x.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(_l.ExternalLink,{href:(0,x.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)}))}const hB=({setting:e,children:t,panelId:n,...o})=>(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...o,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter},t),gB=({colorValue:e,label:t})=>(0,s.createElement)(_l.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(_l.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,s.createElement)(_l.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t)),fB=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,l={onClick:t,className:ml()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,s.createElement)(_l.Button,{...l},(0,s.createElement)(gB,{colorValue:o,label:r}))};function bB({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:l,__experimentalIsRenderedInSidebar:i,...a}){let c;return i&&(c={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,l.map(((l,u)=>{var d;const p={clearable:!1,colorValue:l.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:l.gradientValue,gradients:r,label:l.label,onColorChange:l.onColorChange,onGradientChange:l.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:i,...l},m={colorValue:null!==(d=l.gradientValue)&&void 0!==d?d:l.colorValue,label:l.label};return l&&(0,s.createElement)(hB,{key:u,setting:l,...a},(0,s.createElement)(_l.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:fB(m),renderContent:()=>(0,s.createElement)(_l.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(Xu,{...p})))}))})))}const vB=["colors","disableCustomColors","gradients","disableCustomGradients"],kB=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:l,settings:i,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:m})=>{const h=(0,p.useInstanceId)(kB),{batch:g}=(0,d.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!i?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,s.createElement)(_l.__experimentalToolsPanel,{className:ml()("block-editor-panel-color-gradient-settings",e),label:c?a:void 0,resetAll:()=>{g((()=>{i.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(bB,{settings:i,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:u,enableAlpha:m}),!!l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.__experimentalSpacer,{marginY:4})," ",l)):null},_B=e=>{const t=qc();return(0,s.createElement)(kB,{...t,...e})},yB=e=>vB.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(kB,{...e}):(0,s.createElement)(_B,{...e});const EB=(0,u.createContext)({}),wB=()=>(0,u.useContext)(EB);function SB({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:l,children:i}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,u.useState)(),[l,i]=(0,u.useState)(),[s,a]=(0,u.useState)({x:0,y:0}),[c,d]=(0,u.useState)(100),[p,h]=(0,u.useState)(0),g=t/n,[f,b]=(0,u.useState)(g),v=(0,u.useCallback)((()=>{const t=(p+90)%360;let n=g;if(p%180==90&&(n=1/g),0===t)return r(),h(t),b(g),void a((e=>({x:-e.y*n,y:e.x*n})));const o=new window.Image;o.src=e,o.onload=function(e){const o=document.createElement("canvas");let l=0,i=0;t%180?(o.width=e.target.height,o.height=e.target.width):(o.width=e.target.width,o.height=e.target.height),90!==t&&180!==t||(l=o.width),270!==t&&180!==t||(i=o.height);const s=o.getContext("2d");s.translate(l,i),s.rotate(t*Math.PI/180),s.drawImage(e.target,0,0),o.toBlob((e=>{r(URL.createObjectURL(e)),h(t),b(o.width/o.height),a((e=>({x:-e.y*n,y:e.x*n})))}))};const l=(0,m.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof l&&(o.crossOrigin=l)}),[p,g,e]);return(0,u.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:l,setCrop:i,position:s,setPosition:a,zoom:c,setZoom:d,rotation:p,setRotation:h,rotateClockwise:v,aspect:f,setAspect:b,defaultAspect:g})),[o,l,s,c,p,v,f,g])}({url:t,naturalWidth:n,naturalHeight:o}),c=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:l}){const{createErrorNotice:i}=(0,d.useDispatch)(Os.store),[s,a]=(0,u.useState)(!1),c=(0,u.useCallback)((()=>{a(!1),l()}),[l]),p=(0,u.useCallback)((()=>{a(!0);const s=[];t>0&&s.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&s.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),ef()({path:`/wp/v2/media/${o}/edit`,method:"POST",data:{src:n,modifiers:s}}).then((e=>{r({id:e.id,url:e.source_url})})).catch((e=>{i((0,x.sprintf)((0,x.__)("Could not edit image. %s"),(0,As.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{a(!1),l()}))}),[e,t,o,n,r,i,l]);return(0,u.useMemo)((()=>({isInProgress:s,apply:p,cancel:c})),[s,p,c])}({id:e,url:t,onSaveImage:l,onFinishEditing:r,...a}),p=(0,u.useMemo)((()=>({...a,...c})),[a,c]);return(0,s.createElement)(EB.Provider,{value:p},i)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -38,4 +38,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var MC=function(e,t){return MC=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])},MC(e,t)};var PC=function(){return PC=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},PC.apply(this,arguments)};Object.create;Object.create;var NC=n(7970),LC=n.n(NC);function RC(e,t,n,o,r){void 0===r&&(r=0);var l=HC(t.width,t.height,r),i=l.width,a=l.height;return{x:AC(e.x,i,n.width,o),y:AC(e.y,a,n.height,o)}}function AC(e,t,n,o){var r=t*o/2-n/2;return GC(e,-r,r)}function DC(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function OC(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function zC(e,t){return Math.min(e,Math.max(0,t))}function VC(e,t){return t}function FC(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function HC(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function GC(e,t,n){return Math.min(Math.max(e,t),n)}function UC(){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 $C=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=Xa().createRef(),n.videoRef=Xa().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,r,l){var i=HC(t.width,t.height,n),a=GC(o.width/i.width*(100/e.width),r,l);return{crop:{x:a*i.width/2-o.width/2-i.width*a*(e.x/100),y:a*i.height/2-o.height/2-i.height*a*(e.y/100)},zoom:a}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=function(e,t,n,o,r,l){void 0===n&&(n=0);var i=HC(t.naturalWidth,t.naturalHeight,n),a=GC(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),s=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*s,y:((i.height-e.height)/2-e.y)*s},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidth<c||a.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=s>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=PC(PC({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:function(e,t,n,o,r,l){void 0===l&&(l=0);var i=HC(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}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=PC({},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.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?RC(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=LC()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=GC(e,n.props.minZoom,n.props.maxZoom);if(l){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*i-a.x,y:s.y*i-a.y},u=n.props.restrictPosition?RC(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var a=i?zC:VC,s=HC(t.width,t.height,l),c=HC(t.naturalWidth,t.naturalHeight,l),u={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:PC(PC({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}(n.props.restrictPosition?RC(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?RC(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}MC(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.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.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=DC(n,o),this.lastPinchRotation=OC(n,o),this.onDragStart(FC(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=FC(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=DC(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=OC(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,g=m.cropAreaStyle,h=m.mediaStyle,b=t.classes,v=b.containerClassName,_=b.cropAreaClassName,k=b.mediaClassName,y=t.objectFit;return Xa().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:UC("reactEasyCrop_Container",v)},n?Xa().createElement("img",PC({alt:"",className:UC("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{src:n,ref:this.imageRef,style:PC(PC({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):o&&Xa().createElement("video",PC({autoPlay:!0,loop:!0,muted:!0,className:UC("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical","auto-cover"===y&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:PC(PC({},h),{transform:l||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return Xa().createElement("source",PC({key:e.src},e))}))),this.state.cropSize&&Xa().createElement("div",{style:PC(PC({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:UC("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(Xa().Component);const jC=100,WC=300,KC={placement:"bottom-start"};function qC({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l,borderProps:i}){const{isInProgress:a,editedUrl:s,position:u,zoom:p,aspect:f,setPosition:g,setCrop:h,setZoom:b,rotation:v}=IC();let _=n||o*r/l;return v%180==90&&(_=o*l/r),(0,c.createElement)("div",{className:d()("wp-block-image__crop-area",i?.className,{"is-applying":a}),style:{...i?.style,width:t||o,height:_}},(0,c.createElement)($C,{image:s||e,disabled:a,minZoom:jC/100,maxZoom:WC/100,crop:u,zoom:p/100,aspect:f,onCropChange:e=>{g(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{b(100*e)}}),a&&(0,c.createElement)(m.Spinner,null))}var ZC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"}));function YC(){const{isInProgress:e,zoom:t,setZoom:n}=IC();return(0,c.createElement)(m.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:KC,renderToggle:({isOpen:t,onToggle:n})=>(0,c.createElement)(m.ToolbarButton,{icon:ZC,label:(0,v.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,c.createElement)(m.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Zoom"),min:jC,max:WC,value:Math.round(t),onChange:n})})}var XC=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function QC({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,c.createElement)(m.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,c.createElement)(m.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?gk:void 0},e))))}function JC({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=IC();return(0,c.createElement)(m.DropdownMenu,{icon:XC,label:(0,v.__)("Aspect Ratio"),popoverProps:KC,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(QC,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("Original"),aspect:r},{title:(0,v.__)("Square"),aspect:1}]}),(0,c.createElement)(QC,{label:(0,v.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("16:10"),aspect:1.6},{title:(0,v.__)("16:9"),aspect:16/9},{title:(0,v.__)("4:3"),aspect:4/3},{title:(0,v.__)("3:2"),aspect:1.5}]}),(0,c.createElement)(QC,{label:(0,v.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,v.__)("10:16"),aspect:.625},{title:(0,v.__)("9:16"),aspect:9/16},{title:(0,v.__)("3:4"),aspect:3/4},{title:(0,v.__)("2:3"),aspect:2/3}]}))))}var ex=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function tx(){const{isInProgress:e,rotateClockwise:t}=IC();return(0,c.createElement)(m.ToolbarButton,{icon:ex,label:(0,v.__)("Rotate"),onClick:t,disabled:e})}function nx(){const{isInProgress:e,apply:t,cancel:n}=IC();return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarButton,{onClick:t,disabled:e},(0,v.__)("Apply")),(0,c.createElement)(m.ToolbarButton,{onClick:n},(0,v.__)("Cancel")))}function ox({id:e,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,onSaveImage:a,onFinishEditing:s,borderProps:u}){return(0,c.createElement)(TC,{id:e,url:t,naturalWidth:i,naturalHeight:l,onSaveImage:a,onFinishEditing:s},(0,c.createElement)(qC,{borderProps:u,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,c.createElement)(dr,null,(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(YC,null),(0,c.createElement)(m.ToolbarItem,null,(e=>(0,c.createElement)(JC,{toggleProps:e}))),(0,c.createElement)(tx,null)),(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(nx,null))))}const rx=[25,50,75,100],lx=()=>{};function ix({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:s,onChangeImage:u=lx}){$()("wp.blockEditor.__experimentalImageSizeControl",{since:"6.3",alternative:"wp.blockEditor.privateApis.DimensionsTool and wp.blockEditor.privateApis.ResolutionTool"});const{currentHeight:d,currentWidth:p,updateDimension:f,updateDimensions:g}=function(e,t,n,o,r){var l,i;const[a,s]=(0,c.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,c.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,c.useEffect)((()=>{void 0===t&&void 0!==o&&s(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,c.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?s(n):d(n),r({[e]:n})},updateDimensions:(e,t)=>{d(null!=e?e:n),s(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,s);return(0,c.createElement)(c.Fragment,null,o&&o.length>0&&(0,c.createElement)(m.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Resolution"),value:l,options:o,onChange:u,help:e,size:"__unstable-large"}),r&&(0,c.createElement)("div",{className:"block-editor-image-size-control"},(0,c.createElement)(m.__experimentalHStack,{align:"baseline",spacing:"3"},(0,c.createElement)(m.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,v.__)("Width"),value:p,min:1,onChange:e=>f("width",e),size:"__unstable-large"}),(0,c.createElement)(m.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,v.__)("Height"),value:d,min:1,onChange:e=>f("height",e),size:"__unstable-large"})),(0,c.createElement)(m.__experimentalHStack,null,(0,c.createElement)(m.ButtonGroup,{"aria-label":(0,v.__)("Image size presets")},rx.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=p===o&&d===r;return(0,c.createElement)(m.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>g(r,o)},e,"%")}))),(0,c.createElement)(m.Button,{isSmall:!0,onClick:()=>g()},(0,v.__)("Reset")))))}function ax({url:e,urlLabel:t,className:n}){const o=d()(n,"block-editor-url-popover__link-viewer-url");return e?(0,c.createElement)(m.ExternalLink,{className:o,href:e},t||(0,yh.filterURLForDisplay)((0,yh.safeDecodeURI)(e))):(0,c.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:sx}=Xo(m.privateApis);function cx({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:l,...i}){let a;void 0!==l&&$()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==l&&(a=sx(l)),a=a||"bottom";const[s,u]=(0,c.useState)(!1),d=!!n&&s;return(0,c.createElement)(m.Popover,{className:"block-editor-url-popover",focusOnMount:r,placement:a,shift:!0,...i},(0,c.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,c.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,c.createElement)(m.Button,{className:"block-editor-url-popover__settings-toggle",icon:Pw,label:(0,v.__)("Link settings"),onClick:()=>{u(!s)},"aria-expanded":s})),d&&(0,c.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!d&&(0,c.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}cx.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,c.createElement)("form",{className:d()("block-editor-url-popover__link-editor",t),...r},(0,c.createElement)(Rh,{__nextHasNoMarginBottom:!0,value:o,onChange:n,autocompleteRef:e}),(0,c.createElement)(m.Button,{icon:xh,label:(0,v.__)("Apply"),type:"submit"}))},cx.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...l}){return(0,c.createElement)("div",{className:d()("block-editor-url-popover__link-viewer",e),...l},(0,c.createElement)(ax,{url:o,urlLabel:r,className:t}),n&&(0,c.createElement)(m.Button,{icon:ub,label:(0,v.__)("Edit"),onClick:n}))};var ux=cx;const dx=()=>{},px=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,c.createElement)(ux,{anchor:r,onClose:o},(0,c.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,c.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,v.__)("URL"),placeholder:(0,v.__)("Paste or type URL"),onChange:t,value:e}),(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:xh,label:(0,v.__)("Apply"),type:"submit"}))),mx=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:o,openURLInput:r,closeURLInput:l})=>{const[i,a]=(0,c.useState)(null);return(0,c.createElement)("div",{className:"block-editor-media-placeholder__url-input-container",ref:a},(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:r,isPressed:e,variant:"tertiary"},(0,v.__)("Insert from URL")),e&&(0,c.createElement)(px,{src:t,onChange:n,onSubmit:o,onClose:l,popoverAnchor:i}))};var fx=(0,m.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:l,notices:i,isAppender:s,accept:u,addToGallery:p,multiple:g=!1,handleUpload:h=!0,disableDropZone:b,disableMediaButtons:_,onError:k,onSelect:y,onCancel:E,onSelectURL:w,onToggleFeaturedImage:S,onDoubleClick:C,onFilesPreUpload:x=dx,onHTMLDrop:B,children:I,mediaLibraryButton:T,placeholder:M,style:P}){B&&$()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const N=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return t().mediaUpload}),[]),[L,R]=(0,c.useState)(""),[A,D]=(0,c.useState)(!1);(0,c.useEffect)((()=>{var t;R(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const O=e=>{R(e.target.value)},z=()=>{D(!0)},V=()=>{D(!1)},F=e=>{e.preventDefault(),L&&w&&(w(L),V())},H=n=>{if(!h)return y(n);let o;if(x(n),g)if(p){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));y(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=y;else o=([e])=>y(e);N({allowedTypes:t,filesList:n,onFileChange:o,onError:k})};async function G(e){const n=(0,a.pasteHandler)({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const o=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,o)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((r=>N({filesList:[r],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:o}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>k(e)));y(g?o:o[0])}(n)}const U=e=>{H(e.target.files)},j=null!=M?M:e=>{let{instructions:a,title:u}=r;if(N||w||(a=(0,v.__)("To edit this block, you need permission to upload media.")),void 0===a||void 0===u){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,l=o&&"image"===n,i=o&&"video"===n;void 0===a&&N&&(a=(0,v.__)("Upload a media file or pick one from your media library."),r?a=(0,v.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?a=(0,v.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(a=(0,v.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,v.__)("Media"),r?u=(0,v.__)("Audio"):l?u=(0,v.__)("Image"):i&&(u=(0,v.__)("Video")))}const p=d()("block-editor-media-placeholder",n,{"is-appender":s});return(0,c.createElement)(m.Placeholder,{icon:o,label:u,instructions:a,className:p,notices:i,onDoubleClick:C,preview:l,style:P},e,I)},W=()=>b?null:(0,c.createElement)(m.DropZone,{onFilesDrop:H,onHTMLDrop:G}),K=()=>E&&(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,v.__)("Cancel"),variant:"link",onClick:E},(0,v.__)("Cancel")),q=()=>w&&(0,c.createElement)(mx,{isURLInputVisible:A,src:L,onChangeSrc:O,onSubmitSrc:F,openURLInput:z,closeURLInput:V}),Z=()=>S&&(0,c.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,c.createElement)(m.Button,{className:"block-editor-media-placeholder__button",onClick:S,variant:"tertiary"},(0,v.__)("Use featured image")));return _?(0,c.createElement)(cg,null,W()):(0,c.createElement)(cg,{fallback:j(q())},(()=>{const n=null!=T?T:({open:e})=>(0,c.createElement)(m.Button,{variant:"tertiary",onClick:()=>{e()}},(0,v.__)("Media Library")),o=(0,c.createElement)(ug,{addToGallery:p,gallery:g&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:g,onSelect:y,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(N&&s)return(0,c.createElement)(c.Fragment,null,W(),(0,c.createElement)(m.FormFileUpload,{onChange:U,accept:u,multiple:!!g,render:({openFileDialog:e})=>{const t=(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.Button,{variant:"primary",className:d()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,v.__)("Upload")),o,q(),Z(),K());return j(t)}}));if(N){const e=(0,c.createElement)(c.Fragment,null,W(),(0,c.createElement)(m.FormFileUpload,{variant:"primary",className:d()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:u,multiple:!!g},(0,v.__)("Upload")),o,q(),Z(),K());return j(e)}return j(o)})())}));var gx=({colorSettings:e,...t})=>{const n=e.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,c.createElement)(xC,{settings:n,gradients:[],disableCustomGradients:!0,...t})};const hx={placement:"bottom-start"};var bx=()=>(0,c.createElement)(c.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,c.createElement)(m.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,c.createElement)(m.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,c.createElement)(m.ToolbarItem,null,(n=>(0,c.createElement)(m.DropdownMenu,{icon:Pw,label:(0,v.__)("More"),toggleProps:{...n,className:d()(n.className,{"is-pressed":t}),describedBy:(0,v.__)("Displays more block tools")},controls:K(e.map((([{props:e}])=>e)),"title"),popoverProps:hx})))})));function vx(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function _x(e,t,n,o,r,l){const[i]=(0,c.useState)(t),[a]=(0,c.useState)(o),s=(0,c.useCallback)((()=>{!function(e){const[t]=da.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,lp.useShortcut)("core/block-editor/focus-toolbar",(()=>{l&&s()})),(0,c.useEffect)((()=>{i&&s()}),[n,i,s]),(0,c.useEffect)((()=>{const t=e.current;let n=0;return i||(n=window.requestAnimationFrame((()=>{const e=vx(t),n=a||0;var o;e[n]&&(o=t).contains(o.ownerDocument.activeElement)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=vx(t).findIndex((e=>0===e.tabIndex));r(e)}}),[a,i])}var kx=function({children:e,focusOnMount:t,shouldUseKeyboardFocusShortcut:n=!0,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}){const i=(0,c.useRef)(),a=function(e){const[t,n]=(0,c.useState)(!0),o=(0,c.useCallback)((()=>{const t=!da.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||$()("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,c.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(i);return _x(i,t,a,o,r,n),a?(0,c.createElement)(m.Toolbar,{label:l["aria-label"],ref:i,...l},e):(0,c.createElement)(m.NavigableMenu,{orientation:"horizontal",role:"toolbar",ref:i,...l},e)};function yx({editableContentElement:e,activeFormats:t}){const n=t[t.length-1],o=n?.type,r=(0,f.useSelect)((e=>e(G.store).getFormatType(o)),[o]),l=(0,G.useAnchor)({editableContentElement:e,settings:r});return(0,c.createElement)(Ex,{popoverAnchor:l})}function Ex({popoverAnchor:e}){return(0,c.createElement)(m.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,c.createElement)(kx,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,v.__)("Format tools")},(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(bx,null))))}var wx=({inline:e,editableContentElement:t,value:n})=>{const o=(0,f.useSelect)((e=>e(Jo).getSettings().hasInlineToolbar),[]);if(e)return(0,c.createElement)(Ex,{popoverAnchor:t});if(o){const e=(0,G.getActiveFormats)(n);return(0,G.isCollapsed)(n)&&!e.length?null:(0,c.createElement)(yx,{editableContentElement:t,activeFormats:e})}return(0,c.createElement)(dr,{group:"inline"},(0,c.createElement)(bx,null))};function Sx(){const{didAutomaticChange:e,getSettings:t}=(0,f.useSelect)(Jo);return(0,p.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==Pd.DELETE&&o!==Pd.BACKSPACE&&o!==Pd.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}var Cx=window.wp.shortcode;function xx(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Bx(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Ix({allowedFormats:e,disableFormats:t}){return t?Ix.EMPTY_ARRAY:e}Ix.EMPTY_ARRAY=[];const Tx=e=>(0,Cx.regexp)(".*").test(e);function Mx({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o}){if(!n||!o)return;const{start:r=0,end:l=0}=e,i={...e,start:r,end:l},a=[],[s,c]=(0,G.split)(i),u=t.length>0;let d=-1;const p=(0,G.isEmpty)(s)&&!(0,G.isEmpty)(c);u&&(0,G.isEmpty)(s)||(a.push(o((0,G.toHTMLString)({value:s}),!p)),d+=1),u&&(a.push(...t),d+=t.length),u&&(0,G.isEmpty)(c)||a.push(o((0,G.toHTMLString)({value:c}),p));n(a,u?d:1,u?-1:0)}function Px(e){const t=(0,c.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:s,onReplace:c,onSplit:u,__unstableEmbedURLOnPaste:d,preserveWhiteSpace:p,pastePlainText:m}=t.current;if(!n)return;const{clipboardData:f}=e;let g="",h="";try{g=f.getData("text/plain"),h=f.getData("text/html")}catch(e){try{h=f.getData("Text")}catch(e){return}}if(h=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;e=e.substring(n+t.length);const o="\x3c!--EndFragment--\x3e",r=e.indexOf(o);r>-1&&(e=e.substring(0,r));return e}(h),h=function(e){const t="<meta charset='utf-8'>";if(e.startsWith(t))return e.slice(t.length);return e}(h),e.preventDefault(),window.console.log("Received HTML:\n\n",h),window.console.log("Received plain text:\n\n",g),o)return void r((0,G.insert)(l,g));const b=i.reduce(((e,{__unstablePasteRule:t})=>(t&&e===l&&(e=t(l,{html:h,plainText:g})),e)),l);if(b!==l)return void r(b);const v=[...(0,da.getFilesFromDataTransfer)(f)];if("true"===f.getData("rich-text")){const e=(0,G.create)({html:h,preserveWhiteSpace:p});return xx(e,l.activeFormats),void r((0,G.insert)(l,e))}if(m)return void r((0,G.insert)(l,(0,G.create)({text:g})));if(v?.length&&window.console.log("Received items:\n\n",v),v?.length&&!pw(v,h)){const e=(0,a.getBlockTransforms)("from"),t=v.reduce(((t,n)=>{const o=(0,a.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(c&&(0,G.isEmpty)(l)?c(t):Mx({value:l,pastedBlocks:t,onReplace:c,onSplit:u}))}let _=c&&u?"AUTO":"INLINE";"AUTO"===_&&(0,G.isEmpty)(l)&&Tx(g)&&(_="BLOCKS"),d&&(0,G.isEmpty)(l)&&(0,yh.isURL)(g.trim())&&(_="BLOCKS");const k=(0,a.pasteHandler)({HTML:h,plainText:g,mode:_,tagName:s,preserveWhiteSpace:p});if("string"==typeof k){const e=(0,G.create)({html:k});xx(e,l.activeFormats),r((0,G.insert)(l,e))}else k.length>0&&(c&&(0,G.isEmpty)(l)?c(k,k.length-1,-1):Mx({value:l,pastedBlocks:k,onReplace:c,onSplit:u}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}const Nx=["`",'"',"'","“”","‘’"];function Lx(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,f.useDispatch)(Jo),o=(0,c.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:a,onChange:c}=o.current;if("insertText"!==l)return;if((0,G.isCollapsed)(a))return;const u=(0,s.applyFilters)("blockEditor.wrapSelectionSettings",Nx).find((([e,t])=>e===i||t===i));if(!u)return;const[d,p=d]=u,m=a.start,f=a.end+d.length;let g=(0,G.insert)(a,d,m,m);g=(0,G.insert)(g,p,f,f),t(),c(g),n();const h={};for(const e in r)h[e]=r[e];h.data=p;const{ownerDocument:b}=e,{defaultView:v}=b,_=new v.InputEvent("input",h);window.queueMicrotask((()=>{r.target.dispatchEvent(_)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function Rx(e){let t=e.length;for(;t--;){const n=An(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(Rn,""),[e[t].clientId,n,0,0];const o=Rx(e[t].innerBlocks);if(o)return o}return[]}function Ax(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,f.useDispatch)(Jo),o=(0,c.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(){const{getValue:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const l=e(),{start:i,text:s}=l;if(" "!==s.slice(i-1,i))return;const c=s.slice(0,i).trim(),u=(0,a.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),d=(0,a.findTransform)(u,(({prefix:e})=>c===e));if(!d)return;const p=(0,G.toHTMLString)({value:(0,G.insert)(l,Rn,0,i)}),m=d.transform(p);return r(...Rx([m])),t([m]),n(),!0}function l(e){const{inputType:l,type:i}=e,{getValue:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;if(c&&r&&r())return;const d=a(),p=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<18||o.slice(n-18,n).toLowerCase()!==t?e:(0,G.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d));p!==d&&(t(),s({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",l),e.addEventListener("compositionend",l),()=>{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function Dx(e){const t=(0,c.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:o,onMerge:r,onRemove:l}=t.current;if(n===Pd.DELETE||n===Pd.BACKSPACE){const{start:t,end:i,text:a}=o,s=n===Pd.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,G.isCollapsed)(o)||c||s&&0!==t||!s&&i!==a.length)return;r&&r(!s),l&&(0,G.isEmpty)(o)&&s&&l(!s),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Ox(e){const t=(0,f.useRegistry)(),{__unstableMarkAutomaticChange:n}=(0,f.useDispatch)(Jo),o=(0,c.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Pd.ENTER)return;const{removeEditorOnlyFormats:r,value:l,onReplace:i,onSplit:s,onChange:c,disableLineBreaks:u,onSplitAtEnd:d,onSplitAtDoubleLineEnd:p}=o.current;e.preventDefault();const m={...l};m.formats=r(l);const f=i&&s;if(i){const e=(0,a.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),t=(0,a.findTransform)(e,(e=>e.regExp.test(m.text)));t&&(i([t.transform({content:m.text})]),n())}const{text:g,start:h,end:b}=m;e.shiftKey?u||c((0,G.insert)(m,"\n")):f?Mx({value:m,onReplace:i,onSplit:s}):d&&h===b&&b===g.length?d():p&&h===b&&b===g.length&&"\n\n"===g.slice(-2)?t.batch((()=>{m.start=m.end-2,c((0,G.remove)(m)),p()})):u||c((0,G.insert)(m,"\n"))}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function zx(e){return e(G.store).getFormatTypes()}const Vx=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Fx(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function Hx(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function Gx(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Ux(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function $x(){const{__unstableMarkLastChangeAsPersistent:e}=(0,f.useDispatch)(Jo);return(0,p.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function jx(){const{isMultiSelecting:e}=(0,f.useSelect)(Jo);return(0,p.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)}}),[])}const Wx={},Kx=Symbol("usesContext");function qx({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:l,edit:i,[Kx]:a}=r,s=(0,c.useContext)(fa),u=(0,c.useMemo)((()=>a?Object.fromEntries(Object.entries(s).filter((([e])=>a.includes(e)))):Wx),[a,s]);if(!i)return null;const d=(0,G.getActiveFormat)(n,l),p=void 0!==d,m=(0,G.getActiveObject)(n),f=void 0!==m&&m.type===l;return(0,c.createElement)(i,{key:l,isActive:p,activeAttributes:p&&d.attributes||{},isObjectActive:f,activeObjectAttributes:f&&m.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:u})}function Zx({formatTypes:e,...t}){return e.map((e=>(0,c.createElement)(qx,{settings:e,...t,key:e.name})))}const Yx=({value:e,tagName:t,multiline:n,...o})=>{Array.isArray(e)&&($()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e=a.children.toHTML(e));const r=Bx(n);!e&&r&&(e=`<${r}></${r}>`);const l=(0,c.createElement)(c.RawHTML,null,e);if(t){const{format:e,...n}=o;return(0,c.createElement)(t,{...n},l)}return l};var Xx=(0,c.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:l,...i},a){$()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:s}=rr(),{selectionChange:u}=(0,f.useDispatch)(Jo),d=Bx(l),p=`</${d}>${o=o||`<${d}></${d}>`}<${d}>`.split(`</${d}><${d}>`);function m(e){r(`<${d}>${e.join(`</${d}><${d}>`)}</${d}>`)}return p.shift(),p.pop(),(0,c.createElement)(n,{ref:a},p.map(((e,n)=>(0,c.createElement)(eB,{key:n,identifier:`${t}-${n}`,tagName:d,value:e,onChange:e=>{const t=p.slice();t[n]=e,m(t)},isSelected:void 0,onSplit:e=>e,onReplace:e=>{const o=p.slice();o.splice(n,1,...e),m(o),u(s,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=p.slice();let r=0;if(e){if(!o[n+1])return;o.splice(n,2,o[n]+o[n+1]),r=o[n].length-1}else{if(!o[n-1])return;o.splice(n-1,2,o[n-1]+o[n]),r=o[n-1].length-1}m(o),u(s,`${t}-${n-(e?0:1)}`,r,r)},...i}))))}));const Qx=(0,c.createContext)(),Jx=(0,c.createContext)();function eB({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:l,inlineToolbar:i,wrapperClassName:a,autocompleters:s,onReplace:u,placeholder:g,allowedFormats:h,withoutInteractiveFormatting:b,onRemove:v,onMerge:_,onSplit:k,__unstableOnSplitAtEnd:y,__unstableOnSplitAtDoubleLineEnd:E,identifier:w,preserveWhiteSpace:S,__unstablePastePlainText:C,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:B,disableLineBreaks:I,__unstableAllowPrefixTransformations:T,...M},P){M=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,disableEditingMenu:a,fontSize:s,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:m,setRef:f,disableSuggestions:g,disableAutocorrection:h,...b}=e;return b}(M);const N=(0,c.useRef)(),{clientId:L}=rr(),{selectionStart:R,selectionEnd:A,isSelected:D}=(0,f.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(Jo),o=t(),l=n();let i;return void 0===r?i=o.clientId===L&&l.clientId===L&&o.attributeKey===w:r&&(i=o.clientId===L),{selectionStart:i?o.offset:void 0,selectionEnd:i?l.offset:void 0,isSelected:i}})),{getSelectionStart:O,getSelectionEnd:z,getBlockRootClientId:V}=(0,f.useSelect)(Jo),{selectionChange:F}=(0,f.useDispatch)(Jo),H=Ix({allowedFormats:h,disableFormats:B}),U=!H||H.length>0,$=(0,c.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&V(L)!==V(z().clientId))return;n.start={clientId:L,attributeKey:w,offset:e}}if("number"==typeof t||o){if(void 0===e&&V(L)!==V(O().clientId))return;n.end={clientId:L,attributeKey:w,offset:t}}F(n)}),[L,w]),{formatTypes:j,prepareHandlers:W,valueHandlers:K,changeHandlers:q,dependencies:Z}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,f.useSelect)(zx,[]),l=(0,c.useMemo)((()=>r.filter((({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||Vx.has(r)))))),[r,o,n]),i=(0,f.useSelect)((n=>l.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...Fx(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[l,e,t]),a=(0,f.useDispatch)(),s=[],u=[],d=[],p=[];for(const e in i)p.push(i[e]);return l.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(Hx(i,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?u.push(o):s.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e}));const r=Hx(i,n.name);d.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:l,prepareHandlers:s,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:L,identifier:w,withoutInteractiveFormatting:b,allowedFormats:H});function Y(e){return j.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,G.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:X,getValue:Q,onChange:J,ref:ee}=(0,G.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(q).forEach((e=>{e(t,n)}))},selectionStart:R,selectionEnd:A,onSelectionChange:$,placeholder:g,__unstableIsSelected:D,__unstableDisableFormats:B,preserveWhiteSpace:S,__unstableDependencies:[...Z,t],__unstableAfterParse:function(e){return K.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:Y,__unstableAddInvisibleFormats:function(e){return W.reduce(((t,n)=>n(t,e.text)),e.formats)}}),te=function(e){return(0,m.__unstableUseAutocompleteProps)({...e,completers:ow(e)})}({onReplace:u,completers:s,record:X,onChange:J});!function({html:e,value:t}){const n=(0,c.useRef)(),o=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:r}=(0,f.useDispatch)(Jo);(0,c.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:n,value:X});const ne=(0,c.useRef)(new Set),oe=(0,c.useRef)(new Set);function re(){N.current?.focus()}const le=t;return(0,c.createElement)(c.Fragment,null,D&&(0,c.createElement)(Qx.Provider,{value:ne},(0,c.createElement)(Jx.Provider,{value:oe},(0,c.createElement)(m.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},e&&e({value:X,onChange:J,onFocus:re}),(0,c.createElement)(Zx,{value:X,onChange:J,onFocus:re,formatTypes:j,forwardedRef:N})))),D&&U&&(0,c.createElement)(wx,{inline:i,editableContentElement:N.current,value:X}),(0,c.createElement)(le,{role:"textbox","aria-multiline":!I,"aria-label":g,...M,...te,ref:(0,p.useMergeRefs)([P,te.ref,M.ref,ee,Lx({value:X,onChange:J}),Ax({getValue:Q,onChange:J,__unstableAllowPrefixTransformations:T,formatTypes:j,onReplace:u,selectionChange:F}),$x(),(0,p.useRefEffect)((e=>{function t(e){(Pd.isKeyboardEvent.primary(e,"z")||Pd.isKeyboardEvent.primary(e,"y")||Pd.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[]),Gx(ne),Ux(oe),Sx(),Px({isSelected:D,disableFormats:B,onChange:J,value:X,formatTypes:j,tagName:t,onReplace:u,onSplit:k,__unstableEmbedURLOnPaste:x,preserveWhiteSpace:S,pastePlainText:C}),Dx({value:X,onMerge:_,onRemove:v}),Ox({removeEditorOnlyFormats:Y,value:X,onReplace:u,onSplit:k,onChange:J,disableLineBreaks:I,onSplitAtEnd:y,onSplitAtDoubleLineEnd:E}),jx(),N]),contentEditable:!0,suppressContentEditableWarning:!0,className:d()("block-editor-rich-text__editable",M.className,"rich-text"),tabIndex:0===M.tabIndex?null:M.tabIndex}))}const tB=(0,c.forwardRef)(eB);const nB=(0,c.forwardRef)((function e(t,n){let o=t.value,r=t.onChange;Array.isArray(o)&&($()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),o=a.children.toHTML(t.value),r=e=>t.onChange(a.children.fromDOM((0,G.__unstableCreateElement)(document,e).childNodes)));const l=t.multiline?Xx:tB,i=(0,p.useInstanceId)(e);return(0,c.createElement)(l,{...t,identifier:t.identifier||i,value:o,onChange:r,ref:n})}));nB.Content=Yx,nB.isEmpty=e=>!e||0===e.length;var oB=nB;const rB=(0,c.forwardRef)(((e,t)=>(0,c.createElement)(oB,{ref:t,...e,__unstableDisableFormats:!0,preserveWhiteSpace:!0})));rB.Content=({value:e="",tagName:t="div",...n})=>(0,c.createElement)(t,{...n},e);var lB=rB;var iB=(0,c.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,c.createElement)(lB,{ref:n,...t});const{className:o,onChange:r,...l}=t;return(0,c.createElement)(Ma.Z,{ref:n,className:d()("block-editor-plain-text",o),onChange:e=>r(e.target.value),...l})}));function aB({property:e,viewport:t,desc:n}){const o=(0,p.useInstanceId)(aB),r=n||(0,v.sprintf)((0,v._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."),e,t.label);return(0,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{"aria-describedby":`rbc-desc-${o}`},t.label),(0,c.createElement)(m.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}var sB=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:s={id:"all",label:(0,v.__)("All")},viewports:u=[{id:"small",label:(0,v.__)("Small screens")},{id:"medium",label:(0,v.__)("Medium screens")},{id:"large",label:(0,v.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const p=o||(0,v.sprintf)((0,v.__)("Use the same %s on all screensizes."),n),f=(0,v.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),g=l((0,c.createElement)(aB,{property:n,viewport:s}),s);return(0,c.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,c.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,c.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:f}),(0,c.createElement)("div",{className:d()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&g,a&&(i?i(u):u.map((e=>(0,c.createElement)(c.Fragment,{key:e.id},l((0,c.createElement)(aB,{property:n,viewport:e}),e))))))))};function cB({character:e,type:t,onUse:n}){const o=(0,c.useContext)(Qx),r=(0,c.useRef)();return r.current=n,(0,c.useEffect)((()=>{function n(n){Pd.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function uB({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,l="RichText.ToolbarControls";return e&&(l+=`.${e}`),t&&n&&(r=Pd.displayShortcut[t](n)),(0,c.createElement)(m.Fill,{name:l},(0,c.createElement)(m.ToolbarButton,{...o,shortcut:r}))}function dB({inputType:e,onInput:t}){const n=(0,c.useContext)(Jx),o=(0,c.useRef)();return o.current=t,(0,c.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}const pB=(0,c.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,c.createElement)(m.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 mB=(0,c.forwardRef)((function(e,t){const n=(0,f.useSelect)((e=>e(Jo).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,f.useDispatch)(Jo);return(0,c.createElement)(m.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,c.createElement)(m.Button,{...e,ref:t,icon:"navigation"===n?pB:ub,"aria-expanded":o,"aria-haspopup":"true",onClick:r,label:(0,v.__)("Tools")}),popoverProps:{placement:"bottom-start",variant:void 0},renderContent:()=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.NavigableMenu,{role:"menu","aria-label":(0,v.__)("Tools")},(0,c.createElement)(m.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ai,{icon:ub}),(0,v.__)("Edit"))},{value:"navigation",label:(0,c.createElement)(c.Fragment,null,pB,(0,v.__)("Select"))}]})),(0,c.createElement)("div",{className:"block-editor-tool-selector__help"},(0,v.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function fB({units:e,...t}){const n=(0,m.__experimentalUseCustomUnits)({availableUnits:bl("spacing.units")||["%","px","em","rem","vw"],units:e});return(0,c.createElement)(m.__experimentalUnitControl,{units:n,...t})}var gB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class hB extends c.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,v.__)("Edit link"):(0,v.__)("Insert link");return(0,c.createElement)("div",{className:"block-editor-url-input__button"},(0,c.createElement)(m.Button,{icon:Wb,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,c.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,c.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,c.createElement)(m.Button,{className:"block-editor-url-input__back",icon:gB,label:(0,v.__)("Close"),onClick:this.toggle}),(0,c.createElement)(Rh,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,c.createElement)(m.Button,{icon:xh,label:(0,v.__)("Submit"),type:"submit"}))))}}var bB=hB;var vB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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 _B="none",kB="custom",yB="media",EB="attachment",wB=["noreferrer","noopener"],SB=(0,c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(m.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,c.createElement)(m.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,c.createElement)(m.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),CB=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:l,linkTarget:i,linkClass:a,rel:s})=>{const[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(null),[g,h]=(0,c.useState)(!1),[b,_]=(0,c.useState)(null),k=(0,c.useRef)(null),y=()=>{h(!1)},E=()=>{const e=[{linkDestination:yB,title:(0,v.__)("Media File"),url:"image"===o?r:void 0,icon:SB}];return"image"===o&&l&&e.push({linkDestination:EB,title:(0,v.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,c.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(m.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,c.createElement)(m.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},w=(0,c.createElement)(m.__experimentalVStack,{spacing:"3"},(0,c.createElement)(m.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=s?s:"").split(" ");wB.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=s?s:"").split(" ").filter((e=>!1===wB.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Link rel"),value:null!=s?s:"",onChange:e=>{t({rel:e})}}),(0,c.createElement)(m.TextControl,{__nextHasNoMarginBottom:!0,label:(0,v.__)("Link CSS Class"),value:a||"",onChange:e=>{t({linkClass:e})}})),S=null!==b?b:n,C=(E().find((t=>t.linkDestination===e))||{}).title;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarButton,{icon:Wb,className:"components-toolbar__control",label:n?(0,v.__)("Edit link"):(0,v.__)("Insert link"),"aria-expanded":u,onClick:()=>{d(!0)},ref:f}),u&&(0,c.createElement)(ux,{anchor:p,onFocusOutside:e=>{const t=k.current;t&&t.contains(e.target)||(d(!1),_(null),y())},onClose:()=>{_(null),y(),d(!1)},renderSettings:()=>w,additionalControls:!S&&(0,c.createElement)(m.NavigableMenu,null,E().map((e=>(0,c.createElement)(m.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const n=E();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:kB}).linkDestination:_B,t({linkDestination:o,href:e})})(e.url),y()}},e.title))))},(!n||g)&&(0,c.createElement)(ux.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:S,onChangeInputValue:_,onSubmit:e=>{if(b){const e=E().find((e=>e.url===b))?.linkDestination||kB;t({href:b,linkDestination:e})}y(),_(null),e.preventDefault()},autocompleteRef:k}),n&&!g&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ux.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==yB&&e!==EB||_(""),h(!0)},urlLabel:C}),(0,c.createElement)(m.Button,{icon:vB,label:(0,v.__)("Remove link"),onClick:()=>{t({linkDestination:_B,href:""})}}))))},{Fill:xB,Slot:BB}=(0,m.createSlotFill)("__unstableBlockToolbarLastItem");xB.Slot=BB;var IB=xB;var TB=(0,c.createContext)("");var MB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"}));var PB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"}));var NB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));function LB({children:e,viewLabel:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l,label:i}){if((0,p.useViewportMatch)("small","<"))return null;const a={className:d()(n,"block-editor-post-preview__dropdown-content"),placement:"bottom-end"},s={className:"block-editor-post-preview__button-toggle",disabled:!o,__experimentalIsFocusable:!o,children:t},u={"aria-label":(0,v.__)("View options")},f={mobile:MB,tablet:PB,desktop:NB};return(0,c.createElement)(m.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:a,toggleProps:s,menuProps:u,icon:f[r.toLowerCase()],label:i||(0,v.__)("Preview"),disableOpenOnArrowDown:!o},(t=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,null,(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&gk},(0,v.__)("Desktop")),(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&gk},(0,v.__)("Tablet")),(0,c.createElement)(m.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&gk},(0,v.__)("Mobile"))),e?.(t))))}function RB(e){const[t,n]=(0,c.useState)(window.innerWidth);(0,c.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",n=(window.innerHeight<800?36:72)+"px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var AB=(0,f.withSelect)((e=>({selectedBlockClientId:e(Jo).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=Od(e);return e?(0,c.createElement)(m.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,v.__)("Skip to the selected block")):null})),DB=window.wp.wordcount;var OB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.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"}));var zB=(0,f.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Jo);return{blocks:t()}}))((function({blocks:e}){const t=(0,DB.count)((0,a.serialize)(e),"words");return(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,c.createElement)(ep,{icon:OB,showColors:!0}),(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,v.sprintf)((0,v._n)("%d Block","%d Blocks",e.length),e.length)),(0,c.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,v.sprintf)((0,v._n)("%d word selected.","%d words selected.",t),t))))}));function VB({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,f.useSelect)((t=>{var n;const o=t(Jo).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:o?.value?.[e],onUpdatePreferredStyleVariations:null!==(n=o?.onChange)&&void 0!==n?n:null,styles:t(a.store).getBlockStyles(e)}}),[e]),r=(0,c.useMemo)((()=>[{label:(0,v.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),l=(0,c.useMemo)((()=>VS(o)?.name),[o]),i=(0,c.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==l?n&&(0,c.createElement)("div",{className:"default-style-picker__default-switcher"},(0,c.createElement)(m.SelectControl,{__nextHasNoMarginBottom:!0,options:r,value:t||"",label:(0,v.__)("Default Style"),onChange:i})):null}var FB=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var HB=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const GB={name:"settings",title:(0,v.__)("Settings"),value:"settings",icon:FB,className:"block-editor-block-inspector__tab-item"},UB={name:"styles",title:(0,v.__)("Styles"),value:"styles",icon:HB,className:"block-editor-block-inspector__tab-item"},$B={name:"list",title:(0,v.__)("List View"),value:"list-view",icon:Ew,className:"block-editor-block-inspector__tab-item"};var jB=()=>{const e=(0,m.__experimentalUseSlotFills)(ra.slotName);return Boolean(e&&e.length)?(0,c.createElement)(m.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,v.__)("Advanced"),initialOpen:!1},(0,c.createElement)(la.Slot,{group:"advanced"})):null};const WB=()=>{const[e,t]=(0,c.useState)(),{multiSelectedBlocks:n}=(0,f.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(Jo);return{multiSelectedBlocks:t(n())}}),[]);return(0,c.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,c.createElement)(m.PanelBody,{className:"block-editor-block-inspector__position",title:(0,v.__)("Position"),initialOpen:null!=e&&e},(0,c.createElement)(la.Slot,{group:"position"}))};var KB=()=>{const e=(0,m.__experimentalUseSlotFills)(Yi.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,c.createElement)(WB,null):null};const qB="isInspectorControlsTabsHintVisible";function ZB(){const e=(0,f.useSelect)((e=>{var t;return null===(t=e(Ch.store).get("core",qB))||void 0===t||t}),[]),t=(0,c.useRef)(),{set:n}=(0,f.useDispatch)(Ch.store);return e?(0,c.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,c.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,v.__)("Looking for other block settings? They've moved to the styles tab.")),(0,c.createElement)(m.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:vB,iconSize:"16",label:(0,v.__)("Dismiss hint"),onClick:()=>{const e=da.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",qB,!1)},showTooltip:!1})):null}var YB=({showAdvancedControls:e=!1})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)(la.Slot,null),(0,c.createElement)(KB,null),e&&(0,c.createElement)("div",null,(0,c.createElement)(jB,null)),(0,c.createElement)(ZB,null));var XB=({blockName:e,clientId:t,hasBlockStyles:n})=>(0,c.createElement)(c.Fragment,null,n&&(0,c.createElement)("div",null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Styles")},(0,c.createElement)($S,{clientId:t}),(0,a.hasBlockSupport)(e,"defaultStylePicker",!0)&&(0,c.createElement)(VB,{blockName:e}))),(0,c.createElement)(la.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(la.Slot,{group:"background",label:(0,v.__)("Background")}),(0,c.createElement)(la.Slot,{group:"filter"}),(0,c.createElement)(la.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(la.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(la.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(la.Slot,{group:"styles"}));const QB=["core/navigation"];var JB=e=>!QB.includes(e);function eI({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=JB(e)?void 0:$B.name;return(0,c.createElement)(m.TabPanel,{className:"block-editor-block-inspector__tabs",tabs:o,initialTabName:r,key:t},(o=>o.name===GB.name?(0,c.createElement)(YB,{showAdvancedControls:!!e}):o.name===UB.name?(0,c.createElement)(XB,{blockName:e,clientId:t,hasBlockStyles:n}):o.name===$B.name?(0,c.createElement)(la.Slot,{group:"list"}):void 0))}const tI=[];function nI(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:a,styles:s,typography:c}=Yi,u=JB(e),d=(0,m.__experimentalUseSlotFills)(i.Slot.__unstableName),p=!u&&!!d&&d.length,g=[...(0,m.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,h=(0,m.__experimentalUseSlotFills)(ra.slotName)||[],b=[...(0,m.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,m.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...p&&g>1?h:[]];p&&t.push($B),b.length&&t.push(GB),g&&t.push(UB);const v=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,f.useSelect)((e=>e(Jo).getSettings().blockInspectorTabs),[]));return v?t:tI}const{createPrivateSlotFill:oI}=Xo(m.privateApis),{Fill:rI,Slot:lI}=oI("BlockInformation"),iI=e=>lr()?(0,c.createElement)(rI,{...e}):null;iI.Slot=e=>(0,c.createElement)(lI,{...e});var aI=iI;function sI({clientIds:e}){return e.length?(0,c.createElement)(m.__experimentalVStack,{spacing:1},e.map((e=>(0,c.createElement)(cI,{key:e,clientId:e})))):null}function cI({clientId:e}){const{name:t,icon:n,isSelected:o}=(0,f.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o,isBlockSelected:r,hasSelectedInnerBlock:l}=t(Jo),{getBlockType:i}=t(a.store),s=i(n(e)),c=o(e);return{name:s&&(0,a.__experimentalGetBlockLabel)(s,c,"list-view"),icon:s?.icon,isSelected:r(e)||l(e,!0)}}),[e]),{selectBlock:r}=(0,f.useDispatch)(Jo);return(0,c.createElement)(m.Button,{isPressed:o,onClick:()=>r(e)},(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(ep,{icon:n}),(0,c.createElement)(m.FlexItem,null,t)))}function uI({topLevelLockedBlock:e}){const t=(0,f.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=t(Jo);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=Iy(e);return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(tp,{...n,className:n.isSynced&&"is-synced"}),(0,c.createElement)(dC,{blockClientId:e}),(0,c.createElement)(aI.Slot,null),(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Content")},(0,c.createElement)(sI,{clientIds:t})))}const dI=({animate:e,wrapper:t,children:n})=>e?t(n):n,pI=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,c.createElement)(m.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:t},n)},mI=({clientId:e,blockName:t})=>{const n=nI(t),o=n?.length>1,r=(0,f.useSelect)((e=>{const{getBlockStyles:n}=e(a.store),o=n(t);return o&&o.length>0}),[t]),l=Iy(e);return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(tp,{...l,className:l.isSynced&&"is-synced"}),(0,c.createElement)(dC,{blockClientId:e}),(0,c.createElement)(aI.Slot,null),o&&(0,c.createElement)(eI,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,c.createElement)(c.Fragment,null,r&&(0,c.createElement)("div",null,(0,c.createElement)(m.PanelBody,{title:(0,v.__)("Styles")},(0,c.createElement)($S,{clientId:e}),(0,a.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,c.createElement)(VB,{blockName:t}))),(0,c.createElement)(la.Slot,null),(0,c.createElement)(la.Slot,{group:"list"}),(0,c.createElement)(la.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(la.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(la.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(la.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(la.Slot,{group:"styles"}),(0,c.createElement)(la.Slot,{group:"background",label:(0,v.__)("Background")}),(0,c.createElement)(KB,null),(0,c.createElement)("div",null,(0,c.createElement)(jB,null))),(0,c.createElement)(AB,{key:"back"}))};var fI=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:l}=(0,f.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e(Jo),i=t(),s=i&&o(i),c=s&&(0,a.getBlockType)(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:c,topLevelLockedBlock:r(i)||("contentOnly"===l(i)?i:void 0)}}),[]),i=nI(r?.name),s=i?.length>1,u=function(e,t){return(0,f.useSelect)((t=>{if(e){const n=t(Jo).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:l}=t(Jo);return l(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[t,e])}(r,o);if(t>1)return(0,c.createElement)("div",{className:"block-editor-block-inspector"},(0,c.createElement)(zB,null),s?(0,c.createElement)(eI,{tabs:i}):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(la.Slot,null),(0,c.createElement)(la.Slot,{group:"color",label:(0,v.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,c.createElement)(la.Slot,{group:"typography",label:(0,v.__)("Typography")}),(0,c.createElement)(la.Slot,{group:"dimensions",label:(0,v.__)("Dimensions")}),(0,c.createElement)(la.Slot,{group:"border",label:(0,v.__)("Border")}),(0,c.createElement)(la.Slot,{group:"styles"})));const d=n===(0,a.getUnregisteredTypeHandlerName)();return r&&o&&!d?l?(0,c.createElement)(uI,{topLevelLockedBlock:l}):(0,c.createElement)(dI,{animate:u,wrapper:e=>(0,c.createElement)(pI,{blockInspectorAnimationSettings:u,selectedBlockClientId:o},e)},(0,c.createElement)(mI,{clientId:o,blockName:r.name})):e?(0,c.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,v.__)("No block selected.")):null};var gI=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:o,isFirst:r,isLast:l,orientation:i}=(0,f.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:l,getBlockRootClientId:i}=t(Jo),a=Array.isArray(e)?e:[e],s=a[0],c=i(s),u=n(s),d=n(a[a.length-1]),p=l(c);return{canMove:r(e,c),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:o(c)?.orientation}}),[e]);if(!n||r&&l&&!o)return null;const a=(0,v.__)("Drag");return(0,c.createElement)(m.ToolbarGroup,{className:d()("block-editor-block-mover",{"is-horizontal":"horizontal"===i})},!t&&(0,c.createElement)(Ww,{clientIds:e},(e=>(0,c.createElement)(m.Button,{icon:Fm,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:a,tabIndex:"-1",...e}))),(0,c.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,c.createElement)(m.ToolbarItem,null,(t=>(0,c.createElement)(Ow,{clientIds:e,...t}))),(0,c.createElement)(m.ToolbarItem,null,(t=>(0,c.createElement)(zw,{clientIds:e,...t})))))};var hI=function({clientIds:e,...t}){return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarItem,null,(n=>(0,c.createElement)(NS,{clientIds:e,toggleProps:n,...t}))))};function bI(){const{selectBlock:e}=(0,f.useDispatch)(Jo),{firstParentClientId:t,isVisible:n}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getBlockEditingMode:r}=e(Jo),{hasBlockSupport:l}=e(a.store),i=n(o()),s=i[i.length-1],c=t(s),u=(0,a.getBlockType)(c);return{firstParentClientId:s,isVisible:s&&"default"===r(s)&&l(u,"__experimentalParentSelector",!0)}}),[]),o=Iy(t),r=(0,c.useRef)(),l=IS({ref:r,highlightParent:!0});return n?(0,c.createElement)("div",{className:"block-editor-block-parent-selector",key:t,ref:r,...l},(0,c.createElement)(m.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,v.sprintf)((0,v.__)("Select %s"),o?.title),showTooltip:!0,icon:(0,c.createElement)(ep,{icon:o?.icon})})):null}function vI({blocks:e}){return(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,c.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,v.__)("Preview")),(0,c.createElement)(Am,{viewportWidth:500,blocks:e})))))}const _I={};function kI({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l}=e;return(0,c.createElement)(m.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,c.createElement)(ep,{icon:r,showColors:!0}),l)}var yI=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,c.useState)();return(0,c.createElement)(c.Fragment,null,o&&(0,c.createElement)(vI,{blocks:(0,a.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,c.createElement)(kI,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:r}))))};function EI({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,c.createElement)(wI,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:n})))}function wI({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:l,isDisabled:i}=e;return(0,c.createElement)(m.MenuItem,{className:(0,a.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:i,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,c.createElement)(ep,{icon:r,showColors:!0}),l)}var SI=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:l})=>{const[i,s]=(0,c.useState)(),{priorityTextTransformations:u,restTransformations:d}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,c.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:o}=t;return n.includes(o)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),p=u.length&&d.length,f=!!d.length&&(0,c.createElement)(EI,{restTransformations:d,onSelect:o,setHoveredTransformItemName:s});return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Transform to"),className:e},i&&(0,c.createElement)(vI,{blocks:(0,a.switchToBlockType)(l,i)}),!!n?.length&&(0,c.createElement)(yI,{transformations:n,blocks:l,onSelect:r}),u.map((e=>(0,c.createElement)(wI,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:s}))),!p&&f),!!p&&(0,c.createElement)(m.MenuGroup,{className:e},f))};const CI=()=>{};function xI({clientId:e,onSwitch:t=CI}){const{onSelect:n,stylesToRender:o,activeStyle:r}=HS({clientId:e,onSwitch:t});return o&&0!==o.length?(0,c.createElement)(c.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,c.createElement)(m.MenuItem,{key:e.name,icon:r.name===e.name?gk:null,onClick:()=>n(e)},(0,c.createElement)(m.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function BI({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,c.createElement)(m.MenuGroup,{label:(0,v.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,c.createElement)(xI,{clientId:n,onSwitch:t}))}const II=(e,t,n=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=II(e,t,n);if(o)return o}}},TI=(e,t)=>{const n=((e,t)=>{const n=(0,a.__experimentalGetBlockAttributesNamesByRole)(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};var MI=(e,t)=>(0,c.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,a.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=II(r,t.name,o);if(n){e=!0,o.add(n.clientId),TI(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]);function PI({patterns:e,onSelect:t}){return(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,c.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,c.createElement)(m.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,c.createElement)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview"},(0,c.createElement)(NI,{patterns:e,onSelect:t})))))}function NI({patterns:e,onSelect:t}){const n=(0,m.__unstableUseCompositeState)();return(0,c.createElement)(m.__unstableComposite,{...n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,v.__)("Patterns list")},e.map((e=>(0,c.createElement)(LI,{key:e.name,pattern:e,onSelect:t,composite:n}))))}function LI({pattern:e,onSelect:t,composite:n}){const o="block-editor-block-switcher__preview-patterns-container",r=(0,p.useInstanceId)(LI,`${o}-list__item-description`);return(0,c.createElement)("div",{className:`${o}-list__list-item`},(0,c.createElement)(m.__unstableCompositeItem,{role:"option",as:"div",...n,"aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`,onClick:()=>t(e.transformedBlocks)},(0,c.createElement)(Am,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,c.createElement)("div",{className:`${o}-list__item-title`},e.title)),!!e.description&&(0,c.createElement)(m.VisuallyHidden,{id:r},e.description))}var RI=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,c.useState)(!1),l=MI(t,e);return l.length?(0,c.createElement)(m.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,c.createElement)(PI,{patterns:l,onSelect:n}),(0,c.createElement)(m.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Xd},(0,v.__)("Patterns"))):null};const AI=({clientIds:e,blocks:t})=>{const{replaceBlocks:n,multiSelect:o,updateBlockAttributes:r}=(0,f.useDispatch)(Jo),l=Iy(t[0].clientId),{possibleBlockTransformations:i,canRemove:s,hasBlockStyles:u,icon:d,patterns:p}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:i,canRemoveBlocks:s}=n(Jo),{getBlockStyles:c,getBlockType:u}=n(a.store),d=o(Array.isArray(e)?e[0]:e),[{name:p}]=t,m=1===t.length,f=m&&c(p);let g;if(m)g=l?.icon;else{g=1===new Set(t.map((({name:e})=>e))).size?u(p)?.icon:OB}return{possibleBlockTransformations:r(t,d),canRemove:s(e,d),hasBlockStyles:!!f?.length,icon:g,patterns:i(t,d)}}),[e,t,l?.icon]),g=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getBlockAttributes:r,canRemoveBlocks:l}=n(Jo),{getActiveBlockVariation:i,getBlockVariations:s}=n(a.store),c=o(Array.isArray(e)?e[0]:e),u=l(e,c);if(1!==t.length||!u)return _I;const[d]=t;return{blockVariationTransformations:s(d.name,"transform"),activeBlockVariation:i(d.name,r(d.clientId))}}),[e,t]);return(0,c.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:e,blocks:t}),h=cw({clientId:Array.isArray(e)?e[0]:e,maximumLength:35}),b=1===t.length&&(0,a.isReusableBlock)(t[0]),_=1===t.length&&(0,a.isTemplatePart)(t[0]);function k(e){e.length>1&&o(e[0].clientId,e[e.length-1].clientId)}const y=!!i.length&&s&&!_,E=!!g?.length,w=!!p?.length&&s;if(!u&&!y&&!E)return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:h,icon:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ep,{icon:d,showColors:!0}),(b||_)&&(0,c.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h))}));const S=h,C=1===t.length?(0,v.sprintf)((0,v.__)("%s: Change block type or style"),h):(0,v.sprintf)((0,v._n)("Change type of %d block","Change type of %d blocks",t.length),t.length),x=y||E,B=u||x||w;return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarItem,null,(o=>(0,c.createElement)(m.DropdownMenu,{className:"block-editor-block-switcher",label:S,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(ep,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(b||_)&&(0,c.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},h)),toggleProps:{describedBy:C,...o},menuProps:{orientation:"both"}},(({onClose:o})=>B&&(0,c.createElement)("div",{className:"block-editor-block-switcher__container"},w&&(0,c.createElement)(RI,{blocks:t,patterns:p,onSelect:t=>{!function(t){n(e,t),k(t)}(t),o()}}),x&&(0,c.createElement)(SI,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:g,blocks:t,onSelect:r=>{!function(o){const r=(0,a.switchToBlockType)(t,o);n(e,r),k(r)}(r),o()},onSelectVariation:e=>{!function(e){r(t[0].clientId,{...g.find((({name:t})=>t===e)).attributes})}(e),o()}}),u&&(0,c.createElement)(BI,{hoveredBlock:t[0],onSwitch:o})))))))};var DI=({clientIds:e})=>{const t=(0,f.useSelect)((t=>t(Jo).getBlocksByClientId(e)),[e]);return!t.length||t.some((e=>!e))?null:(0,c.createElement)(AI,{clientIds:e,blocks:t})};function OI({clientId:e,wrapperRef:t}){const{canEdit:n,canMove:o,canRemove:r,canLock:l}=Qy(e),[i,a]=(0,c.useReducer)((e=>!e),!1),s=(0,c.useRef)(null),u=(0,c.useRef)(!0),d=!l||n&&o&&r;return(0,c.useEffect)((()=>{u.current?u.current=!1:!i&&d&&da.focus.focusable.find(t.current,{sequential:!1}).find((e=>"BUTTON"===e.tagName&&e!==s.current))?.focus()}),[i,d,t]),d?null:(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,c.createElement)(m.ToolbarButton,{ref:s,icon:tE,label:(0,v.__)("Unlock"),onClick:a,"aria-expanded":i,"aria-haspopup":"dialog"})),i&&(0,c.createElement)(rE,{clientId:e,onClose:a}))}var zI=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.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 VI=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"}));var FI=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"}));const HI={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var GI=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Yy(),{replaceBlocks:r}=(0,f.useDispatch)(Jo),{canRemove:l,variations:i}=(0,f.useSelect)((e=>{const{canRemoveBlocks:o}=e(Jo),{getBlockVariations:r}=e(a.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),s=o=>{const l=(0,a.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),l&&l.length>0&&(l[0].attributes.layout=HI[o],r(t,l))};if(!o||!l)return null;const u=!!i.find((({name:e})=>"group-row"===e)),d=!!i.find((({name:e})=>"group-stack"===e));return(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{icon:zI,label:(0,v._x)("Group","verb"),onClick:s}),u&&(0,c.createElement)(m.ToolbarButton,{icon:VI,label:(0,v._x)("Row","single horizontal line"),onClick:()=>s("row")}),d&&(0,c.createElement)(m.ToolbarButton,{icon:FI,label:(0,v._x)("Stack","verb"),onClick:()=>s("stack")}))};function UI({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,f.useSelect)((e=>!!t&&"html"===e(Jo).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,f.useDispatch)(Jo);return n?(0,c.createElement)(m.ToolbarGroup,null,(0,c.createElement)(m.ToolbarButton,{onClick:()=>{o(t)}},(0,v.__)("Edit visually"))):null}var $I=({hideDragHandle:e})=>{const{blockClientIds:t,blockType:n,isValid:o,isVisual:r,blockEditingMode:l}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:r,getBlockRootClientId:l,getBlockEditingMode:i}=e(Jo),s=o(),c=s[0],u=l(c);return{blockClientIds:s,blockType:c&&(0,a.getBlockType)(t(c)),rootClientId:u,isValid:s.every((e=>r(e))),isVisual:s.every((e=>"visual"===n(e))),blockEditingMode:i(c)}}),[]),i=(0,c.useRef)(null),s=(0,c.useRef)(),u=IS({ref:s}),g=!(0,p.useViewportMatch)("medium","<");if(n&&!(0,a.hasBlockSupport)(n,"__experimentalToolbar",!0))return null;if(0===t.length)return null;const h=o&&r,b=t.length>1,v=(0,a.isReusableBlock)(n)||(0,a.isTemplatePart)(n),_=d()("block-editor-block-toolbar",{"is-synced":v});return(0,c.createElement)("div",{className:_,ref:i},!b&&g&&"default"===l&&(0,c.createElement)(bI,null),(h||b)&&"default"===l&&(0,c.createElement)("div",{ref:s,...u},(0,c.createElement)(m.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,c.createElement)(DI,{clientIds:t}),!b&&(0,c.createElement)(OI,{clientId:t[0],wrapperRef:i}),(0,c.createElement)(gI,{clientIds:t,hideDragHandle:e}))),h&&b&&(0,c.createElement)(GI,null),h&&(0,c.createElement)(c.Fragment,null,(0,c.createElement)(dr.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(dr.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(dr.Slot,{className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(dr.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(dr.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,c.createElement)(TB.Provider,{value:n?.name},(0,c.createElement)(IB.Slot,null))),(0,c.createElement)(UI,{clientIds:t}),"default"===l&&(0,c.createElement)(hI,{clientIds:t}))};var jI=function({clientId:e,rootClientId:t}){const n=Iy(e),o=(0,f.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:l,getBlockListSettings:i,__unstableGetEditorMode:a}=n(Jo),s=r(e),{name:c,attributes:u}=o(e);return{index:s,name:c,attributes:u,blockMovingMode:l(),orientation:i(t)?.orientation,editorMode:a()}}),[e,t]),{index:r,name:l,attributes:i,blockMovingMode:s,orientation:u,editorMode:p}=o,{setNavigationMode:g,removeBlock:h}=(0,f.useDispatch)(Jo),b=(0,c.useRef)(),_=(0,a.getBlockType)(l),k=(0,a.__experimentalGetAccessibleBlockLabel)(_,i,r+1,u);(0,c.useEffect)((()=>{b.current.focus(),(0,Ln.speak)(k)}),[k]);const y=zd(e),{hasBlockMovingClientId:E,getBlockIndex:w,getBlockRootClientId:S,getClientIdsOfDescendants:C,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:B,getPreviousBlockClientId:I,getNextBlockClientId:T}=(0,f.useSelect)(Jo),{selectBlock:M,clearSelectedBlock:P,setBlockMovingClientId:N,moveBlockToPosition:L}=(0,f.useDispatch)(Jo),R=d()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),A=(0,v.__)("Drag");return(0,c.createElement)("div",{className:R},(0,c.createElement)(m.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(ep,{icon:n?.icon,showColors:!0})),(0,c.createElement)(m.FlexItem,null,"zoom-out"===p&&(0,c.createElement)(gI,{clientIds:[e],hideDragHandle:!0}),"navigation"===p&&(0,c.createElement)(Ww,{clientIds:[e]},(e=>(0,c.createElement)(m.Button,{icon:Fm,className:"block-selection-button_drag-handle","aria-hidden":"true",label:A,tabIndex:"-1",...e})))),(0,c.createElement)(m.FlexItem,null,(0,c.createElement)(m.Button,{ref:b,onClick:"navigation"===p?()=>g(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===Pd.UP,r=n===Pd.DOWN,l=n===Pd.LEFT,i=n===Pd.RIGHT,a=n===Pd.TAB,s=n===Pd.ESCAPE,c=n===Pd.ENTER,u=n===Pd.SPACE,d=t.shiftKey;if(n===Pd.BACKSPACE||n===Pd.DELETE)return h(e),void t.preventDefault();const p=x(),m=B(),f=I(m||p),g=T(m||p),b=a&&d||o,v=a&&!d||r,_=l,k=i;let R;if(b)R=f;else if(v)R=g;else if(_){var A;R=null!==(A=S(p))&&void 0!==A?A:p}else if(k){var D;R=null!==(D=C(p)[0])&&void 0!==D?D:p}const O=E();if(s&&O&&!t.defaultPrevented&&(N(null),t.preventDefault()),(c||u)&&O){const e=S(O),t=S(p),n=w(O);let o=w(p);n<o&&e===t&&(o-=1),L(O,e,t,o),M(O),N(null)}if((!O||p!==O||!k)&&(v||b||_||k))if(R)t.preventDefault(),M(R);else if(a&&p){let e;if(v){e=y;do{e=da.focus.tabbable.findNext(e)}while(e&&y.contains(e));e||(e=y.ownerDocument.defaultView.frameElement,e=da.focus.tabbable.findNext(e))}else e=da.focus.tabbable.findPrevious(y);e&&(t.preventDefault(),e.focus(),P())}},label:k,showTooltip:!1,className:"block-selection-button_select-button"},(0,c.createElement)(uw,{clientId:e,maximumLength:35})))))};var WI=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"}));var KI=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"}));function qI(e="default"){const t=g[e]?.Slot,n=(0,m.__experimentalUseSlotFills)(t?.__unstableName);return t?!!n?.length:null}var ZI=function({focusOnMount:e,isFixed:t,...n}){const[o,r]=(0,c.useState)(!1),l=(0,c.useRef)(),i=(0,p.useViewportMatch)("medium"),{blockType:s,blockEditingMode:u,hasParents:h,showParentSelector:b,selectedBlockClientId:_}=(0,f.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o,getBlockEditingMode:r}=e(Jo),{getBlockType:l}=e(a.store),i=o(),s=i[0],c=n(s),u=c[c.length-1],d=l(t(u));return{selectedBlockClientId:s,blockType:s&&l(t(s)),blockEditingMode:r(s),hasParents:c.length,showParentSelector:d&&"default"===r(u)&&(0,a.hasBlockSupport)(d,"__experimentalParentSelector",!0)&&i.length<=1&&"default"===r(s)}}),[]);(0,c.useEffect)((()=>{r(!1)}),[_]);const k=(0,p.useViewportMatch)("large",">="),y=document.body.classList.contains("is-fullscreen-mode");(0,c.useLayoutEffect)((()=>{if(!t)return;const e=document.querySelector(".block-editor-block-contextual-toolbar");if(!e)return;if(!s)return void(e.style.width="initial");if(!k)return void(e.style={});if(o)return void(e.style.width="auto");const n=document.querySelector(".edit-post-header__settings, .edit-widgets-header__actions"),r=document.querySelector(".edit-site-header-edit-mode__end"),l=window.getComputedStyle(e),i=!!n&&window.getComputedStyle(n),a=!!r&&window.getComputedStyle(r),c=parseFloat(l.marginLeft),u=i?parseFloat(i.width):0,d=a?parseFloat(a.width):0;e.style.width=`calc(100% - ${d+u+c+(n||r?2:0)+(y?0:160)}px)`}),[t,k,o,y,s]);const E=!s||(0,a.hasBlockSupport)(s,"__experimentalToolbar",!0),w=function(){let e=!1;for(const t in g)qI(t)&&(e=!0);return e}();if(!E||"default"!==u&&!w)return null;const S=d()("block-editor-block-contextual-toolbar",{"has-parent":h&&b,"is-fixed":t,"is-collapsed":o});return(0,c.createElement)(kx,{focusOnMount:e,className:S,"aria-label":(0,v.__)("Block tools"),...n},!o&&(0,c.createElement)($I,{hideDragHandle:t}),t&&i&&s&&(0,c.createElement)(m.ToolbarGroup,{className:o?"block-editor-block-toolbar__group-expand-fixed-toolbar":"block-editor-block-toolbar__group-collapse-fixed-toolbar"},(0,c.createElement)(m.ToolbarItem,{as:m.ToolbarButton,ref:l,icon:o?WI:KI,onClick:()=>{r((e=>!e)),l.current.focus()},label:o?(0,v.__)("Show block tools"):(0,v.__)("Hide block tools")})))};const YI={placement:"top-start"},XI={...YI,flip:!1,shift:!0},QI={...YI,flip:!0,shift:!1};function JI(e,t,n,o,r){if(!e||!t)return XI;const l=n?.scrollTop||0,i=t.getBoundingClientRect(),a=l+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+o,u=i.top>c,d=i.height>s-o;return r||!u&&!d?QI:XI}function eT(){const e=(0,p.useViewportMatch)("medium"),{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:o}=(0,f.useSelect)((t=>{const{__unstableGetEditorMode:n,isMultiSelecting:o,isTyping:r,isBlockInterfaceHidden:l,getBlock:i,getSettings:s,isNavigationMode:c,getSelectedBlockClientId:u,getFirstMultiSelectedBlockClientId:d}=Xo(t(Jo)),p="edit"===n(),m=s().hasFixedToolbar,f=s().isDistractionFree,g=d()||u(),h=!!g,b=(0,a.isUnmodifiedDefaultBlock)(i(g)||{}),v=p&&!m&&(!f||c())&&e&&!o()&&!r()&&h&&!b&&!l();return{shouldShowContextualToolbar:v,canFocusHiddenToolbar:p&&h&&!v&&!m&&!f&&!b,fixedToolbarCanBeFocused:(m||!e)&&g}}),[e]);return{shouldShowContextualToolbar:t,canFocusHiddenToolbar:n,fixedToolbarCanBeFocused:o}}function tT(e){const{__unstableGetEditorMode:t,hasMultiSelection:n,isTyping:o,getLastMultiSelectedBlockClientId:r}=e(Jo);return{editorMode:t(),hasMultiSelection:n(),isTyping:o(),lastClientId:n()?r():null}}function nT({clientId:e,rootClientId:t,isEmptyDefaultBlock:n,capturingClientId:o,__unstablePopoverSlot:r,__unstableContentRef:l}){const{editorMode:i,hasMultiSelection:a,isTyping:s,lastClientId:u}=(0,f.useSelect)(tT,[]),m=(0,f.useSelect)((t=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=t(Jo);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===e}),[e]),g=(0,c.useRef)(!1),{shouldShowContextualToolbar:h,canFocusHiddenToolbar:b}=eT(),{stopTyping:v}=(0,f.useDispatch)(Jo),_=!s&&"edit"===i&&n,k=!a&&("navigation"===i||"zoom-out"===i);(0,lp.useShortcut)("core/block-editor/focus-toolbar",(()=>{g.current=!0,v(!0)}),{isDisabled:!b}),(0,c.useEffect)((()=>{g.current=!1}));const y=(0,c.useRef)();(0,c.useEffect)((()=>{y.current=void 0}),[e]);const E=function({contentElement:e,clientId:t}){const n=zd(t),[o,r]=(0,c.useState)(0),{blockIndex:l,isSticky:i}=(0,f.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(Jo);return{blockIndex:n(t),isSticky:Oy(o(t))}}),[t]),a=(0,c.useMemo)((()=>{if(e)return(0,da.getScrollContainer)(e)}),[e]),[s,u]=(0,c.useState)((()=>JI(e,n,a,o,i))),d=(0,p.useRefEffect)((e=>{r(e.offsetHeight)}),[]),m=(0,c.useCallback)((()=>u(JI(e,n,a,o,i))),[e,n,a,o]);return(0,c.useLayoutEffect)(m,[l,m]),(0,c.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let o;t?.addEventHandler?.("resize",m);const r=n?.ownerDocument?.defaultView;return r.ResizeObserver&&(o=new r.ResizeObserver(m),o.observe(n)),()=>{t?.removeEventHandler?.("resize",m),o&&o.disconnect()}}),[m,e,n]),{...s,ref:d}}({contentElement:l?.current,clientId:e});return _?(0,c.createElement)(Vg,{clientId:o||e,__unstableCoverTarget:!0,bottomClientId:u,className:d()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":m}),__unstablePopoverSlot:r,__unstableContentRef:l,resize:!1,shift:!1,...E},(0,c.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,c.createElement)(Ig,{position:"bottom right",rootClientId:t,clientId:e,__experimentalIsQuick:!0}))):k||h?(0,c.createElement)(Vg,{clientId:o||e,bottomClientId:u,className:d()("block-editor-block-list__block-popover",{"is-insertion-point-visible":m}),__unstablePopoverSlot:r,__unstableContentRef:l,resize:!1,...E},h&&(0,c.createElement)(ZI,{focusOnMount:g.current,__experimentalInitialIndex:y.current,__experimentalOnIndexChange:e=>{y.current=e},key:e}),k&&(0,c.createElement)(jI,{clientId:e,rootClientId:t})):null}function oT(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:r,getBlockParents:l,__experimentalGetBlockListSettingsForBlocks:i}=e(Jo),s=t()||n();if(!s)return;const{name:c,attributes:u={}}=r(s)||{},d=l(s),p=i(d),m=d.find((e=>p[e]?.__experimentalCaptureToolbars));return{clientId:s,rootClientId:o(s),name:c,isEmptyDefaultBlock:c&&(0,a.isUnmodifiedDefaultBlock)({name:c,attributes:u}),capturingClientId:m}}function rT({__unstablePopoverSlot:e,__unstableContentRef:t}){const n=(0,f.useSelect)(oT,[]);if(!n)return null;const{clientId:o,rootClientId:r,name:l,isEmptyDefaultBlock:i,capturingClientId:a}=n;return l?(0,c.createElement)(nT,{clientId:o,rootClientId:r,isEmptyDefaultBlock:i,capturingClientId:a,__unstablePopoverSlot:e,__unstableContentRef:t}):null}var lT=function({__unstableContentRef:e}){const[t,n]=(0,c.useState)(!1),o=(0,f.useSelect)((e=>e(Jo).getBlockOrder()),[]);return(0,c.useEffect)((()=>{const e=setTimeout((()=>{n(!0)}),500);return()=>{clearTimeout(e)}}),[]),t?o.map(((t,n)=>n===o.length-1?null:(0,c.createElement)(Og,{key:t,previousClientId:t,nextClientId:o[n+1],__unstableContentRef:e},(0,c.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,c.createElement)(Ig,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function iT(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:o}=e(Jo);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:o()}}function aT({children:e,__unstableContentRef:t,...n}){const o=(0,p.useViewportMatch)("medium"),{hasFixedToolbar:r,isZoomOutMode:l,isTyping:i}=(0,f.useSelect)(iT,[]),a=(0,lp.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:s,getBlockRootClientId:u}=(0,f.useSelect)(Jo),{duplicateBlocks:d,removeBlocks:g,insertAfterBlock:h,insertBeforeBlock:b,clearSelectedBlock:v,selectBlock:_,moveBlocksUp:k,moveBlocksDown:y}=(0,f.useDispatch)(Jo);const E=Ag(t),w=Ag(t);return(0,c.createElement)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)){const t=s();if(t.length){e.preventDefault();const n=u(t[0]);k(t,n)}}else if(a("core/block-editor/move-down",e)){const t=s();if(t.length){e.preventDefault();const n=u(t[0]);y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=s();t.length&&(e.preventDefault(),d(t))}else if(a("core/block-editor/remove",e)){const t=s();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=s();t.length&&(e.preventDefault(),h(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=s();t.length&&(e.preventDefault(),b(t[0]))}else if(a("core/block-editor/unselect",e)){const n=s();n.length&&(e.preventDefault(),n.length>1?_(n[0]):v(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),t?.current.focus())}}},(0,c.createElement)(Gg.Provider,{value:(0,c.useRef)(!1)},!i&&(0,c.createElement)($g,{__unstableContentRef:t}),!l&&(r||!o)&&(0,c.createElement)(ZI,{isFixed:!0}),(0,c.createElement)(rT,{__unstableContentRef:t}),(0,c.createElement)(m.Popover.Slot,{name:"block-toolbar",ref:E}),e,(0,c.createElement)(m.Popover.Slot,{name:"__unstable-block-tools-after",ref:w}),l&&(0,c.createElement)(lT,{__unstableContentRef:t})))}const sT=()=>{};var cT=(0,c.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:i,onSelect:a=sT,shouldFocusBlock:s=!1},u){const{destinationRootClientId:d,prioritizePatterns:p}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getSettings:r}=n(Jo),l=e||o(t)||void 0;return{destinationRootClientId:l,prioritizePatterns:r().__experimentalPreferPatternsOnRoot&&!l}}),[t,e]);return(0,c.createElement)(wg,{onSelect:a,rootClientId:d,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:l,__experimentalFilterValue:i,shouldFocusBlock:s,prioritizePatterns:p,ref:u})}));function uT(){return $()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const dT=-1!==window.navigator.userAgent.indexOf("Trident"),pT=new Set([Pd.UP,Pd.DOWN,Pd.LEFT,Pd.RIGHT]),mT=.75;function fT(){const e=(0,f.useSelect)((e=>e(Jo).hasSelectedBlock()),[]);return(0,p.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({keyCode:e}){if(!m())return;const r=(0,da.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(pT.has(e))return void(i=r);const l=r.top-i.top;if(0===l)return;const a=(0,da.getScrollContainer)(t);if(!a)return;const s=a===n.body||a===n.documentElement,c=s?o.scrollY:a.scrollTop,u=s?0:a.getBoundingClientRect().top,d=s?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<mT&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=s?o.innerHeight:a.clientHeight;i.top+i.height>u+p||i.top<u?i=r:s?o.scrollBy(0,l):a.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,da.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 gT=dT?e=>e.children:function({children:e}){return(0,c.createElement)("div",{ref:fT(),className:"block-editor__typewriter"},e)};const hT=(0,c.createContext)({});function bT({children:e,uniqueId:t,blockName:n=""}){const o=(0,c.useContext)(hT),{name:r}=rr();n=n||r;const l=(0,c.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,n,t)),[o,n,t]);return(0,c.createElement)(hT.Provider,{value:l},e)}function vT(e,t=""){const n=(0,c.useContext)(hT),{name:o}=rr();return t=t||o,Boolean(n[t]?.has(e))}var _T=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function kT({title:e,help:t,actions:n=[],onClose:o}){return(0,c.createElement)(m.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,c.createElement)(m.__experimentalHStack,{alignment:"center"},(0,c.createElement)(m.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},e),(0,c.createElement)(m.__experimentalSpacer,null),n.map((({label:e,icon:t,onClick:n})=>(0,c.createElement)(m.Button,{key:e,className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n},!t&&e))),o&&(0,c.createElement)(m.Button,{className:"block-editor-inspector-popover-header__action",label:(0,v.__)("Close"),icon:_T,onClick:o})),t&&(0,c.createElement)(m.__experimentalText,null,t))}var yT=(0,c.forwardRef)((function({onClose:e,onChange:t,...n},o){return(0,c.createElement)("div",{ref:o,className:"block-editor-publish-date-time-picker"},(0,c.createElement)(kT,{title:(0,v.__)("Publish"),actions:[{label:(0,v.__)("Now"),onClick:()=>t?.(null)}],onClose:e}),(0,c.createElement)(m.DateTimePicker,{startOfWeek:(0,gC.getSettings)().l10n.startOfWeek,onChange:t,...n}))})),ET=window.wp.commands;var wT=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"}));var ST=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"}));var CT=(0,c.createElement)(F.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(F.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"}));const xT=()=>{const{clientIds:e}=(0,f.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e(Jo);return{clientIds:t()}}),[]),t=(0,f.useSelect)((t=>t(Jo).getBlocksByClientId(e)),[e]),{replaceBlocks:n,multiSelect:o}=(0,f.useDispatch)(Jo),{possibleBlockTransformations:r,canRemove:l}=(0,f.useSelect)((n=>{const{getBlockRootClientId:o,getBlockTransformItems:r,canRemoveBlocks:l}=n(Jo),i=o(Array.isArray(e)?e[0]:e);return{possibleBlockTransformations:r(t,i),canRemove:l(e,i)}}),[e,t]),i=1===t.length&&(0,a.isTemplatePart)(t[0]);function s(r){const l=(0,a.switchToBlockType)(t,r);var i;n(e,l),(i=l).length>1&&o(i[0].clientId,i[i.length-1].clientId)}const u=!!r.length&&l&&!i;if(!e||e.length<1||!u)return{isLoading:!1,commands:[]};const d=r.map((e=>{const{name:t,title:n,icon:o}=e;return{name:"core/block-editor/transform-to-"+t.replace("/","-"),label:(0,v.sprintf)((0,v.__)("Transform to %s"),n),icon:(0,c.createElement)(ep,{icon:o}),callback:({close:e})=>{s(t),e()}}}));return{isLoading:!1,commands:d}},BT=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,f.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(Jo);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:l,canMoveBlocks:i,canRemoveBlocks:s,getBlockCount:c}=(0,f.useSelect)(Jo),{getDefaultBlockName:u,getGroupingBlockName:d}=(0,f.useSelect)(a.store),p=l(e),{removeBlocks:m,replaceBlocks:g,duplicateBlocks:h,insertAfterBlock:b,insertBeforeBlock:_,setBlockMovingClientId:k,setNavigationMode:y,selectBlock:E}=(0,f.useDispatch)(Jo),w=()=>{if(!p.length)return;const t=d(),n=(0,a.switchToBlockType)(p,t);n&&g(e,n)},S=()=>{if(!p.length)return;const t=p[0].innerBlocks;t.length&&g(e,t)};if(!e||e.length<1)return{isLoading:!1,commands:[]};const C=r(e[0]),x=o(u(),C),B=p.every((e=>!!e&&(0,a.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,C))),I=s(e,C),T=i(e,C)&&1!==c(C),M=[];return x&&M.push({name:"add-after",label:(0,v.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;b(t)},icon:qd},{name:"add-before",label:(0,v.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;_(t)},icon:qd}),I&&M.push({name:"remove",label:(0,v.__)("Delete"),callback:()=>m(e,!0),icon:wT}),B&&M.push({name:"duplicate",label:(0,v.__)("Duplicate"),callback:()=>h(e,!0),icon:OB}),T&&M.push({name:"move-to",label:(0,v.__)("Move to"),callback:()=>{y(!0),E(e[0]),k(e[0])},icon:ST}),t&&M.push({name:"ungroup",label:(0,v.__)("Ungroup"),callback:S,icon:CT}),n&&M.push({name:"Group",label:(0,v.__)("Group"),callback:w,icon:zI}),{isLoading:!1,commands:M.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},IT=()=>{(0,ET.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:xT}),(0,ET.useCommandLoader)({name:"core/block-editor/blockActions",hook:BT})},TT="isResuableBlocksrRenameHintVisible";function MT(){const e=(0,f.useSelect)((e=>{var t;return null===(t=e(Ch.store).get("core",TT))||void 0===t||t}),[]),t=(0,c.useRef)(),{set:n}=(0,f.useDispatch)(Ch.store);return e?(0,c.createElement)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint"},(0,c.createElement)("div",{className:"reusable-blocks-menu-items__rename-hint-content"},(0,v.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")),(0,c.createElement)(m.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:vB,iconSize:"16",label:(0,v.__)("Dismiss hint"),onClick:()=>{const e=da.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",TT,!1)},showTooltip:!1})):null}const PT={button:"wp-element-button",caption:"wp-element-caption"},NT=e=>PT[e]?PT[e]:"";function LT(e,t){return Object.entries(t).every((([t,n])=>"object"==typeof n&&"object"==typeof e[t]?LT(e[t],n):e[t]===n))}const RT=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&<(e,t)));return 1===n.length?n[0]:void 0};function AT(e){const t=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 DT(e){try{return Function(`'use strict'; return (${e})`)()}catch(e){return null}}function OT(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>AT(FT(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 zT(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=OT(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return AT(e)}function VT(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function FT(e,t={}){if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=AT(e);return n.unit||(n=zT(e)),VT(e)&&!n.unit?function(e){let t=!1;const n=e.match(/\d+\.?\d*[a-zA-Z]+|\.\d+[a-zA-Z]+/g);if(n)for(const o of n){const n=AT(FT(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}else t=!0;const o=e.match(/(max|min|clamp)/g);if(!t&&o){const t=e.split(",");for(const n of t){const t=n.replace(/\s|calc/g,"");if(VT(t)){const o=DT(t);if(o){const t=o.toFixed(0)+"px";e=e.replace(n,t)}}}const n=zT(e);return n?n.value+n.unit:null}if(t)return null;const r=DT(e);return r?r.toFixed(0)+"px":null}(e):function(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}(n,t)}const HT={};var GT=function(e,t={}){const n=e+function(e){let t="";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);return t}(t);return HT[n]||(HT[n]=FT(e,t)),HT[n]};const UT={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function $T(e){const t="var:";if(e?.startsWith?.(t)){return`var(--wp--${e.slice(4).split("|").join("--")})`}return e}function jT(e={},t,n){let o=[];return Object.keys(e).forEach((r=>{const l=t+cl(r.replace("/","-")),i=e[r];if(i instanceof Object){const e=l+n;o=[...o,...jT(i,e,n)]}else o.push(`${l}: ${i}`)})),o}const WT=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;if(r||Object.entries(o).forEach((([o,r])=>{if("root"===o||!t?.[e][o])return;const l=KT({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...l],delete t[e][o]})),r||o.root){const l=r?o:o.root,i=KT({[e]:t[e]});n[l]=[...n[l]||[],...i],delete t[e]}})),n};function KT(e={},t="",n,o={},r=!0){const l=Ml===t,i=Object.entries(a.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:i,useEngine:a,rootOnly:s}])=>{if(s&&!l)return t;const c=r;if("elements"===c[0]||a)return t;const u=pl(e,c);if("--wp--style--root--padding"===o&&("string"==typeof u||!n))return t;if(i&&"string"!=typeof u)Object.entries(i).forEach((e=>{const[n,o]=e;if(!pl(u,[o],!1))return;const r=n.startsWith("--")?n:cl(n);t.push(`${r}: ${$T(pl(u,[o]))}`)}));else if(pl(e,c,!1)){const n=o.startsWith("--")?o:cl(o);t.push(`${n}: ${$T(pl(e,c))}`)}return t}),[]);return(0,ui.getCSSRules)(e).forEach((e=>{if(l&&(n||!r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:cl(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=pl(o,e),!a||a?.ref)return}"font-size"===t&&(a=Bl({size:a},Tl(o?.settings))),i.push(`${t}: ${a}`)})),i}function qT({layoutDefinitions:e=_r,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:l}){let i="",a=o?Hr(t?.spacing?.blockGap):"";if(r&&(n===Ml?a=a||"0.5em":!o&&l&&(a=l)),a&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:r})=>{(o||"flex"===t||"grid"===t)&&r?.length&&r.forEach((t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{r.push(`${e}: ${t||a}`)})),r.length){let l="";l=o?n===Ml?`:where(${n} .${e})${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===Ml?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,i+=`${l} { ${r.join("; ")}; }`}}))})),n===Ml&&o&&(i+=`${n} { --wp--style--block-gap: ${a}; }`)),n===Ml&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(i+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t}`)})),o.length){i+=`${`${n} .${e}${t?.selector||""}`} { ${o.join("; ")}; }`}}))}))}return i}const ZT=["border","color","dimensions","spacing","typography","filter","outline","shadow"];function YT(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>ZT.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const XT=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{let t={};return Pl.forEach((({path:n})=>{const o=pl(e,n,!1);!1!==o&&(t=dl(t,n,o))})),t},l=r(e.settings),i=e.settings?.custom;return(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:Ml}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const l=r(n),i=n.custom;(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:t[e]?.selector})})),o},QT=(e,t)=>{const n=XT(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const l=function(e={},t){return Pl.reduce(((n,{path:o,valueKey:r,valueFunc:l,cssVarInfix:i})=>{const a=pl(e,o,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{r&&!l?n.push(`--wp--preset--${i}--${cl(e.slug)}: ${e[r]}`):l&&"function"==typeof l&&n.push(`--wp--preset--${i}--${cl(e.slug)}: ${l(e,t)}`)}))})),n}),[])}(t,e?.settings),i=jT(n,"--wp--custom--","--");i.length>0&&l.push(...i),l.length>0&&(o+=`${r}{${l.join(";")};}`)})),o},JT=(e,t,n,o,r=!1,l=!0)=>{const i=((e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=YT(e.styles);return r&&o.push({styles:r,selector:Ml}),Object.entries(a.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var r;const l=YT(n);if(n?.variations){const e={};Object.keys(n.variations).forEach((t=>{e[t]=YT(n.variations[t])})),l.variations=e}l&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:l,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(r=n?.elements)&&void 0!==r?r:{}).forEach((([n,r])=>{r&&t?.[e]&&a.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:r,selector:t[e]?.selector.split(",").map((e=>a.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),o})(e,t),s=XT(e,t),c=e?.settings?.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=e?.settings?.layout||{};let p="body {margin: 0;";if(u&&(p+=` --wp--style--global--content-size: ${u};`),d&&(p+=` --wp--style--global--wide-size: ${d};`),c&&l&&(p+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;"),p+="}",i.forEach((({selector:t,duotoneSelector:i,styles:a,fallbackGapValue:s,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m})=>{if(d){const e=WT(d,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");p+=`${e}{${n};}`}}))}if(m&&Object.entries(m).forEach((([t,n])=>{const o=a?.variations?.[t];if(o){if(d){const e=WT(d,o);Object.entries(e).forEach((([e,t])=>{if(t.length){const o=function(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}(e,n),r=t.join(";");p+=`${o}{${r};}`}}))}const t=KT(o,n,c,e);t.length&&(p+=`${n}{${t.join(";")};}`)}})),i){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=KT(e);t.length&&(p+=`${i}{${t.join(";")};}`)}r||Ml!==t&&!u||(p+=qT({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:s}));const f=KT(a,t,c,e,l);f?.length&&(p+=`${t}{${f.join(";")};}`);const g=Object.entries(a).filter((([e])=>e.startsWith(":")));g?.length&&g.forEach((([e,n])=>{const o=KT(n);if(!o?.length)return;const r=`${t.split(",").map((t=>t+e)).join(",")}{${o.join(";")};}`;p+=r}))})),p+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){const t=Hr(e?.styles?.spacing?.blockGap)||"0.5em";p+=`:where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,p+=":where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }",p+=":where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }"}return s.forEach((({selector:e,presets:t})=>{Ml===e&&(e="");const n=function(e="*",t={}){return Pl.reduce(((n,{path:o,cssVarInfix:r,classes:l})=>{if(!l)return n;const i=pl(t,o,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((({slug:t})=>{l.forEach((({classSuffix:o,propertyName:l})=>{const i=`.has-${cl(t)}-${o}`,a=e.split(",").map((e=>`${e}${i}`)).join(","),s=`var(--wp--preset--${r}--${cl(t)})`;n+=`${a}{${l}: ${s} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(p+=n)})),p};function eM(e,t){return XT(e,t).flatMap((({presets:e})=>function(e={}){return Pl.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=pl(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>cy(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}const tM=(e,t)=>{const n={};return e.forEach((e=>{const o=e.name,r=uy(e);let l=uy(e,"filter.duotone");if(!l){const t=uy(e),n=(0,a.getBlockSupport)(e,"color.__experimentalDuotone",!1);l=n&&Al(t,n)}const i=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,s=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(o),u={};c?.length&&c.forEach((e=>{const t=`.is-style-${e.name}${r}`;u[e.name]=t}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(UT).forEach((([t,o])=>{const r=uy(e,t);r&&(n[o]=r)})),n})(e,r);n[o]={duotoneSelector:l,fallbackGapValue:s,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:i,name:o,selector:r,styleVariationSelectors:Object.keys(u).length?u:void 0}})),n};function nM(e,t){let n="";return e.split("&").forEach((e=>{if(!e.includes("{"))n+=`${t}{${e.trim()}}`;else{const o=e.replace("}","").split("{");if(2!==o.length)return;const[r,l]=o,i=r.startsWith(" ")?Al(t,r):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,r);n+=`${i}{${l.trim()}}`}})),n}function oM(e={}){const[t]=Hl("spacing.blockGap"),n=null!==t,o=!n,r=(0,f.useSelect)((e=>{const{getSettings:t}=e(Jo);return!!t().disableLayoutStyles})),l=(0,c.useContext)(fa),i=void 0!==l?.templateSlug,s=(0,f.useSelect)((e=>e(a.store).getBlockStyles),[]);return(0,c.useMemo)((()=>{var t,l;if(!e?.styles||!e?.settings)return[];l=e,e=l.styles?.blocks?.["core/separator"]&&l.styles?.blocks?.["core/separator"].color?.background&&!l.styles?.blocks?.["core/separator"].color?.text&&!l.styles?.blocks?.["core/separator"].border?.color?{...l,styles:{...l.styles,blocks:{...l.styles.blocks,"core/separator":{...l.styles.blocks["core/separator"],color:{...l.styles.blocks["core/separator"].color,text:l.styles?.blocks["core/separator"].color.background}}}}}:l;const c=tM((0,a.getBlockTypes)(),s),u=QT(e,c),d=JT(e,c,n,o,r,i),p=eM(e,c),m=[{css:u,isGlobalStyles:!0},{css:d,isGlobalStyles:!0},{css:null!==(t=e.styles.css)&&void 0!==t?t:"",isGlobalStyles:!0},{assets:p,__unstableType:"svg",isGlobalStyles:!0}];return(0,a.getBlockTypes)().forEach((t=>{if(e.styles.blocks[t.name]?.css){const n=c[t.name].selector;m.push({css:nM(e.styles.blocks[t.name]?.css,n),isGlobalStyles:!0})}})),[m,e.settings]}),[n,o,e,r])}function rM(){const{merged:e}=(0,c.useContext)(Ol);return oM(e)}var lM=(0,c.createElement)(F.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(F.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"}));function iM(e){return aM(e)}function aM(e){return!!e?.shadow}function sM({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v.__)("Effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o},r)}const cM={shadow:!0};function uM({as:e=sM,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:l,defaultControls:i=cM}){const a=aM(r),s=(u=o?.shadow,Rl({settings:r},"",u));var u;const d=e=>{n(dl(t,["shadow"],e))},p=(0,c.useCallback)((e=>({...e,shadow:void 0})),[]);return(0,c.createElement)(e,{resetAllFilter:p,value:t,onChange:n,panelId:l},a&&(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>d(void 0),isShownByDefault:i.shadow,panelId:l},(0,c.createElement)(m.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,c.createElement)(dM,{shadow:s,onShadowChange:d,settings:r}))))}const dM=({shadow:e,onShadowChange:t,settings:n})=>(0,c.createElement)(m.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles-effects-panel__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:d()({"is-open":t}),"aria-expanded":t};return(0,c.createElement)(m.Button,{...n},(0,c.createElement)(m.__experimentalHStack,{justify:"flex-start"},(0,c.createElement)(ai,{className:"block-editor-global-styles-effects-panel__toggle-icon",icon:lM,size:24}),(0,c.createElement)(m.FlexItem,null,(0,v.__)("Shadow"))))},renderContent:()=>(0,c.createElement)(m.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,c.createElement)(pM,{shadow:e,onShadowChange:t,settings:n}))});function pM({shadow:e,onShadowChange:t,settings:n}){const o=n?.shadow?.presets?.default,r=n?.shadow?.presets?.theme,l=n?.shadow?.defaultPresets,i=[...l?o:[],...r||[]];return(0,c.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-popover-container"},(0,c.createElement)(m.__experimentalVStack,{spacing:4},(0,c.createElement)(m.__experimentalHeading,{level:5},(0,v.__)("Shadow")),(0,c.createElement)(mM,{presets:i,activeShadow:e,onSelect:t})))}function mM({presets:e,activeShadow:t,onSelect:n}){return e?(0,c.createElement)(m.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},e.map((({name:e,slug:o,shadow:r})=>(0,c.createElement)(fM,{key:o,label:e,isActive:r===t,onSelect:()=>n(r===t?void 0:r),shadow:r})))):null}function fM({label:e,isActive:t,onSelect:n,shadow:o}){return(0,c.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-indicator-wrapper"},(0,c.createElement)(m.Button,{className:"block-editor-global-styles-effects-panel__shadow-indicator",onClick:n,label:e,style:{boxShadow:o},showTooltip:!0},t&&(0,c.createElement)(ai,{icon:gk})))}function gM(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function hM({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=()=>{e(void 0)};let l=!1;return n?.lightbox?.enabled&&(l=n.lightbox.enabled),(0,c.createElement)(c.Fragment,null,(0,c.createElement)(m.__experimentalToolsPanel,{label:(0,v._x)("Settings","Image settings"),resetAll:r,panelId:o},(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,v.__)("Expand on click"),onDeselect:r,isShownByDefault:!0,panelId:o},(0,c.createElement)(m.ToggleControl,{label:(0,v.__)("Expand on click"),checked:l,onChange:t=>{e({enabled:t})}}))))}function bM({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,c.useState)(null),l=n?.css;return(0,c.createElement)(m.__experimentalVStack,{spacing:3},(0,c.createElement)(m.TextareaControl,{label:(0,v.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:l,onChange:n=>function(n){if(t({...e,css:n}),o){const[t]=Im([{css:e}],".editor-styles-wrapper");t&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=Im([{css:e.target.value}],".editor-styles-wrapper");r(null===t?(0,v.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1}),o&&(0,c.createElement)(m.Tooltip,{text:o},(0,c.createElement)("div",{className:"block-editor-global-styles-advanced-panel__custom-css-validation-wrapper"},(0,c.createElement)(ai,{icon:cb,className:"block-editor-global-styles-advanced-panel__custom-css-validation-icon"}))))}function vM(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return _M(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case c.StrictMode:case c.Fragment:return _M(r.children,t,n);case c.RawHTML:return;case ch.Content:return kM(t,n);case Yx:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?_M(r.children,t,n):void 0;case"function":return vM(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function _M(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)vM(e[n],...t)}function kM(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:l}=t[n];vM((0,a.getSaveElement)(o,r,(0,c.createElement)(ch.Content,null)),e,l)}}const yM=[{label:(0,v._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},{label:(0,v._x)("Square - 1:1","Aspect ratio option for dimensions control"),value:"1"},{label:(0,v._x)("Standard - 4:3","Aspect ratio option for dimensions control"),value:"4/3"},{label:(0,v._x)("Portrait - 3:4","Aspect ratio option for dimensions control"),value:"3/4"},{label:(0,v._x)("Classic - 3:2","Aspect ratio option for dimensions control"),value:"3/2"},{label:(0,v._x)("Classic Portrait - 2:3","Aspect ratio option for dimensions control"),value:"2/3"},{label:(0,v._x)("Wide - 16:9","Aspect ratio option for dimensions control"),value:"16/9"},{label:(0,v._x)("Tall - 9:16","Aspect ratio option for dimensions control"),value:"9/16"},{label:(0,v._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];function EM({panelId:e,value:t,onChange:n=(()=>{}),options:o=yM,defaultValue:r=yM[0].value,isShownByDefault:l=!0}){const i=null!=t?t:"auto";return(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,v.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:l,panelId:e},(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Aspect ratio"),value:i,options:o,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0}))}const wM=[{value:"fill",label:(0,v._x)("Fill","Scale option for dimensions control"),help:(0,v.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,v._x)("Contain","Scale option for dimensions control"),help:(0,v.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,v._x)("Cover","Scale option for dimensions control"),help:(0,v.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,v._x)("None","Scale option for dimensions control"),help:(0,v.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,v._x)("Scale down","Scale option for dimensions control"),help:(0,v.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function SM({panelId:e,value:t,onChange:n,options:o=wM,defaultValue:r=wM[0].value,isShownByDefault:l=!0}){const i=null!=t?t:"fill",a=(0,c.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,c.createElement)(m.__experimentalToolsPanelItem,{label:(0,v.__)("Scale"),isShownByDefault:l,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e},(0,c.createElement)(m.__experimentalToggleGroupControl,{label:(0,v.__)("Scale"),isBlock:!0,help:a[i],value:i,onChange:n,__nextHasNoMarginBottom:!0},o.map((e=>(0,c.createElement)(m.__experimentalToggleGroupControlOption,{key:e.value,...e})))))}function CM(){return CM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},CM.apply(this,arguments)}function xM(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var BM=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,IM=xM((function(e){return BM.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var TM=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),MM=Math.abs,PM=String.fromCharCode,NM=Object.assign;function LM(e){return e.trim()}function RM(e,t,n){return e.replace(t,n)}function AM(e,t){return e.indexOf(t)}function DM(e,t){return 0|e.charCodeAt(t)}function OM(e,t,n){return e.slice(t,n)}function zM(e){return e.length}function VM(e){return e.length}function FM(e,t){return t.push(e),e}var HM=1,GM=1,UM=0,$M=0,jM=0,WM="";function KM(e,t,n,o,r,l,i){return{value:e,root:t,parent:n,type:o,props:r,children:l,line:HM,column:GM,length:i,return:""}}function qM(e,t){return NM(KM("",null,null,"",null,null,0),e,{length:-e.length},t)}function ZM(){return jM=$M>0?DM(WM,--$M):0,GM--,10===jM&&(GM=1,HM--),jM}function YM(){return jM=$M<UM?DM(WM,$M++):0,GM++,10===jM&&(GM=1,HM++),jM}function XM(){return DM(WM,$M)}function QM(){return $M}function JM(e,t){return OM(WM,e,t)}function eP(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tP(e){return HM=GM=1,UM=zM(WM=e),$M=0,[]}function nP(e){return WM="",e}function oP(e){return LM(JM($M-1,iP(91===e?e+2:40===e?e+1:e)))}function rP(e){for(;(jM=XM())&&jM<33;)YM();return eP(e)>2||eP(jM)>3?"":" "}function lP(e,t){for(;--t&&YM()&&!(jM<48||jM>102||jM>57&&jM<65||jM>70&&jM<97););return JM(e,QM()+(t<6&&32==XM()&&32==YM()))}function iP(e){for(;YM();)switch(jM){case e:return $M;case 34:case 39:34!==e&&39!==e&&iP(jM);break;case 40:41===e&&iP(e);break;case 92:YM()}return $M}function aP(e,t){for(;YM()&&e+jM!==57&&(e+jM!==84||47!==XM()););return"/*"+JM(t,$M-1)+"*"+PM(47===e?e:YM())}function sP(e){for(;!eP(XM());)YM();return JM(e,$M)}var cP="-ms-",uP="-moz-",dP="-webkit-",pP="comm",mP="rule",fP="decl",gP="@keyframes";function hP(e,t){for(var n="",o=VM(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function bP(e,t,n,o){switch(e.type){case"@import":case fP:return e.return=e.return||e.value;case pP:return"";case gP:return e.return=e.value+"{"+hP(e.children,o)+"}";case mP:e.value=e.props.join(",")}return zM(n=hP(e.children,o))?e.return=e.value+"{"+n+"}":""}function vP(e){return nP(_P("",null,null,null,[""],e=tP(e),0,[0],e))}function _P(e,t,n,o,r,l,i,a,s){for(var c=0,u=0,d=i,p=0,m=0,f=0,g=1,h=1,b=1,v=0,_="",k=r,y=l,E=o,w=_;h;)switch(f=v,v=YM()){case 40:if(108!=f&&58==DM(w,d-1)){-1!=AM(w+=RM(oP(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:w+=oP(v);break;case 9:case 10:case 13:case 32:w+=rP(f);break;case 92:w+=lP(QM()-1,7);continue;case 47:switch(XM()){case 42:case 47:FM(yP(aP(YM(),QM()),t,n),s);break;default:w+="/"}break;case 123*g:a[c++]=zM(w)*b;case 125*g:case 59:case 0:switch(v){case 0:case 125:h=0;case 59+u:m>0&&zM(w)-d&&FM(m>32?EP(w+";",o,n,d-1):EP(RM(w," ","")+";",o,n,d-2),s);break;case 59:w+=";";default:if(FM(E=kP(w,t,n,c,u,r,a,_,k=[],y=[],d),l),123===v)if(0===u)_P(w,t,E,E,k,l,d,a,y);else switch(99===p&&110===DM(w,3)?100:p){case 100:case 109:case 115:_P(e,E,E,o&&FM(kP(e,E,E,0,0,r,a,_,r,k=[],d),y),r,y,d,a,o?k:y);break;default:_P(w,E,E,E,[""],y,0,a,y)}}c=u=m=0,g=b=1,_=w="",d=i;break;case 58:d=1+zM(w),m=f;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==ZM())continue;switch(w+=PM(v),v*g){case 38:b=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(zM(w)-1)*b,b=1;break;case 64:45===XM()&&(w+=oP(YM())),p=XM(),u=d=zM(_=w+=sP(QM())),v++;break;case 45:45===f&&2==zM(w)&&(g=0)}}return l}function kP(e,t,n,o,r,l,i,a,s,c,u){for(var d=r-1,p=0===r?l:[""],m=VM(p),f=0,g=0,h=0;f<o;++f)for(var b=0,v=OM(e,d+1,d=MM(g=i[f])),_=e;b<m;++b)(_=LM(g>0?p[b]+" "+v:RM(v,/&\f/g,p[b])))&&(s[h++]=_);return KM(e,t,n,0===r?mP:a,s,c,u)}function yP(e,t,n){return KM(e,t,n,pP,PM(jM),OM(e,2,-2),0)}function EP(e,t,n,o){return KM(e,t,n,fP,OM(e,0,o),OM(e,o+1,-1),o)}var wP=function(e,t,n){for(var o=0,r=0;o=r,r=XM(),38===o&&12===r&&(t[n]=1),!eP(r);)YM();return JM(e,$M)},SP=function(e,t){return nP(function(e,t){var n=-1,o=44;do{switch(eP(o)){case 0:38===o&&12===XM()&&(t[n]=1),e[n]+=wP($M-1,t,n);break;case 2:e[n]+=oP(o);break;case 4:if(44===o){e[++n]=58===XM()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=PM(o)}}while(o=YM());return e}(tP(e),t))},CP=new WeakMap,xP=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||CP.get(n))&&!o){CP.set(e,!0);for(var r=[],l=SP(t,r),i=n.props,a=0,s=0;a<l.length;a++)for(var c=0;c<i.length;c++,s++)e.props[s]=r[a]?l[a].replace(/&\f/g,i[c]):i[c]+" "+l[a]}}},BP=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function IP(e,t){switch(function(e,t){return 45^DM(e,0)?(((t<<2^DM(e,0))<<2^DM(e,1))<<2^DM(e,2))<<2^DM(e,3):0}(e,t)){case 5103:return dP+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return dP+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return dP+e+uP+e+cP+e+e;case 6828:case 4268:return dP+e+cP+e+e;case 6165:return dP+e+cP+"flex-"+e+e;case 5187:return dP+e+RM(e,/(\w+).+(:[^]+)/,dP+"box-$1$2"+cP+"flex-$1$2")+e;case 5443:return dP+e+cP+"flex-item-"+RM(e,/flex-|-self/,"")+e;case 4675:return dP+e+cP+"flex-line-pack"+RM(e,/align-content|flex-|-self/,"")+e;case 5548:return dP+e+cP+RM(e,"shrink","negative")+e;case 5292:return dP+e+cP+RM(e,"basis","preferred-size")+e;case 6060:return dP+"box-"+RM(e,"-grow","")+dP+e+cP+RM(e,"grow","positive")+e;case 4554:return dP+RM(e,/([^-])(transform)/g,"$1"+dP+"$2")+e;case 6187:return RM(RM(RM(e,/(zoom-|grab)/,dP+"$1"),/(image-set)/,dP+"$1"),e,"")+e;case 5495:case 3959:return RM(e,/(image-set\([^]*)/,dP+"$1$`$1");case 4968:return RM(RM(e,/(.+:)(flex-)?(.*)/,dP+"box-pack:$3"+cP+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+dP+e+e;case 4095:case 3583:case 4068:case 2532:return RM(e,/(.+)-inline(.+)/,dP+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(zM(e)-1-t>6)switch(DM(e,t+1)){case 109:if(45!==DM(e,t+4))break;case 102:return RM(e,/(.+:)(.+)-([^]+)/,"$1"+dP+"$2-$3$1"+uP+(108==DM(e,t+3)?"$3":"$2-$3"))+e;case 115:return~AM(e,"stretch")?IP(RM(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==DM(e,t+1))break;case 6444:switch(DM(e,zM(e)-3-(~AM(e,"!important")&&10))){case 107:return RM(e,":",":"+dP)+e;case 101:return RM(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dP+(45===DM(e,14)?"inline-":"")+"box$3$1"+dP+"$2$3$1"+cP+"$2box$3")+e}break;case 5936:switch(DM(e,t+11)){case 114:return dP+e+cP+RM(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dP+e+cP+RM(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dP+e+cP+RM(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dP+e+cP+e+e}return e}var TP=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case fP:e.return=IP(e.value,e.length);break;case gP:return hP([qM(e,{value:RM(e.value,"@","@"+dP)})],o);case mP:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hP([qM(e,{props:[RM(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return hP([qM(e,{props:[RM(t,/:(plac\w+)/,":"+dP+"input-$1")]}),qM(e,{props:[RM(t,/:(plac\w+)/,":-moz-$1")]}),qM(e,{props:[RM(t,/:(plac\w+)/,cP+"input-$1")]})],o)}return""}))}}],MP=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||TP;var r,l,i={},a=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;a.push(e)}));var s,c,u,d,p=[bP,(d=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],m=(c=[xP,BP].concat(o,p),u=VM(c),function(e,t,n,o){for(var r="",l=0;l<u;l++)r+=c[l](e,t,n,o)||"";return r});l=function(e,t,n,o){s=n,function(e){hP(vP(e),m)}(e?e+"{"+t.styles+"}":t.styles),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new TM({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};return f.sheet.hydrate(a),f};var PP=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},NP={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function LP(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var RP=/[A-Z]|^ms/g,AP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,DP=function(e){return 45===e.charCodeAt(1)},OP=function(e){return null!=e&&"boolean"!=typeof e},zP=LP((function(e){return DP(e)?e:e.replace(RP,"-$&").toLowerCase()})),VP=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(AP,(function(e,t,n){return HP={name:t,styles:n,next:HP},t}))}return 1===NP[e]||DP(e)||"number"!=typeof t||0===t?t:t+"px"};function FP(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return HP={name:n.name,styles:n.styles,next:HP},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)HP={name:o.name,styles:o.styles,next:HP},o=o.next;return n.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=FP(e,t,n[r])+";";else for(var l in n){var i=n[l];if("object"!=typeof i)null!=t&&void 0!==t[i]?o+=l+"{"+t[i]+"}":OP(i)&&(o+=zP(l)+":"+VP(l,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var a=FP(e,t,i);switch(l){case"animation":case"animationName":o+=zP(l)+":"+a+";";break;default:o+=l+"{"+a+"}"}}else for(var s=0;s<i.length;s++)OP(i[s])&&(o+=zP(l)+":"+VP(l,i[s])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=HP,l=n(e);return HP=r,FP(e,t,l)}}if(null==t)return n;var i=t[n];return void 0!==i?i:n}var HP,GP=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var UP=!!Ya.useInsertionEffect&&Ya.useInsertionEffect,$P=UP||function(e){return e()},jP=(0,Ya.createContext)("undefined"!=typeof HTMLElement?MP({key:"css"}):null);jP.Provider;var WP=function(e){return(0,Ya.forwardRef)((function(t,n){var o=(0,Ya.useContext)(jP);return e(t,o,n)}))},KP=(0,Ya.createContext)({});var qP=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},ZP=IM,YP=function(e){return"theme"!==e},XP=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ZP:YP},QP=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},JP=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;qP(t,n,o);$P((function(){return function(e,t,n){qP(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}));return null},eN=function e(t,n){var o,r,l=t.__emotion_real===t,i=l&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var a=QP(t,n,l),s=a||XP(i),c=!s("as");return function(){var u=arguments,d=l&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,m=1;m<p;m++)d.push(u[m],u[0][m])}var f=WP((function(e,t,n){var o=c&&e.as||i,l="",u=[],p=e;if(null==e.theme){for(var m in p={},e)p[m]=e[m];p.theme=(0,Ya.useContext)(KP)}"string"==typeof e.className?l=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):o+=n+" "})),o}(t.registered,u,e.className):null!=e.className&&(l=e.className+" ");var f=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";HP=void 0;var l=e[0];null==l||void 0===l.raw?(o=!1,r+=FP(n,t,l)):r+=l[0];for(var i=1;i<e.length;i++)r+=FP(n,t,e[i]),o&&(r+=l[i]);GP.lastIndex=0;for(var a,s="";null!==(a=GP.exec(r));)s+="-"+a[1];return{name:PP(r)+s,styles:r,next:HP}}(d.concat(u),t.registered,p);l+=t.key+"-"+f.name,void 0!==r&&(l+=" "+r);var g=c&&void 0===a?XP(o):s,h={};for(var b in e)c&&"as"===b||g(b)&&(h[b]=e[b]);return h.className=l,h.ref=n,(0,Ya.createElement)(Ya.Fragment,null,(0,Ya.createElement)(JP,{cache:t,serialized:f,isStringTag:"string"==typeof o}),(0,Ya.createElement)(o,h))}));return f.displayName=void 0!==o?o:"Styled("+("string"==typeof i?i:i.displayName||i.name||"Component")+")",f.defaultProps=t.defaultProps,f.__emotion_real=f,f.__emotion_base=i,f.__emotion_styles=d,f.__emotion_forwardProp=a,Object.defineProperty(f,"toString",{value:function(){return"."+r}}),f.withComponent=function(t,o){return e(t,CM({},n,o,{shouldForwardProp:QP(f,o,!0)})).apply(void 0,d)},f}};const tN=eN(m.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function nN({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var l,i;const a="auto"===t.width?"":null!==(l=t.width)&&void 0!==l?l:"",s="auto"===t.height?"":null!==(i=t.height)&&void 0!==i?i:"",u=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(tN,{label:(0,v.__)("Width"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:u("width"),panelId:e},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Width"),placeholder:(0,v.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:u("width"),size:"__unstable-large"})),(0,c.createElement)(tN,{label:(0,v.__)("Height"),isShownByDefault:r,hasValue:()=>""!==s,onDeselect:u("height"),panelId:e},(0,c.createElement)(m.__experimentalUnitControl,{label:(0,v.__)("Height"),placeholder:(0,v.__)("Auto"),labelPosition:"top",units:o,min:0,value:s,onChange:u("height"),size:"__unstable-large"})))}var oN=function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:l,defaultScale:i="fill",unitsOptions:a}){const s=void 0===t.width||"auto"===t.width?null:t.width,u=void 0===t.height||"auto"===t.height?null:t.height,d=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,p=void 0===t.scale||"fill"===t.scale?null:t.scale,[m,f]=(0,c.useState)(p),[g,h]=(0,c.useState)(d),b=s&&u?"custom":g,v=d||s&&u;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(EM,{panelId:e,options:o,defaultValue:r,value:b,onChange:e=>{const o={...t};h(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?m?o.scale=m:(o.scale=i,f(i)):delete o.scale,"custom"!==e&&s&&u&&delete o.height,n(o)}}),v&&(0,c.createElement)(SM,{panelId:e,options:l,defaultValue:i,value:m,onChange:e=>{const o={...t};f(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}}),(0,c.createElement)(nN,{panelId:e,units:a,value:{width:s,height:u},onChange:({width:e,height:o})=>{const r={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?r.width=e:delete r.width,o?r.height=o:delete r.height,e&&o?delete r.aspectRatio:g&&(r.aspectRatio=g),g||!!e==!!o?m?r.scale=m:(r.scale=i,f(i)):delete r.scale,n(r)}}))};const rN=[{label:(0,v._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,v._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,v._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,v._x)("Full Size","Image size option for resolution control"),value:"full"}];const lN={};Yo(lN,{...i,ExperimentalBlockCanvas:hw,ExperimentalBlockEditorProvider:sp,getRichTextValues:function(e=[]){a.__unstableGetBlockProps.skipFilters=!0;const t=[];return kM(t,e),a.__unstableGetBlockProps.skipFilters=!1,t},kebabCase:cl,PrivateInserter:Bg,PrivateListView:RS,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,c.createElement)(Vg,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"block-toolbar",shift:!1,...n},(0,c.createElement)(m.ResizableBox,{...t}))},BlockInfo:aI,useShouldContextualToolbarShow:eT,cleanEmptyObject:Wl,BlockQuickNavigation:sI,LayoutStyle:function({layout:e={},css:t,...n}){const o=bi(e.type),r=null!==bl("spacing.blockGap");if(o){if(t)return(0,c.createElement)("style",null,t);const l=o.getLayoutStyle?.({hasBlockGapSupport:r,layout:e,...n});if(l)return(0,c.createElement)("style",null,l)}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,blockNamesForPrompt:o}=(0,f.useSelect)((e=>Xo(e(Jo)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:l,privateRemoveBlocks:i}=Xo((0,f.useDispatch)(Jo));if((0,c.useEffect)((()=>(l(e),()=>{l()})),[e,l]),!o)return;return(0,c.createElement)(m.Modal,{title:(0,v.__)("Are you sure?"),onRequestClose:r},1===o.length?(0,c.createElement)("p",null,e[o[0]]):(0,c.createElement)("ul",{style:{listStyleType:"disc",paddingLeft:"1rem"}},o.map((t=>(0,c.createElement)("li",{key:t},e[t])))),(0,c.createElement)("p",null,o.length>1?(0,v.__)("Removing these blocks is not advised."):(0,v.__)("Removing this block is not advised.")),(0,c.createElement)(m.__experimentalHStack,{justify:"right"},(0,c.createElement)(m.Button,{variant:"tertiary",onClick:r},(0,v.__)("Cancel")),(0,c.createElement)(m.Button,{variant:"primary",onClick:()=>{i(t,n,!0),r()}},(0,v.__)("Delete"))))},useLayoutClasses:$y,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,l=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=bi(l?.type||"default"),a=null!==bl("spacing.blockGap"),s=i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a});return s},DimensionsTool:oN,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=rN,defaultValue:r=rN[0].value,isShownByDefault:l=!0}){const i=null!=t?t:r;return(0,c.createElement)(m.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,v.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:l,panelId:e},(0,c.createElement)(m.SelectControl,{label:(0,v.__)("Resolution"),value:i,options:o,onChange:n,help:(0,v.__)("Select the size of the source image."),size:"__unstable-large"}))},ReusableBlocksRenameHint:MT,useReusableBlocksRenameHint:function(){return(0,f.useSelect)((e=>{var t;return null===(t=e(Ch.store).get("core",TT))||void 0===t||t}),[])},usesContextKey:Kx})}(),(window.wp=window.wp||{}).blockEditor=o}();
\ No newline at end of file +var CB=function(e,t){return CB=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])},CB(e,t)};var xB=function(){return xB=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},xB.apply(this,arguments)};Object.create;Object.create;var BB=n(7520),IB=n.n(BB);function TB(e,t,n,o,r){void 0===r&&(r=0);var l=OB(t.width,t.height,r),i=l.width,s=l.height;return{x:MB(e.x,i,n.width,o),y:MB(e.y,s,n.height,o)}}function MB(e,t,n,o){var r=t*o/2-n/2;return DB(e,-r,r)}function PB(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function RB(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function NB(e,t){return Math.min(e,Math.max(0,t))}function LB(e,t){return t}function AB(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function OB(e,t,n){var o=n*Math.PI/180;return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}function DB(e,t,n){return Math.min(Math.max(e,t),n)}function zB(){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 VB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=a().createRef(),n.videoRef=a().createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,o,r,l){var i=OB(t.width,t.height,n),s=DB(o.width/i.width*(100/e.width),r,l);return{crop:{x:s*i.width/2-o.width/2-i.width*s*(e.x/100),y:s*i.height/2-o.height/2-i.height*s*(e.y/100)},zoom:s}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),o=t.crop,r=t.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}else if(n.props.initialCroppedAreaPixels){var l=function(e,t,n,o,r,l){void 0===n&&(n=0);var i=OB(t.naturalWidth,t.naturalHeight,n),s=DB(function(e,t,n){var o=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*o):n.width/(e.width*o)}(e,t,o),r,l),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((i.width-e.width)/2-e.x)*a,y:((i.height-e.height)/2-e.y)*a},zoom:s}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);o=l.crop,r=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,l,i,s=n.imageRef.current||n.videoRef.current;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var a=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(o=n.imageRef.current)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef.current)||void 0===r?void 0:r.videoHeight)||0,d=c/u,p=void 0;if(s.offsetWidth<c||s.offsetHeight<u)switch(n.props.objectFit){default:case"contain":p=a>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:s.offsetWidth,height:s.offsetHeight};n.mediaSize=xB(xB({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:function(e,t,n,o,r,l){void 0===l&&(l=0);var i=OB(e,t,l),s=i.width,a=i.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*r?{width:u*r,height:u}:{width:c,height:c/r}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(l=n.state.cropSize)||void 0===l?void 0:l.height)===m.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var o=t.getMousePoint(e),r=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(r,o,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+e.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=xB({},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.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?TB(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=IB()(e).pixelY,l=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(l,o,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,l=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var i=DB(e,n.props.minZoom,n.props.maxZoom);if(l){var s=n.getPointOnContainer(t),a=n.getPointOnMedia(s),c={x:a.x*i-s.x,y:a.y*i-s.y},u=n.props.restrictPosition?TB(c,n.mediaSize,n.state.cropSize,i,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(i)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i?NB:LB,a=OB(t.width,t.height,l),c=OB(t.naturalWidth,t.naturalHeight,l),u={x:s(100,((a.width-n.width/r)/2-e.x/r)/a.width*100),y:s(100,((a.height-n.height/r)/2-e.y/r)/a.height*100),width:s(100,n.width/a.width*100/r),height:s(100,n.height/a.height*100/r)},d=Math.round(s(c.width,u.width*c.width/100)),p=Math.round(s(c.height,u.height*c.height/100)),m=c.width>=c.height*o?{width:Math.round(p*o),height:p}:{width:d,height:Math.round(d/o)};return{croppedAreaPercentages:u,croppedAreaPixels:xB(xB({},m),{x:Math.round(s(c.width-m.width,u.x*c.width/100)),y:Math.round(s(c.height-m.height,u.y*c.height/100))})}}(n.props.restrictPosition?TB(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?TB(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}CB(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,o,r,l,i,s,a,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(o=e.cropSize)||void 0===o?void 0:o.width)!==(null===(r=this.props.cropSize)||void 0===r?void 0:r.width)?this.computeSizes():(null===(l=e.crop)||void 0===l?void 0:l.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(a=this.props.crop)||void 0===a?void 0:a.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=PB(n,o),this.lastPinchRotation=RB(n,o),this.onDragStart(AB(n,o))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=AB(o,r);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=PB(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var i=RB(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.transform,i=t.crop,s=i.x,c=i.y,u=t.rotation,d=t.zoom,p=t.cropShape,m=t.showGrid,h=t.style,g=h.containerStyle,f=h.cropAreaStyle,b=h.mediaStyle,v=t.classes,k=v.containerClassName,_=v.cropAreaClassName,y=v.mediaClassName,E=t.objectFit;return a().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:g,className:zB("reactEasyCrop_Container",k)},n?a().createElement("img",xB({alt:"",className:zB("reactEasyCrop_Image","contain"===E&&"reactEasyCrop_Contain","horizontal-cover"===E&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===E&&"reactEasyCrop_Cover_Vertical","auto-cover"===E&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),y)},r,{src:n,ref:this.imageRef,style:xB(xB({},b),{transform:l||"translate(".concat(s,"px, ").concat(c,"px) rotate(").concat(u,"deg) scale(").concat(d,")")}),onLoad:this.onMediaLoad})):o&&a().createElement("video",xB({autoPlay:!0,loop:!0,muted:!0,className:zB("reactEasyCrop_Video","contain"===E&&"reactEasyCrop_Contain","horizontal-cover"===E&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===E&&"reactEasyCrop_Cover_Vertical","auto-cover"===E&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),y)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:xB(xB({},b),{transform:l||"translate(".concat(s,"px, ").concat(c,"px) rotate(").concat(u,"deg) scale(").concat(d,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return a().createElement("source",xB({key:e.src},e))}))),this.state.cropSize&&a().createElement("div",{style:xB(xB({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:zB("reactEasyCrop_CropArea","round"===p&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(a().Component);const FB=100,HB=300,GB={placement:"bottom-start"};function UB({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:l,borderProps:i}){const{isInProgress:a,editedUrl:c,position:u,zoom:d,aspect:p,setPosition:m,setCrop:h,setZoom:g,rotation:f}=wB();let b=n||o*r/l;return f%180==90&&(b=o*l/r),(0,s.createElement)("div",{className:ml()("wp-block-image__crop-area",i?.className,{"is-applying":a}),style:{...i?.style,width:t||o,height:b}},(0,s.createElement)(VB,{image:c||e,disabled:a,minZoom:FB/100,maxZoom:HB/100,crop:u,zoom:d/100,aspect:p,onCropChange:e=>{m(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{g(100*e)}}),a&&(0,s.createElement)(_l.Spinner,null))}const $B=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"}));function jB(){const{isInProgress:e,zoom:t,setZoom:n}=wB();return(0,s.createElement)(_l.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:GB,renderToggle:({isOpen:t,onToggle:n})=>(0,s.createElement)(_l.ToolbarButton,{icon:$B,label:(0,x.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,s.createElement)(_l.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Zoom"),min:FB,max:HB,value:Math.round(t),onChange:n})})}const WB=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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 KB({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,s.createElement)(_l.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,s.createElement)(_l.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?uu:void 0},e))))}function ZB({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=wB();return(0,s.createElement)(_l.DropdownMenu,{icon:WB,label:(0,x.__)("Aspect Ratio"),popoverProps:GB,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(KB,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,x.__)("Original"),aspect:r},{title:(0,x.__)("Square"),aspect:1}]}),(0,s.createElement)(KB,{label:(0,x.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,x.__)("16:9"),aspect:16/9},{title:(0,x.__)("4:3"),aspect:4/3},{title:(0,x.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(KB,{label:(0,x.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,x.__)("9:16"),aspect:9/16},{title:(0,x.__)("3:4"),aspect:3/4},{title:(0,x.__)("2:3"),aspect:2/3}]}))))}const qB=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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 YB(){const{isInProgress:e,rotateClockwise:t}=wB();return(0,s.createElement)(_l.ToolbarButton,{icon:qB,label:(0,x.__)("Rotate"),onClick:t,disabled:e})}function XB(){const{isInProgress:e,apply:t,cancel:n}=wB();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.ToolbarButton,{onClick:t,disabled:e},(0,x.__)("Apply")),(0,s.createElement)(_l.ToolbarButton,{onClick:n},(0,x.__)("Cancel")))}function QB({id:e,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i,onSaveImage:a,onFinishEditing:c,borderProps:u}){return(0,s.createElement)(SB,{id:e,url:t,naturalWidth:i,naturalHeight:l,onSaveImage:a,onFinishEditing:c},(0,s.createElement)(UB,{borderProps:u,url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Bl,null,(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(jB,null),(0,s.createElement)(_l.ToolbarItem,null,(e=>(0,s.createElement)(ZB,{toggleProps:e}))),(0,s.createElement)(YB,null)),(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(XB,null))))}const JB=[25,50,75,100],eI=()=>{};function tI({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=eI}){const{currentHeight:p,currentWidth:m,updateDimension:h,updateDimensions:g}=function(e,t,n,o,r){var l,i;const[s,a]=(0,u.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[c,d]=(0,u.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,u.useEffect)((()=>{void 0===t&&void 0!==o&&a(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,u.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(s)&&a(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&d(e)}),[t,e]),{currentHeight:c,currentWidth:s,updateDimension:(e,t)=>{const n=""===t?void 0:parseInt(t,10);"width"===e?a(n):d(n),r({[e]:n})},updateDimensions:(e,t)=>{d(null!=e?e:n),a(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,o&&o.length>0&&(0,s.createElement)(_l.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Resolution"),value:l,options:o,onChange:d,help:e,size:"__unstable-large"}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)(_l.__experimentalHStack,{align:"baseline",spacing:"3"},(0,s.createElement)(_l.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,x.__)("Width"),value:m,min:1,onChange:e=>h("width",e),size:"__unstable-large"}),(0,s.createElement)(_l.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,x.__)("Height"),value:p,min:1,onChange:e=>h("height",e),size:"__unstable-large"})),(0,s.createElement)(_l.__experimentalHStack,null,(0,s.createElement)(_l.ButtonGroup,{"aria-label":(0,x.__)("Image size presets")},JB.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=m===o&&p===r;return(0,s.createElement)(_l.Button,{key:e,size:"small",variant:l?"primary":void 0,isPressed:l,onClick:()=>g(r,o)},e,"%")}))),(0,s.createElement)(_l.Button,{size:"small",onClick:()=>g()},(0,x.__)("Reset")))))}function nI({url:e,urlLabel:t,className:n}){const o=ml()(n,"block-editor-url-popover__link-viewer-url");return e?(0,s.createElement)(_l.ExternalLink,{className:o,href:e},t||(0,Ds.filterURLForDisplay)((0,Ds.safeDecodeURI)(e))):(0,s.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:oI}=ie(_l.privateApis),rI=(0,u.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:l,...i},a)=>{let c;void 0!==l&&w()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?c=o:void 0!==l&&(c=oI(l)),c=c||"bottom";const[d,p]=(0,u.useState)(!1),m=!!n&&d;return(0,s.createElement)(_l.Popover,{ref:a,className:"block-editor-url-popover",focusOnMount:r,placement:c,shift:!0,variant:"toolbar",...i},(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,s.createElement)(_l.Button,{className:"block-editor-url-popover__settings-toggle",icon:cS,label:(0,x.__)("Link settings"),onClick:()=>{p(!d)},"aria-expanded":d,size:"compact"}))),m&&(0,s.createElement)("div",{className:"block-editor-url-popover__settings"},n()),e&&!m&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}));rI.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,s.createElement)("form",{className:ml()("block-editor-url-popover__link-editor",t),...r},(0,s.createElement)(ta,{__nextHasNoMarginBottom:!0,value:o,onChange:n,autocompleteRef:e}),(0,s.createElement)(_l.Button,{icon:Ks,label:(0,x.__)("Apply"),type:"submit",size:"compact"}))},rI.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...l}){return(0,s.createElement)("div",{className:ml()("block-editor-url-popover__link-viewer",e),...l},(0,s.createElement)(nI,{url:o,urlLabel:r,className:t}),n&&(0,s.createElement)(_l.Button,{icon:La,label:(0,x.__)("Edit"),onClick:n,size:"compact"}))};const lI=rI,iI=()=>{},sI=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,s.createElement)(lI,{anchor:r,onClose:o},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,x.__)("URL"),placeholder:(0,x.__)("Paste or type URL"),onChange:t,value:e}),(0,s.createElement)(_l.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Ks,label:(0,x.__)("Apply"),type:"submit"}))),aI=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:o,openURLInput:r,closeURLInput:l})=>{const[i,a]=(0,u.useState)(null);return(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container",ref:a},(0,s.createElement)(_l.Button,{className:"block-editor-media-placeholder__button",onClick:r,isPressed:e,variant:"tertiary"},(0,x.__)("Insert from URL")),e&&(0,s.createElement)(sI,{src:t,onChange:n,onSubmit:o,onClose:l,popoverAnchor:i}))};const cI=(0,_l.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:l,notices:i,isAppender:a,accept:p,addToGallery:m,multiple:h=!1,handleUpload:g=!0,disableDropZone:f,disableMediaButtons:b,onError:v,onSelect:k,onCancel:_,onSelectURL:y,onToggleFeaturedImage:E,onDoubleClick:S,onFilesPreUpload:C=iI,onHTMLDrop:B,children:I,mediaLibraryButton:T,placeholder:M,style:P}){B&&w()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const R=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return t().mediaUpload}),[]),[N,L]=(0,u.useState)(""),[A,O]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var t;L(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const D=e=>{L(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},F=e=>{e.preventDefault(),N&&y&&(y(N),V())},H=n=>{if(!g)return k(n);let o;if(C(n),h)if(m){let t=[];o=n=>{const o=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));k(o.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=k;else o=([e])=>k(e);R({allowedTypes:t,filesList:n,onFileChange:o,onError:v})};async function G(e){const n=(0,c.pasteHandler)({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const o=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,o)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((r=>R({filesList:[r],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:o}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>v(e)));k(h?o:o[0])}(n)}const U=e=>{H(e.target.files)},$=null!=M?M:e=>{let{instructions:c,title:u}=r;if(R||y||(c=(0,x.__)("To edit this block, you need permission to upload media.")),void 0===c||void 0===u){const e=null!=t?t:[],[n]=e,o=1===e.length,r=o&&"audio"===n,l=o&&"image"===n,i=o&&"video"===n;void 0===c&&R&&(c=(0,x.__)("Upload a media file or pick one from your media library."),r?c=(0,x.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?c=(0,x.__)("Upload an image file, pick one from your media library, or add one with a URL."):i&&(c=(0,x.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,x.__)("Media"),r?u=(0,x.__)("Audio"):l?u=(0,x.__)("Image"):i&&(u=(0,x.__)("Video")))}const d=ml()("block-editor-media-placeholder",n,{"is-appender":a});return(0,s.createElement)(_l.Placeholder,{icon:o,label:u,instructions:c,className:d,notices:i,onDoubleClick:S,preview:l,style:P},e,I)},j=()=>f?null:(0,s.createElement)(_l.DropZone,{onFilesDrop:H,onHTMLDrop:G}),W=()=>_&&(0,s.createElement)(_l.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,x.__)("Cancel"),variant:"link",onClick:_},(0,x.__)("Cancel")),K=()=>y&&(0,s.createElement)(aI,{isURLInputVisible:A,src:N,onChangeSrc:D,onSubmitSrc:F,openURLInput:z,closeURLInput:V}),Z=()=>E&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(_l.Button,{className:"block-editor-media-placeholder__button",onClick:E,variant:"tertiary"},(0,x.__)("Use featured image")));return b?(0,s.createElement)(Us,null,j()):(0,s.createElement)(Us,{fallback:$(K())},(()=>{const n=null!=T?T:({open:e})=>(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:()=>{e()}},(0,x.__)("Media Library")),o=(0,s.createElement)(Gs,{addToGallery:m,gallery:h&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:h,onSelect:k,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(R&&a)return(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(_l.FormFileUpload,{onChange:U,accept:p,multiple:!!h,render:({openFileDialog:e})=>{const t=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.Button,{variant:"primary",className:ml()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,x.__)("Upload")),o,K(),Z(),W());return $(t)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(_l.FormFileUpload,{variant:"primary",className:ml()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:p,multiple:!!h},(0,x.__)("Upload")),o,K(),Z(),W());return $(e)}return $(o)})())})),uI=({colorSettings:e,...t})=>{const n=e.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(yB,{settings:n,gradients:[],disableCustomGradients:!0,...t})},dI={placement:"bottom-start"},pI=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,s.createElement)(_l.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(_l.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,s.createElement)(_l.ToolbarItem,null,(n=>(0,s.createElement)(_l.DropdownMenu,{icon:cS,label:(0,x.__)("More"),toggleProps:{...n,className:ml()(n.className,{"is-pressed":t}),describedBy:(0,x.__)("Displays more block tools")},controls:ne(e.map((([{props:e}])=>e)),"title"),popoverProps:dI})))})));function mI({editableContentElement:e,activeFormats:t}){const n=t[t.length-1],o=n?.type,r=(0,d.useSelect)((e=>e(Y.store).getFormatType(o)),[o]),l=(0,Y.useAnchor)({editableContentElement:e,settings:r});return(0,s.createElement)(hI,{popoverAnchor:l})}function hI({popoverAnchor:e}){return(0,s.createElement)(_l.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)(NC,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,x.__)("Format tools")},(0,s.createElement)(_l.ToolbarGroup,null,(0,s.createElement)(pI,null))))}const gI=({inline:e,editableContentElement:t,value:n})=>{const o=(0,d.useSelect)((e=>e(Nr).getSettings().hasInlineToolbar),[]);if(e)return(0,s.createElement)(hI,{popoverAnchor:t});if(o){const e=(0,Y.getActiveFormats)(n);return(0,Y.isCollapsed)(n)&&!e.length?null:(0,s.createElement)(mI,{editableContentElement:t,activeFormats:e})}return(0,s.createElement)(Bl,{group:"inline"},(0,s.createElement)(pI,null))};function fI(){const{didAutomaticChange:e,getSettings:t}=(0,d.useSelect)(Nr);return(0,p.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==zs.DELETE&&o!==zs.BACKSPACE&&o!==zs.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function bI(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function vI({allowedFormats:e,disableFormats:t}){return t?vI.EMPTY_ARRAY:e}function kI({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o}){if(!n||!o)return;const{start:r=0,end:l=0}=e,i={...e,start:r,end:l},s=[],[a,c]=(0,Y.split)(i),u=t.length>0;let d=-1;const p=(0,Y.isEmpty)(a)&&!(0,Y.isEmpty)(c);u&&(0,Y.isEmpty)(a)||(s.push(o((0,Y.toHTMLString)({value:a}),!p)),d+=1),u&&(s.push(...t),d+=t.length),u&&(0,Y.isEmpty)(c)||s.push(o((0,Y.toHTMLString)({value:c}),p));n(s,u?d:1,u?-1:0)}function _I(e){const t=(0,u.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:r,value:l,formatTypes:i,tagName:s,onReplace:a,onSplit:u,__unstableEmbedURLOnPaste:d,pastePlainText:p}=t.current;if(!n)return;const{plainText:m,html:h,files:g}=ty(e);if(e.preventDefault(),window.console.log("Received HTML:\n\n",h),window.console.log("Received plain text:\n\n",m),o)return void r((0,Y.insert)(l,m));function f(e){const t=i.reduce(((e,{__unstablePasteRule:t})=>(t&&e===l&&(e=t(l,{html:h,plainText:m})),e)),l);if(t!==l)r(t);else{const t=(0,Y.create)({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,l.activeFormats),r((0,Y.insert)(l,t))}}if("true"===e.clipboardData.getData("rich-text"))return void f(h);if(p)return void r((0,Y.insert)(l,(0,Y.create)({text:m})));if(g?.length){window.console.log("Received items:\n\n",g);const e=(0,c.getBlockTransforms)("from"),t=g.reduce(((t,n)=>{const o=(0,c.findTransform)(e,(e=>"files"===e.type&&e.isMatch([n])));return o&&t.push(o.transform([n])),t}),[]).flat();if(!t.length)return;return void(a&&(0,Y.isEmpty)(l)?a(t):kI({value:l,pastedBlocks:t,onReplace:a,onSplit:u}))}let b=a&&u?"AUTO":"INLINE";const v=m.trim();d&&(0,Y.isEmpty)(l)&&(0,Ds.isURL)(v)&&/^https?:/.test(v)&&(b="BLOCKS");const k=(0,c.pasteHandler)({HTML:h,plainText:m,mode:b,tagName:s});"string"==typeof k?f(k):k.length>0&&(a&&(0,Y.isEmpty)(l)?a(k,k.length-1,-1):kI({value:l,pastedBlocks:k,onReplace:a,onSplit:u}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}vI.EMPTY_ARRAY=[];const yI=["`",'"',"'","“”","‘’"];function EI(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(Nr),o=(0,u.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(r){const{inputType:l,data:i}=r,{value:s,onChange:a}=o.current;if("insertText"!==l)return;if((0,Y.isCollapsed)(s))return;const c=(0,m.applyFilters)("blockEditor.wrapSelectionSettings",yI).find((([e,t])=>e===i||t===i));if(!c)return;const[u,d=u]=c,p=s.start,h=s.end+u.length;let g=(0,Y.insert)(s,u,p,p);g=(0,Y.insert)(g,d,h,h),t(),a(g),n();const f={};for(const e in r)f[e]=r[e];f.data=d;const{ownerDocument:b}=e,{defaultView:v}=b,k=new v.InputEvent("input",f);window.queueMicrotask((()=>{r.target.dispatchEvent(k)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function wI(e){let t=e.length;for(;t--;){const n=_o(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(ko,""),[e[t].clientId,n,0,0];const o=wI(e[t].innerBlocks);if(o)return o}return[]}function SI(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(Nr),o=(0,u.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(){const{getValue:e,onReplace:t,selectionChange:r}=o.current;if(!t)return;const l=e(),{start:i,text:s}=l;if(" "!==s.slice(i-1,i))return;const a=s.slice(0,i).trim(),u=(0,c.getBlockTransforms)("from").filter((({type:e})=>"prefix"===e)),d=(0,c.findTransform)(u,(({prefix:e})=>a===e));if(!d)return;const p=(0,Y.toHTMLString)({value:(0,Y.insert)(l,ko,0,i)}),m=d.transform(p);return r(...wI([m])),t([m]),n(),!0}function l(e){const{inputType:l,type:i}=e,{getValue:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==l&&"compositionend"!==i)return;if(c&&r())return;const d=s(),p=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<18||o.slice(n-18,n).toLowerCase()!==t?e:(0,Y.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d));p!==d&&(t(),a({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",l),e.addEventListener("compositionend",l),()=>{e.removeEventListener("input",l),e.removeEventListener("compositionend",l)}}),[])}function CI(e){const t=(0,u.useRef)(e);return t.current=e,(0,p.useRefEffect)((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:o,onMerge:r,onRemove:l}=t.current;if(n===zs.DELETE||n===zs.BACKSPACE){const{start:t,end:i,text:s}=o,a=n===zs.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,Y.isCollapsed)(o)||c||a&&0!==t||!a&&i!==s.length)return;r?r(!a):l&&(0,Y.isEmpty)(o)&&a&&l(!a),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function xI(e){const t=(0,d.useRegistry)(),{__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(Nr),o=(0,u.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(e){if("true"!==e.target.contentEditable)return;if(e.defaultPrevented)return;if(e.keyCode!==zs.ENTER)return;const{removeEditorOnlyFormats:r,value:l,onReplace:i,onSplit:s,onChange:a,disableLineBreaks:u,onSplitAtEnd:d,onSplitAtDoubleLineEnd:p}=o.current;e.preventDefault();const m={...l};m.formats=r(l);const h=i&&s;if(i){const e=(0,c.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),t=(0,c.findTransform)(e,(e=>e.regExp.test(m.text)));if(t)return i([t.transform({content:m.text})]),void n()}const{text:g,start:f,end:b}=m;e.shiftKey?u||a((0,Y.insert)(m,"\n")):h?kI({value:m,onReplace:i,onSplit:s}):d&&f===b&&b===g.length?d():p&&f===b&&b===g.length&&"\n\n"===g.slice(-2)?t.batch((()=>{m.start=m.end-2,a((0,Y.remove)(m)),p()})):u||a((0,Y.insert)(m,"\n"))}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function BI(e){return e(Y.store).getFormatTypes()}const II=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function TI(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function MI(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,o)=>(n[o.slice(t.length+1)]=e[o],n)),{})}function PI(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function RI(e){return(0,p.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function NI(){const{__unstableMarkLastChangeAsPersistent:e}=(0,d.useDispatch)(Nr);return(0,p.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function LI(){const{isMultiSelecting:e}=(0,d.useSelect)(Nr);return(0,p.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)}}),[])}const AI={},OI=Symbol("usesContext");function DI({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:l,edit:i,[OI]:a}=r,c=(0,u.useContext)(bf),d=(0,u.useMemo)((()=>a?Object.fromEntries(Object.entries(c).filter((([e])=>a.includes(e)))):AI),[a,c]);if(!i)return null;const p=(0,Y.getActiveFormat)(n,l),m=void 0!==p,h=(0,Y.getActiveObject)(n),g=void 0!==h&&h.type===l;return(0,s.createElement)(i,{key:l,isActive:m,activeAttributes:m&&p.attributes||{},isObjectActive:g,activeObjectAttributes:g&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:d})}function zI({formatTypes:e,...t}){return e.map((e=>(0,s.createElement)(DI,{settings:e,...t,key:e.name})))}function VI({value:e,tagName:t,multiline:n,format:o,...r}){if(KI.isEmpty(e)){const t=bI(n);e=t?(0,s.createElement)(t,null):null}else Array.isArray(e)?(w()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e=(0,s.createElement)(u.RawHTML,null,c.children.toHTML(e))):e="string"==typeof e?(0,s.createElement)(u.RawHTML,null,e):(0,s.createElement)(u.RawHTML,null,e.toHTMLString());return t?(0,s.createElement)(t,{...r},e):e}const FI=(0,u.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:l,...i},a){w()("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:c}=y(),{selectionChange:u}=(0,d.useDispatch)(Nr),p=bI(l),m=`</${p}>${o=o||`<${p}></${p}>`}<${p}>`.split(`</${p}><${p}>`);function h(e){r(`<${p}>${e.join(`</${p}><${p}>`)}</${p}>`)}return m.shift(),m.pop(),(0,s.createElement)(n,{ref:a},m.map(((e,n)=>(0,s.createElement)(UI,{key:n,identifier:`${t}-${n}`,tagName:p,value:e,onChange:e=>{const t=m.slice();t[n]=e,h(t)},isSelected:void 0,onSplit:e=>e,onReplace:e=>{const o=m.slice();o.splice(n,1,...e),h(o),u(c,`${t}-${n+1}`,0,0)},onMerge:e=>{const o=m.slice();let r=0;if(e){if(!o[n+1])return;o.splice(n,2,o[n]+o[n+1]),r=o[n].length-1}else{if(!o[n-1])return;o.splice(n-1,2,o[n-1]+o[n]),r=o[n-1].length-1}h(o),u(c,`${t}-${n-(e?0:1)}`,r,r)},...i}))))}));const HI=(0,u.createContext)(),GI=(0,u.createContext)();function UI({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:l,inlineToolbar:i,wrapperClassName:a,autocompleters:m,onReplace:h,placeholder:g,allowedFormats:f,withoutInteractiveFormatting:v,onRemove:k,onMerge:_,onSplit:E,__unstableOnSplitAtEnd:w,__unstableOnSplitAtDoubleLineEnd:S,identifier:C,preserveWhiteSpace:x,__unstablePastePlainText:B,__unstableEmbedURLOnPaste:I,__unstableDisableFormats:T,disableLineBreaks:M,__unstableAllowPrefixTransformations:P,disableEditing:R,...N},L){N=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:l,tagsToEliminate:i,disableEditingMenu:s,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:m,setRef:h,disableSuggestions:g,disableAutocorrection:f,...b}=e;return b}(N);const A=(0,u.useRef)(),O=y(),{clientId:D,isSelected:z,name:V}=O,F=O[b],{selectionStart:H,selectionEnd:G,isSelected:U}=(0,d.useSelect)((e=>{if(!z)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(Nr),o=t(),l=n();let i;return void 0===r?i=o.clientId===D&&l.clientId===D&&o.attributeKey===C:r&&(i=o.clientId===D),{selectionStart:i?o.offset:void 0,selectionEnd:i?l.offset:void 0,isSelected:i}}),[D,C,r,z]),$=(0,d.useSelect)((e=>{let t=!1;if(F&&eg(V)){const n=(0,c.getBlockType)(V).attributes,{getBlockBindingsSource:o}=ie(e(c.store));for(const[e,r]of Object.entries(F)){if("rich-text"!==n?.[e]?.source)break;const l=o(r.source);if(!l||l.lockAttributesEditing){t=!0;break}}}return t}),[F,V]),j=R||$,{getSelectionStart:W,getSelectionEnd:K,getBlockRootClientId:Z}=(0,d.useSelect)(Nr),{selectionChange:q}=(0,d.useDispatch)(Nr),X=vI({allowedFormats:f,disableFormats:T}),Q=!X||X.length>0,J=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&Z(D)!==Z(K().clientId))return;n.start={clientId:D,attributeKey:C,offset:e}}if("number"==typeof t||o){if(void 0===e&&Z(D)!==Z(W().clientId))return;n.end={clientId:D,attributeKey:C,offset:t}}q(n)}),[D,C]),{formatTypes:ee,prepareHandlers:te,valueHandlers:ne,changeHandlers:oe,dependencies:re}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,d.useSelect)(BI,[]),l=(0,u.useMemo)((()=>r.filter((({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||II.has(r)))))),[r,o,n]),i=(0,d.useSelect)((n=>l.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...TI(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[l,e,t]),s=(0,d.useDispatch)(),a=[],c=[],p=[],m=[];for(const e in i)m.push(i[e]);return l.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(MI(i,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?c.push(o):a.push(o)}if(n.__experimentalCreateOnChangeEditableValue){let o={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(o=n.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:t,blockClientId:e}));const r=MI(i,n.name);p.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:l,prepareHandlers:a,valueHandlers:c,changeHandlers:p,dependencies:m}}({clientId:D,identifier:C,withoutInteractiveFormatting:v,allowedFormats:X});function le(e){return ee.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Y.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:se,getValue:ae,onChange:ce,ref:ue}=(0,Y.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(oe).forEach((e=>{e(t,n)}))},selectionStart:H,selectionEnd:G,onSelectionChange:J,placeholder:g,__unstableIsSelected:U,__unstableDisableFormats:T,preserveWhiteSpace:x,__unstableDependencies:[...re,t],__unstableAfterParse:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:le,__unstableAddInvisibleFormats:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)}}),de=function(e){return(0,_l.__unstableUseAutocompleteProps)({...e,completers:rf(e)})}({onReplace:h,completers:m,record:se,onChange:ce});!function({html:e,value:t}){const n=(0,u.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,d.useDispatch)(Nr);(0,u.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{r()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text}),[e,o])}({html:n,value:se});const pe=(0,u.useRef)(new Set),me=(0,u.useRef)(new Set);function he(){A.current?.focus()}const ge=t;return(0,s.createElement)(s.Fragment,null,U&&(0,s.createElement)(HI.Provider,{value:pe},(0,s.createElement)(GI.Provider,{value:me},(0,s.createElement)(_l.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},e&&e({value:se,onChange:ce,onFocus:he}),(0,s.createElement)(zI,{value:se,onChange:ce,onFocus:he,formatTypes:ee,forwardedRef:A})))),U&&Q&&(0,s.createElement)(gI,{inline:i,editableContentElement:A.current,value:se}),(0,s.createElement)(ge,{role:"textbox","aria-multiline":!M,"aria-label":g,"aria-readonly":j,...N,...de,ref:(0,p.useMergeRefs)([ue,L,de.ref,N.ref,EI({value:se,onChange:ce}),SI({getValue:ae,onChange:ce,__unstableAllowPrefixTransformations:P,formatTypes:ee,onReplace:h,selectionChange:q}),NI(),(0,p.useRefEffect)((e=>{function t(e){(zs.isKeyboardEvent.primary(e,"z")||zs.isKeyboardEvent.primary(e,"y")||zs.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[]),PI(pe),RI(me),fI(),_I({isSelected:U,disableFormats:T,onChange:ce,value:se,formatTypes:ee,tagName:t,onReplace:h,onSplit:E,__unstableEmbedURLOnPaste:I,pastePlainText:B}),CI({value:se,onMerge:_,onRemove:k}),xI({removeEditorOnlyFormats:le,value:se,onReplace:h,onSplit:E,onChange:ce,disableLineBreaks:M,onSplitAtEnd:w,onSplitAtDoubleLineEnd:S}),LI(),A]),contentEditable:!j,suppressContentEditableWarning:!0,className:ml()("block-editor-rich-text__editable",N.className,"rich-text"),tabIndex:0!==N.tabIndex||j?N.tabIndex:null,"data-wp-block-attribute-key":C}))}const $I=(jI=(0,u.forwardRef)(UI),(0,u.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(w()("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),n=c.children.toHTML(e.value),o=t=>e.onChange(c.children.fromDOM((0,Y.__unstableCreateElement)(document,t).childNodes)));const r=e.multiline?FI:jI,l=(0,p.useInstanceId)(r);return(0,s.createElement)(r,{...e,identifier:e.identifier||l,value:n,onChange:o,ref:t})})));var jI;$I.Content=VI,$I.isEmpty=e=>!e||0===e.length;const WI=(0,u.forwardRef)(((e,t)=>(0,s.createElement)($I,{ref:t,...e,disableEditing:!1})));WI.Content=VI,WI.isEmpty=e=>!e||0===e.length;const KI=WI,ZI=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(KI,{ref:t,...e,__unstableDisableFormats:!0})));ZI.Content=({value:e="",tagName:t="div",...n})=>(0,s.createElement)(t,{...n},e);const qI=ZI,YI=(0,u.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,s.createElement)(qI,{ref:n,...t});const{className:o,onChange:r,...l}=t;return(0,s.createElement)(Nf.A,{ref:n,className:ml()("block-editor-plain-text",o),onChange:e=>r(e.target.value),...l})}));function XI({property:e,viewport:t,desc:n}){const o=(0,p.useInstanceId)(XI),r=n||(0,x.sprintf)((0,x._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."),e,t.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${o}`},t.label),(0,s.createElement)(_l.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}const QI=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:c={id:"all",label:(0,x._x)("All","screen sizes")},viewports:d=[{id:"small",label:(0,x.__)("Small screens")},{id:"medium",label:(0,x.__)("Medium screens")},{id:"large",label:(0,x.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const p=o||(0,x.sprintf)((0,x.__)("Use the same %s on all screensizes."),n),m=(0,x.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(XI,{property:n,viewport:c}),c);return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:m}),(0,s.createElement)("div",{className:ml()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(u.Fragment,{key:e.id},l((0,s.createElement)(XI,{property:n,viewport:e}),e))))))))};function JI({character:e,type:t,onUse:n}){const o=(0,u.useContext)(HI),r=(0,u.useRef)();return r.current=n,(0,u.useEffect)((()=>{function n(n){zs.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function eT({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,l="RichText.ToolbarControls";return e&&(l+=`.${e}`),t&&n&&(r=zs.displayShortcut[t](n)),(0,s.createElement)(_l.Fill,{name:l},(0,s.createElement)(_l.ToolbarButton,{...o,shortcut:r}))}function tT({inputType:e,onInput:t}){const n=(0,u.useContext)(GI),o=(0,u.useRef)();return o.current=t,(0,u.useEffect)((()=>{function t(t){t.inputType===e&&(o.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}const nT=(0,s.createElement)(_l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(_l.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"}));const oT=(0,u.forwardRef)((function(e,t){const n=(0,d.useSelect)((e=>e(Nr).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,d.useDispatch)(Nr);return(0,s.createElement)(_l.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,s.createElement)(_l.Button,{...e,ref:t,icon:"navigation"===n?nT:La,"aria-expanded":o,"aria-haspopup":"true",onClick:r,label:(0,x.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.NavigableMenu,{role:"menu","aria-label":(0,x.__)("Tools")},(0,s.createElement)(_l.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ti,{icon:La}),(0,x.__)("Edit"))},{value:"navigation",label:(0,s.createElement)(s.Fragment,null,nT,(0,x.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,x.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function rT({units:e,...t}){const[n]=Ar("spacing.units"),o=(0,_l.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,s.createElement)(_l.__experimentalUnitControl,{units:o,...t})}const lT=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class iT extends u.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,x.__)("Edit link"):(0,x.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(_l.Button,{icon:ru,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(_l.Button,{className:"block-editor-url-input__back",icon:lT,label:(0,x.__)("Close"),onClick:this.toggle}),(0,s.createElement)(ta,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,s.createElement)(_l.Button,{icon:Ks,label:(0,x.__)("Submit"),type:"submit"}))))}}const sT=iT,aT=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.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-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),cT="none",uT="custom",dT="media",pT="attachment",mT=["noreferrer","noopener"],hT=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:l,linkTarget:i,linkClass:a,rel:c,showLightboxSetting:d,lightboxEnabled:p,onSetLightbox:m})=>{const[h,g]=(0,u.useState)(!1),[f,b]=(0,u.useState)(null),[v,k]=(0,u.useState)(!1),[_,y]=(0,u.useState)(null),E=(0,u.useRef)(null),w=(0,u.useRef)();(0,u.useEffect)((()=>{if(!w.current)return;(As.focus.focusable.find(w.current)[0]||w.current).focus()}),[v,n,p]);const S=()=>{k(!1)},C=()=>{const e=[{linkDestination:dT,title:(0,x.__)("Link to image file"),url:"image"===o?r:void 0,icon:aT}];return"image"===o&&l&&e.push({linkDestination:pT,title:(0,x.__)("Link to attachment page"),url:"image"===o?l:void 0,icon:la}),e},B=(0,s.createElement)(_l.__experimentalVStack,{spacing:"3"},(0,s.createElement)(_l.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");mT.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===mT.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Link rel"),value:null!=c?c:"",onChange:e=>{t({rel:e})}}),(0,s.createElement)(_l.TextControl,{__nextHasNoMarginBottom:!0,label:(0,x.__)("Link CSS class"),value:a||"",onChange:e=>{t({linkClass:e})}})),I=null!==_?_:n,T=!0==(!I&&!p),M=(C().find((t=>t.linkDestination===e))||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.ToolbarButton,{icon:ru,className:"components-toolbar__control",label:(0,x.__)("Link"),"aria-expanded":h,onClick:()=>{g(!0)},ref:b,isActive:!!n||p}),h&&(0,s.createElement)(lI,{ref:w,anchor:f,onFocusOutside:e=>{const t=E.current;t&&t.contains(e.target)||(g(!1),y(null),S())},onClose:()=>{y(null),S(),g(!1)},renderSettings:p?null:()=>B,additionalControls:T&&(0,s.createElement)(_l.NavigableMenu,null,C().map((e=>(0,s.createElement)(_l.MenuItem,{key:e.linkDestination,icon:e.icon,iconPosition:"left",onClick:()=>{y(null),(e=>{const n=C();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:uT}).linkDestination:cT,t({linkDestination:o,href:e})})(e.url),S()}},e.title))),d&&(0,s.createElement)(_l.MenuItem,{key:"expand-on-click",className:"block-editor-url-popover__expand-on-click",icon:sf,info:(0,x.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{y(null),t({linkDestination:cT,href:""}),m(!0),S()}},(0,x.__)("Expand on click"))),offset:13},(!n||v)&&!p&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lI.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:I,onChangeInputValue:y,onSubmit:e=>{if(_){const e=C().find((e=>e.url===_))?.linkDestination||uT;t({href:_,linkDestination:e,lightbox:{enabled:!1}})}S(),y(null),e.preventDefault()},autocompleteRef:E})),n&&!v&&!p&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lI.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==dT&&e!==pT||y(""),k(!0)},urlLabel:M}),(0,s.createElement)(_l.Button,{icon:Aa,label:(0,x.__)("Remove link"),onClick:()=>{t({linkDestination:cT,href:""})},size:"compact"})),!n&&!v&&p&&(0,s.createElement)("div",{className:"block-editor-url-popover__expand-on-click"},(0,s.createElement)(Ti,{icon:sf}),(0,s.createElement)("div",{className:"text"},(0,s.createElement)("p",null,(0,x.__)("Expand on click")),(0,s.createElement)("p",{className:"description"},(0,x.__)("Scales the image with a lightbox effect"))),(0,s.createElement)(_l.Button,{icon:Aa,label:(0,x.__)("Disable expand on click"),onClick:()=>{m(!1)},size:"compact"}))))};function gT(){return w()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function fT(e){const[t,n]=(0,u.useState)(window.innerWidth);(0,u.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px",n=(window.innerHeight<800?36:72)+"px",r="auto";switch(e){case"Tablet":case"Mobile":return{width:o(e),marginTop:n,marginBottom:n,marginLeft:r,marginRight:r,height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return{marginLeft:r,marginRight:r}}})(e)}const bT=(0,d.withSelect)((e=>({selectedBlockClientId:e(Nr).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=fd(e);return e?(0,s.createElement)(_l.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,x.__)("Skip to the selected block")):null})),vT=window.wp.wordcount;const kT=(0,d.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Nr);return{blocks:t()}}))((function({blocks:e}){const t=(0,vT.count)((0,c.serialize)(e),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(qh,{icon:SS,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,x.sprintf)((0,x._n)("%d Block","%d Blocks",e.length),e.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,x.sprintf)((0,x._n)("%d word selected.","%d words selected.",t),t))))}));function _T({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,d.useSelect)((t=>{var n;const o=t(Nr).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:o?.value?.[e],onUpdatePreferredStyleVariations:null!==(n=o?.onChange)&&void 0!==n?n:null,styles:t(c.store).getBlockStyles(e)}}),[e]),r=(0,u.useMemo)((()=>[{label:(0,x.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),l=(0,u.useMemo)((()=>NS(o)?.name),[o]),i=(0,u.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==l?n&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(_l.SelectControl,{__nextHasNoMarginBottom:!0,options:r,value:t||"",label:(0,x.__)("Default Style"),onChange:i})):null}const yT=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),ET=(0,s.createElement)(Z.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(Z.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"})),wT={name:"settings",title:(0,x.__)("Settings"),value:"settings",icon:yT,className:"block-editor-block-inspector__tab-item"},ST={name:"styles",title:(0,x.__)("Styles"),value:"styles",icon:ET,className:"block-editor-block-inspector__tab-item"},CT={name:"list",title:(0,x.__)("List View"),value:"list-view",icon:XC,className:"block-editor-block-inspector__tab-item"},xT=()=>{const e=(0,_l.__experimentalUseSlotFills)(xs.slotName);return Boolean(e&&e.length)?(0,s.createElement)(_l.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,x.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Bs.Slot,{group:"advanced"})):null},BT=()=>{const[e,t]=(0,u.useState)(),{multiSelectedBlocks:n}=(0,d.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(Nr);return{multiSelectedBlocks:t(n())}}),[]);return(0,u.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,s.createElement)(_l.PanelBody,{className:"block-editor-block-inspector__position",title:(0,x.__)("Position"),initialOpen:null!=e&&e},(0,s.createElement)(Bs.Slot,{group:"position"}))},IT=()=>{const e=(0,_l.__experimentalUseSlotFills)(vs.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,s.createElement)(BT,null):null},TT=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.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"})),MT="isInspectorControlsTabsHintVisible";function PT(){const e=(0,d.useSelect)((e=>{var t;return null===(t=e(Ws.store).get("core",MT))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,d.useDispatch)(Ws.store);return e?(0,s.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,s.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,x.__)("Looking for other block settings? They've moved to the styles tab.")),(0,s.createElement)(_l.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:TT,iconSize:"16",label:(0,x.__)("Dismiss hint"),onClick:()=>{const e=As.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",MT,!1)},showTooltip:!1})):null}const RT=({showAdvancedControls:e=!1})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bs.Slot,null),(0,s.createElement)(IT,null),e&&(0,s.createElement)("div",null,(0,s.createElement)(xT,null)),(0,s.createElement)(PT,null)),NT=({blockName:e,clientId:t,hasBlockStyles:n})=>{const o=zu({blockName:e});return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)("div",null,(0,s.createElement)(_l.PanelBody,{title:(0,x.__)("Styles")},(0,s.createElement)(Ax,{clientId:t}),(0,c.hasBlockSupport)(e,"defaultStylePicker",!0)&&(0,s.createElement)(_T,{blockName:e}))),(0,s.createElement)(Bs.Slot,{group:"color",label:(0,x.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Bs.Slot,{group:"background",label:(0,x.__)("Background")}),(0,s.createElement)(Bs.Slot,{group:"filter"}),(0,s.createElement)(Bs.Slot,{group:"typography",label:(0,x.__)("Typography")}),(0,s.createElement)(Bs.Slot,{group:"dimensions",label:(0,x.__)("Dimensions")}),(0,s.createElement)(Bs.Slot,{group:"border",label:o}),(0,s.createElement)(Bs.Slot,{group:"styles"}))},LT=["core/navigation"],AT=e=>!LT.includes(e),{Tabs:OT}=ie(_l.privateApis);function DT({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=AT(e)?void 0:CT.name;return(0,s.createElement)("div",{className:"block-editor-block-inspector__tabs"},(0,s.createElement)(OT,{initialTabId:r,key:t},(0,s.createElement)(OT.TabList,null,o.map((e=>(0,s.createElement)(OT.Tab,{key:e.name,tabId:e.name,render:(0,s.createElement)(_l.Button,{icon:e.icon,label:e.title,className:e.className})})))),(0,s.createElement)(OT.TabPanel,{tabId:wT.name,focusable:!1},(0,s.createElement)(RT,{showAdvancedControls:!!e})),(0,s.createElement)(OT.TabPanel,{tabId:ST.name,focusable:!1},(0,s.createElement)(NT,{blockName:e,clientId:t,hasBlockStyles:n})),(0,s.createElement)(OT.TabPanel,{tabId:CT.name,focusable:!1},(0,s.createElement)(Bs.Slot,{group:"list"}))))}const zT=[];function VT(e){const t=[],{border:n,color:o,default:r,dimensions:l,list:i,position:s,styles:a,typography:c,effects:u}=vs,p=AT(e),m=(0,_l.__experimentalUseSlotFills)(i.Slot.__unstableName),h=!p&&!!m&&m.length,g=[...(0,_l.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(l.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(c.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(u.Slot.__unstableName)||[]].length,f=(0,_l.__experimentalUseSlotFills)(xs.slotName)||[],b=[...(0,_l.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,_l.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...h&&g>1?f:[]];h&&t.push(CT),b.length&&t.push(wT),g&&t.push(ST);const v=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,d.useSelect)((e=>e(Nr).getSettings().blockInspectorTabs),[]));return v?t:zT}const{createPrivateSlotFill:FT}=ie(_l.privateApis),{Fill:HT,Slot:GT}=FT("BlockInformation"),UT=e=>y()[h]?(0,s.createElement)(HT,{...e}):null;UT.Slot=e=>(0,s.createElement)(GT,{...e});const $T=UT;function jT({clientIds:e}){return e.length?(0,s.createElement)(_l.__experimentalVStack,{spacing:1},e.map((e=>(0,s.createElement)(WT,{key:e,clientId:e})))):null}function WT({clientId:e}){const{name:t,icon:n,isSelected:o}=(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o,isBlockSelected:r,hasSelectedInnerBlock:l}=t(Nr),{getBlockType:i}=t(c.store),s=i(n(e)),a=o(e);return{name:s&&(0,c.__experimentalGetBlockLabel)(s,a,"list-view"),icon:s?.icon,isSelected:r(e)||l(e,!0)}}),[e]),{selectBlock:r}=(0,d.useDispatch)(Nr);return(0,s.createElement)(_l.Button,{isPressed:o,onClick:()=>r(e)},(0,s.createElement)(_l.Flex,null,(0,s.createElement)(_l.FlexItem,null,(0,s.createElement)(qh,{icon:n})),(0,s.createElement)(_l.FlexBlock,{style:{textAlign:"left"}},(0,s.createElement)(_l.__experimentalTruncate,null,t))))}function KT({topLevelLockedBlock:e}){const t=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=t(Nr);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=ih(e);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(P_,{...n,className:n.isSynced&&"is-synced"}),(0,s.createElement)(iB,{blockClientId:e}),(0,s.createElement)($T.Slot,null),t.length>0&&(0,s.createElement)(_l.PanelBody,{title:(0,x.__)("Content")},(0,s.createElement)(jT,{clientIds:t})))}const ZT=({animate:e,wrapper:t,children:n})=>e?t(n):n,qT=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,s.createElement)(_l.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:t},n)},YT=({clientId:e,blockName:t})=>{const n=VT(t),o=n?.length>1,r=(0,d.useSelect)((e=>{const{getBlockStyles:n}=e(c.store),o=n(t);return o&&o.length>0}),[t]),l=ih(e),i=zu({blockName:t});return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(P_,{...l,className:l.isSynced&&"is-synced"}),(0,s.createElement)(iB,{blockClientId:e}),(0,s.createElement)($T.Slot,null),o&&(0,s.createElement)(DT,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,s.createElement)(s.Fragment,null,r&&(0,s.createElement)("div",null,(0,s.createElement)(_l.PanelBody,{title:(0,x.__)("Styles")},(0,s.createElement)(Ax,{clientId:e}),(0,c.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,s.createElement)(_T,{blockName:t}))),(0,s.createElement)(Bs.Slot,null),(0,s.createElement)(Bs.Slot,{group:"list"}),(0,s.createElement)(Bs.Slot,{group:"color",label:(0,x.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Bs.Slot,{group:"typography",label:(0,x.__)("Typography")}),(0,s.createElement)(Bs.Slot,{group:"dimensions",label:(0,x.__)("Dimensions")}),(0,s.createElement)(Bs.Slot,{group:"border",label:i}),(0,s.createElement)(Bs.Slot,{group:"styles"}),(0,s.createElement)(Bs.Slot,{group:"background",label:(0,x.__)("Background")}),(0,s.createElement)(IT,null),(0,s.createElement)("div",null,(0,s.createElement)(xT,null))),(0,s.createElement)(bT,{key:"back"}))},XT=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:l}=e(Nr),i=t(),s=i&&o(i),a=s&&(0,c.getBlockType)(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,topLevelLockedBlock:r(i)||("contentOnly"===l(i)||"core/block"===s?i:void 0)}}),[]),i=VT(r?.name),a=i?.length>1,u=function(e,t){return(0,d.useSelect)((t=>{if(e){const n=t(Nr).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:l}=t(Nr);return l(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[t,e])}(r,o),p=zu({blockName:n});if(t>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(kT,null),a?(0,s.createElement)(DT,{tabs:i}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Bs.Slot,null),(0,s.createElement)(Bs.Slot,{group:"color",label:(0,x.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Bs.Slot,{group:"typography",label:(0,x.__)("Typography")}),(0,s.createElement)(Bs.Slot,{group:"dimensions",label:(0,x.__)("Dimensions")}),(0,s.createElement)(Bs.Slot,{group:"border",label:p}),(0,s.createElement)(Bs.Slot,{group:"styles"})));const m=n===(0,c.getUnregisteredTypeHandlerName)();return r&&o&&!m?l?(0,s.createElement)(KT,{topLevelLockedBlock:l}):(0,s.createElement)(ZT,{animate:u,wrapper:e=>(0,s.createElement)(qT,{blockInspectorAnimationSettings:u,selectedBlockClientId:o},e)},(0,s.createElement)(YT,{clientId:o,blockName:r.name})):e?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,x.__)("No block selected.")):null},QT=()=>(w()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),ly());function JT(e){return w()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,s.createElement)("div",{...e,ref:ly()})}const eM=()=>{};const tM=(0,u.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:l,__experimentalFilterValue:i,onSelect:a=eM,shouldFocusBlock:c=!1},u){const{destinationRootClientId:p}=(0,d.useSelect)((n=>{const{getBlockRootClientId:o}=n(Nr);return{destinationRootClientId:e||o(t)||void 0}}),[t,e]);return(0,s.createElement)(ew,{onSelect:a,rootClientId:p,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:l,__experimentalFilterValue:i,shouldFocusBlock:c,ref:u})}));function nM(){return w()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const oM=-1!==window.navigator.userAgent.indexOf("Trident"),rM=new Set([zs.UP,zs.DOWN,zs.LEFT,zs.RIGHT]),lM=.75;function iM(){const e=(0,d.useSelect)((e=>e(Nr).hasSelectedBlock()),[]);return(0,p.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c({keyCode:e}){if(!m())return;const r=(0,As.computeCaretRect)(o);if(!r)return;if(!i)return void(i=r);if(rM.has(e))return void(i=r);const l=r.top-i.top;if(0===l)return;const s=(0,As.getScrollContainer)(t);if(!s)return;const a=s===n.body||s===n.documentElement,c=a?o.scrollY:s.scrollTop,u=a?0:s.getBoundingClientRect().top,d=a?i.top/o.innerHeight:(i.top-u)/(o.innerHeight-u);if(0===c&&d<lM&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=r);const p=a?o.innerHeight:s.clientHeight;i.top+i.height>u+p||i.top<u?i=r:a?o.scrollBy(0,l):s.scrollTop+=l}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,As.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}const sM=oM?e=>e.children:function({children:e}){return(0,s.createElement)("div",{ref:iM(),className:"block-editor__typewriter"},e)},aM=(0,u.createContext)({});function cM({children:e,uniqueId:t,blockName:n=""}){const o=(0,u.useContext)(aM),{name:r}=y();n=n||r;const l=(0,u.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,n,t)),[o,n,t]);return(0,s.createElement)(aM.Provider,{value:l},e)}function uM(e,t=""){const n=(0,u.useContext)(aM),{name:o}=y();return t=t||o,Boolean(n[t]?.has(e))}const dM=e=>(w()("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,s.createElement)(cM,{...e})),pM=e=>(w()("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),uM(...e)),mM=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function hM({title:e,help:t,actions:n=[],onClose:o}){return(0,s.createElement)(_l.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,s.createElement)(_l.__experimentalHStack,{alignment:"center"},(0,s.createElement)(_l.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},e),(0,s.createElement)(_l.__experimentalSpacer,null),n.map((({label:e,icon:t,onClick:n})=>(0,s.createElement)(_l.Button,{key:e,className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n},!t&&e))),o&&(0,s.createElement)(_l.Button,{className:"block-editor-inspector-popover-header__action",label:(0,x.__)("Close"),icon:mM,onClick:o})),t&&(0,s.createElement)(_l.__experimentalText,null,t))}const gM=(0,u.forwardRef)((function({onClose:e,onChange:t,...n},o){return(0,s.createElement)("div",{ref:o,className:"block-editor-publish-date-time-picker"},(0,s.createElement)(hM,{title:(0,x.__)("Publish"),actions:[{label:(0,x.__)("Now"),onClick:()=>t?.(null)}],onClose:e}),(0,s.createElement)(_l.DateTimePicker,{startOfWeek:(0,uB.getSettings)().l10n.startOfWeek,onChange:t,...n}))})),fM=window.wp.commands,bM=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})),vM=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})),kM=(0,s.createElement)(Z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(Z.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})),_M=()=>{const{replaceBlocks:e,multiSelect:t}=(0,d.useDispatch)(Nr),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:l}=(0,d.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:l}=e(Nr),i=o(),s=r(i),a=t(i[0]);return{blocks:s,clientIds:i,possibleBlockTransformations:n(s,a),canRemove:l(i,a)}}),[]),i=1===n.length&&(0,c.isTemplatePart)(n[0]);function a(r){const l=(0,c.switchToBlockType)(n,r);var i;e(o,l),(i=l).length>1&&t(i[0].clientId,i[i.length-1].clientId)}const u=!!l.length&&r&&!i;if(!o||o.length<1||!u)return{isLoading:!1,commands:[]};return{isLoading:!1,commands:l.map((e=>{const{name:t,title:n,icon:o}=e;return{name:"core/block-editor/transform-to-"+t.replace("/","-"),label:(0,x.sprintf)((0,x.__)("Transform to %s"),n),icon:(0,s.createElement)(qh,{icon:o}),callback:({close:e})=>{a(t),e()}}}))}},yM=()=>{const{clientIds:e}=(0,d.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e(Nr);return{clientIds:t()}}),[]),{getBlockRootClientId:t,canMoveBlocks:n,getBlockCount:o}=(0,d.useSelect)(Nr),{setBlockMovingClientId:r,setNavigationMode:l,selectBlock:i}=(0,d.useDispatch)(Nr);if(!e||e.length<1)return{isLoading:!1,commands:[]};const s=t(e[0]),a=[];return n(e,s)&&1!==o(s)&&a.push({name:"move-to",label:(0,x.__)("Move to"),callback:()=>{l(!0),i(e[0]),r(e[0])},icon:bM}),{isLoading:!1,commands:a.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},EM=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,d.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(Nr);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:l,canRemoveBlocks:i}=(0,d.useSelect)(Nr),{getDefaultBlockName:s,getGroupingBlockName:a}=(0,d.useSelect)(c.store),u=l(e),{removeBlocks:p,replaceBlocks:m,duplicateBlocks:h,insertAfterBlock:g,insertBeforeBlock:f}=(0,d.useDispatch)(Nr),b=()=>{if(!u.length)return;const t=a(),n=(0,c.switchToBlockType)(u,t);n&&m(e,n)},v=()=>{if(!u.length)return;const t=u[0].innerBlocks;t.length&&m(e,t)};if(!e||e.length<1)return{isLoading:!1,commands:[]};const k=r(e[0]),_=o(s(),k),y=u.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,k))),E=i(e,k),w=[];return y&&w.push({name:"duplicate",label:(0,x.__)("Duplicate"),callback:()=>h(e,!0),icon:SS}),_&&w.push({name:"add-before",label:(0,x.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;f(t)},icon:na},{name:"add-after",label:(0,x.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;g(t)},icon:na}),n&&w.push({name:"Group",label:(0,x.__)("Group"),callback:b,icon:wC}),t&&w.push({name:"ungroup",label:(0,x.__)("Ungroup"),callback:v,icon:vM}),E&&w.push({name:"remove",label:(0,x.__)("Delete"),callback:()=>p(e,!0),icon:kM}),{isLoading:!1,commands:w.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},wM=()=>{(0,fM.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:_M}),(0,fM.useCommandLoader)({name:"core/block-editor/blockActions",hook:yM}),(0,fM.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:EM,context:"block-selection-edit"})},SM="isResuableBlocksrRenameHintVisible";function CM(){const e=(0,d.useSelect)((e=>{var t;return null===(t=e(Ws.store).get("core",SM))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,d.useDispatch)(Ws.store);return e?(0,s.createElement)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint"},(0,s.createElement)("div",{className:"reusable-blocks-menu-items__rename-hint-content"},(0,x.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")),(0,s.createElement)(_l.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:TT,iconSize:"16",label:(0,x.__)("Dismiss hint"),onClick:()=>{const e=As.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",SM,!1)},showTooltip:!1})):null}const xM={button:"wp-element-button",caption:"wp-element-caption"},BM=e=>xM[e]?xM[e]:"",IM=()=>"",TM={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function MM(e){const t="var:";if(e?.startsWith?.(t)){return`var(--wp--${e.slice(4).split("|").join("--")})`}return e}function PM(e={},t,n){const{kebabCase:o}=ie(_l.privateApis);let r=[];return Object.keys(e).forEach((l=>{const i=t+o(l.replace("/","-")),s=e[l];if(s instanceof Object){const e=i+n;r=[...r,...PM(s,e,n)]}else r.push(`${i}: ${s}`)})),r}const RM=(e,t)=>{const n={};return Object.entries(e).forEach((([e,o])=>{if("root"===e||!t?.[e])return;const r="string"==typeof o;if(r||Object.entries(o).forEach((([o,r])=>{if("root"===o||!t?.[e][o])return;const l=NM({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...l],delete t[e][o]})),r||o.root){const l=r?o:o.root,i=NM({[e]:t[e]});n[l]=[...n[l]||[],...i],delete t[e]}})),n};function NM(e={},t="",n,o={},r=!0){const{kebabCase:l}=ie(_l.privateApis),i=qr===t,s=Object.entries(c.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:s,useEngine:a,rootOnly:c}])=>{if(c&&!i)return t;const u=r;if("elements"===u[0]||a)return t;const d=Wn(e,u);if("--wp--style--root--padding"===o&&("string"==typeof d||!n))return t;if(s&&"string"!=typeof d)Object.entries(s).forEach((e=>{const[n,o]=e;if(!Wn(d,[o],!1))return;const r=n.startsWith("--")?n:l(n);t.push(`${r}: ${MM(Wn(d,[o]))}`)}));else if(Wn(e,u,!1)){const n=o.startsWith("--")?o:l(o);t.push(`${n}: ${MM(Wn(e,u))}`)}return t}),[]);return(0,Ri.getCSSRules)(e).forEach((e=>{if(i&&(n||!r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:l(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=Wn(o,e),!a||a?.ref)return}"font-size"===t&&(a=Wr({size:a},Zr(o?.settings))),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)})),s}function LM({layoutDefinitions:e=Al,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:l}){let i="",s=o?oi(t?.spacing?.blockGap):"";if(r&&(n===qr?s=s||"0.5em":!o&&l&&(s=l)),s&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:r})=>{(o||"flex"===t||"grid"===t)&&r?.length&&r.forEach((t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{r.push(`${e}: ${t||s}`)})),r.length){let l="";l=o?n===qr?`:where(${n} .${e})${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===qr?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,i+=`${l} { ${r.join("; ")}; }`}}))})),n===qr&&o&&(i+=`${n} { --wp--style--block-gap: ${s}; }`)),n===qr&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(i+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t}`)})),o.length){i+=`${`${n} .${e}${t?.selector||""}`} { ${o.join("; ")}; }`}}))}))}return i}const AM=["border","color","dimensions","spacing","typography","filter","outline","shadow"];function OM(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>AM.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const DM=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{let t={};return Yr.forEach((({path:n})=>{const o=Wn(e,n,!1);!1!==o&&(t=jn(t,n,o))})),t},l=r(e.settings),i=e.settings?.custom;return(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:qr}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const l=r(n),i=n.custom;(Object.keys(l).length>0||i)&&o.push({presets:l,custom:i,selector:t[e]?.selector})})),o},zM=(e,t)=>{const n=DM(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const l=function(e={},t){const{kebabCase:n}=ie(_l.privateApis);return Yr.reduce(((o,{path:r,valueKey:l,valueFunc:i,cssVarInfix:s})=>{const a=Wn(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{l&&!i?o.push(`--wp--preset--${s}--${n(e.slug)}: ${e[l]}`):i&&"function"==typeof i&&o.push(`--wp--preset--${s}--${n(e.slug)}: ${i(e,t)}`)}))})),o}),[])}(t,e?.settings),i=PM(n,"--wp--custom--","--");i.length>0&&l.push(...i),l.length>0&&(o+=`${r}{${l.join(";")};}`)})),o},VM=(e,t,n,o,r=!1,l=!0)=>{const i=((e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=OM(e.styles);return r&&o.push({styles:r,selector:qr}),Object.entries(c.__EXPERIMENTAL_ELEMENTS).forEach((([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var r;const l=OM(n);if(n?.variations){const e={};Object.keys(n.variations).forEach((t=>{e[t]=OM(n.variations[t])})),l.variations=e}l&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:l,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(r=n?.elements)&&void 0!==r?r:{}).forEach((([n,r])=>{r&&t?.[e]&&c.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:r,selector:t[e]?.selector.split(",").map((e=>c.__EXPERIMENTAL_ELEMENTS[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),o})(e,t),s=DM(e,t),a=e?.settings?.useRootPaddingAwareAlignments,{contentSize:u,wideSize:d}=e?.settings?.layout||{};let p="body {margin: 0;";if(u&&(p+=` --wp--style--global--content-size: ${u};`),d&&(p+=` --wp--style--global--wide-size: ${d};`),a&&l&&(p+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) { padding-right: 0; padding-left: 0; }\n\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block)) > .alignfull { margin-right: 0; margin-left: 0; }\n\t\t\t.has-global-padding > .alignfull:where(:not(.has-global-padding):not(.is-layout-flex):not(.is-layout-grid)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t.has-global-padding :where(.has-global-padding) > .alignfull:where(:not(.has-global-padding)) > :where(.wp-block:not(.alignfull),p,h1,h2,h3,h4,h5,h6,ul,ol) { padding-right: 0; padding-left: 0;"),p+="}",i.forEach((({selector:t,duotoneSelector:i,styles:s,fallbackGapValue:c,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m})=>{if(d){const e=RM(d,s);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");p+=`${e}{${n};}`}}))}if(m&&Object.entries(m).forEach((([t,n])=>{const o=s?.variations?.[t];if(o){if(d){const e=RM(d,o);Object.entries(e).forEach((([e,t])=>{if(t.length){const o=function(e,t){const n=e.split(","),o=[];return n.forEach((e=>{o.push(`${t.trim()}${e.trim()}`)})),o.join(", ")}(e,n),r=t.join(";");p+=`${o}{${r};}`}}))}const t=NM(o,n,a,e);t.length&&(p+=`${n}{${t.join(";")};}`)}})),i){const e={};s?.filter&&(e.filter=s.filter,delete s.filter);const t=NM(e);t.length&&(p+=`${i}{${t.join(";")};}`)}r||qr!==t&&!u||(p+=LM({style:s,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const h=NM(s,t,a,e,l);h?.length&&(p+=`${t}{${h.join(";")};}`);const g=Object.entries(s).filter((([e])=>e.startsWith(":")));g?.length&&g.forEach((([e,n])=>{const o=NM(n);if(!o?.length)return;const r=`${t.split(",").map((t=>t+e)).join(",")}{${o.join(";")};}`;p+=r}))})),p+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }",n){const t=oi(e?.styles?.spacing?.blockGap)||"0.5em";p+=`:where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,p+=":where(.wp-site-blocks) > :first-child:first-child { margin-block-start: 0; }",p+=":where(.wp-site-blocks) > :last-child:last-child { margin-block-end: 0; }"}return s.forEach((({selector:e,presets:t})=>{qr===e&&(e="");const n=function(e="*",t={}){const{kebabCase:n}=ie(_l.privateApis);return Yr.reduce(((o,{path:r,cssVarInfix:l,classes:i})=>{if(!i)return o;const s=Wn(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:r,propertyName:i})=>{const s=`.has-${n(t)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),c=`var(--wp--preset--${l}--${n(t)})`;o+=`${a}{${i}: ${c} !important;}`}))}))})),o}),"")}(e,t);n.length>0&&(p+=n)})),p};function FM(e,t){return DM(e,t).flatMap((({presets:e})=>function(e={}){return Yr.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=Wn(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>Um(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}const HM=(e,t)=>{const n={};return e.forEach((e=>{const o=e.name,r=$m(e);let l=$m(e,"filter.duotone");if(!l){const t=$m(e),n=(0,c.getBlockSupport)(e,"color.__experimentalDuotone",!1);l=n&&tl(t,n)}const i=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,s=e?.supports?.spacing?.blockGap?.__experimentalDefault,a=t(o),u={};a?.length&&a.forEach((e=>{const t=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const o=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,o)=>t+o+n;return t.split(",").map((e=>e.replace(o,r))).join(",")}(e.name,r);u[e.name]=t}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(TM).forEach((([t,o])=>{const r=$m(e,t);r&&(n[o]=r)})),n})(e,r);n[o]={duotoneSelector:l,fallbackGapValue:s,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:i,name:o,selector:r,styleVariationSelectors:Object.keys(u).length?u:void 0}})),n};function GM(e,t){let n="";return e.split("&").forEach((e=>{if(!e.includes("{"))n+=`${t}{${e.trim()}}`;else{const o=e.replace("}","").split("{");if(2!==o.length)return;const[r,l]=o,i=r.startsWith(" ")?tl(t,r):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,r);n+=`${i}{${l.trim()}}`}})),n}function UM(e={}){const[t]=sl("spacing.blockGap"),n=null!==t,o=!n,r=(0,d.useSelect)((e=>{const{getSettings:t}=e(Nr);return!!t().disableLayoutStyles})),l=(0,u.useContext)(bf),i=void 0!==l?.templateSlug,{getBlockStyles:s}=(0,d.useSelect)(c.store);return(0,u.useMemo)((()=>{var t;if(!e?.styles||!e?.settings)return[];const l=(a=e,a.styles?.blocks?.["core/separator"]&&a.styles?.blocks?.["core/separator"].color?.background&&!a.styles?.blocks?.["core/separator"].color?.text&&!a.styles?.blocks?.["core/separator"].border?.color?{...a,styles:{...a.styles,blocks:{...a.styles.blocks,"core/separator":{...a.styles.blocks["core/separator"],color:{...a.styles.blocks["core/separator"].color,text:a.styles?.blocks["core/separator"].color.background}}}}}:a);var a;const u=HM((0,c.getBlockTypes)(),s),d=zM(l,u),p=VM(l,u,n,o,r,i),m=FM(l,u),h=[{css:d,isGlobalStyles:!0},{css:p,isGlobalStyles:!0},{css:null!==(t=l.styles.css)&&void 0!==t?t:"",isGlobalStyles:!0},{assets:m,__unstableType:"svg",isGlobalStyles:!0}];return(0,c.getBlockTypes)().forEach((e=>{if(l.styles.blocks[e.name]?.css){const t=u[e.name].selector;h.push({css:GM(l.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[h,l.settings]}),[n,o,e,r,i,s])}function $M(){const{merged:e}=(0,u.useContext)(ol);return UM(e)}function jM(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function WM({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=()=>{e(void 0)};let l=!1;return n?.lightbox?.enabled&&(l=n.lightbox.enabled),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_l.__experimentalToolsPanel,{label:(0,x._x)("Settings","Image settings"),resetAll:r,panelId:o,dropdownMenuProps:Qr},(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,x.__)("Expand on click"),onDeselect:r,isShownByDefault:!0,panelId:o},(0,s.createElement)(_l.ToggleControl,{label:(0,x.__)("Expand on click"),checked:l,onChange:t=>{e({enabled:t})}}))))}function KM({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,u.useState)(null),l=n?.css;return(0,s.createElement)(_l.__experimentalVStack,{spacing:3},o&&(0,s.createElement)(_l.Notice,{status:"error",onRemove:()=>r(null)},o),(0,s.createElement)(_l.TextareaControl,{label:(0,x.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:l,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=yy([{css:n}],".editor-styles-wrapper");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=yy([{css:e.target.value}],".editor-styles-wrapper");r(null===t?(0,x.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1}))}const ZM=new Map,qM=[],YM={caption:(0,x.__)("Caption"),link:(0,x.__)("Link"),button:(0,x.__)("Button"),heading:(0,x.__)("Heading"),h1:(0,x.__)("H1"),h2:(0,x.__)("H2"),h3:(0,x.__)("H3"),h4:(0,x.__)("H4"),h5:(0,x.__)("H5"),h6:(0,x.__)("H6"),"settings.color":(0,x.__)("Color"),"settings.typography":(0,x.__)("Typography"),"styles.color":(0,x.__)("Colors"),"styles.spacing":(0,x.__)("Spacing"),"styles.typography":(0,x.__)("Typography")},XM=function(e,t){var n,o,r=0;function l(){var l,i,s=n,a=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i<a;i++)if(s.args[i]!==arguments[i]){s=s.next;continue e}return s!==n&&(s===o&&(o=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=n,s.prev=null,n.prev=s,n=s),s.val}s=s.next}for(l=new Array(a),i=0;i<a;i++)l[i]=arguments[i];return s={args:l,val:e.apply(null,l)},n?(n.prev=s,s.next=n):o=s,r===t.maxSize?(o=o.prev).next=null:r++,n=s,s.val}return t=t||{},l.clear=function(){n=null,o=null,r=0},l}((()=>(0,c.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),QM=e=>null!==e&&"object"==typeof e;function JM(e,t,n=""){if(!QM(e)&&!QM(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=QM(e)?e:{},t=QM(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const l of o){const o=n?n+"."+l:l,i=JM(e[l],t[l],o);i&&(r=r.concat(i))}return r}function eP(e,t){const n=JSON.stringify({next:e,previous:t});if(ZM.has(n))return ZM.get(n);const o=JM({styles:{color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!o.length)return ZM.set(n,qM),qM;const r=[...new Set(o)].reduce(((e,t)=>{const n=function(e){if(YM[e])return YM[e];const t=e.split(".");if("blocks"===t?.[0]){const e=XM()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?YM[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return ZM.set(n,r),r}function tP(e,t,n={}){let o=eP(e,t);const r=o.length,{maxResults:l}=n;return r?(l&&r>l&&(o=o.slice(0,l)),Object.entries(o.reduce(((e,t)=>{const n=e[t[0]]||[];return n.includes(t[1])||(e[t[0]]=[...n,t[1]]),e}),{})).map((([e,t])=>{const n=t.length,o=t.join((0,x.__)(", "));switch(e){case"blocks":return(0,x.sprintf)((0,x._n)("%s block.","%s blocks.",n),o);case"elements":return(0,x.sprintf)((0,x._n)("%s element.","%s elements.",n),o);case"settings":return(0,x.sprintf)((0,x.__)("%s settings."),o);case"styles":return(0,x.sprintf)((0,x.__)("%s styles."),o);default:return(0,x.sprintf)((0,x.__)("%s."),o)}}))):qM}function nP(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return oP(e,t,n);switch(typeof e){case"string":case"number":return}const{type:o,props:r}=e;switch(o){case u.StrictMode:case u.Fragment:return oP(r.children,t,n);case u.RawHTML:return;case Gw.Content:return rP(t,n);case VI:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?oP(r.children,t,n):void 0;case"function":return nP(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function oP(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)nP(e[n],...t)}function rP(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:l}=t[n];nP((0,c.getSaveElement)(o,r,(0,s.createElement)(Gw.Content,null)),e,l)}}const lP=[{value:"fill",label:(0,x._x)("Fill","Scale option for dimensions control"),help:(0,x.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,x._x)("Contain","Scale option for dimensions control"),help:(0,x.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,x._x)("Cover","Scale option for dimensions control"),help:(0,x.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,x._x)("None","Scale option for dimensions control"),help:(0,x.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,x._x)("Scale down","Scale option for dimensions control"),help:(0,x.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function iP({panelId:e,value:t,onChange:n,options:o=lP,defaultValue:r=lP[0].value,isShownByDefault:l=!0}){const i=null!=t?t:"fill",a=(0,u.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,s.createElement)(_l.__experimentalToolsPanelItem,{label:(0,x.__)("Scale"),isShownByDefault:l,hasValue:()=>i!==r,onDeselect:()=>n(r),panelId:e},(0,s.createElement)(_l.__experimentalToggleGroupControl,{label:(0,x.__)("Scale"),isBlock:!0,help:a[i],value:i,onChange:n,size:"__unstable-large"},o.map((e=>(0,s.createElement)(_l.__experimentalToggleGroupControlOption,{key:e.value,...e})))))}function sP(){return sP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},sP.apply(this,arguments)}function aP(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var cP=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,uP=aP((function(e){return cP.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var dP=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),pP=Math.abs,mP=String.fromCharCode,hP=Object.assign;function gP(e){return e.trim()}function fP(e,t,n){return e.replace(t,n)}function bP(e,t){return e.indexOf(t)}function vP(e,t){return 0|e.charCodeAt(t)}function kP(e,t,n){return e.slice(t,n)}function _P(e){return e.length}function yP(e){return e.length}function EP(e,t){return t.push(e),e}var wP=1,SP=1,CP=0,xP=0,BP=0,IP="";function TP(e,t,n,o,r,l,i){return{value:e,root:t,parent:n,type:o,props:r,children:l,line:wP,column:SP,length:i,return:""}}function MP(e,t){return hP(TP("",null,null,"",null,null,0),e,{length:-e.length},t)}function PP(){return BP=xP>0?vP(IP,--xP):0,SP--,10===BP&&(SP=1,wP--),BP}function RP(){return BP=xP<CP?vP(IP,xP++):0,SP++,10===BP&&(SP=1,wP++),BP}function NP(){return vP(IP,xP)}function LP(){return xP}function AP(e,t){return kP(IP,e,t)}function OP(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function DP(e){return wP=SP=1,CP=_P(IP=e),xP=0,[]}function zP(e){return IP="",e}function VP(e){return gP(AP(xP-1,GP(91===e?e+2:40===e?e+1:e)))}function FP(e){for(;(BP=NP())&&BP<33;)RP();return OP(e)>2||OP(BP)>3?"":" "}function HP(e,t){for(;--t&&RP()&&!(BP<48||BP>102||BP>57&&BP<65||BP>70&&BP<97););return AP(e,LP()+(t<6&&32==NP()&&32==RP()))}function GP(e){for(;RP();)switch(BP){case e:return xP;case 34:case 39:34!==e&&39!==e&&GP(BP);break;case 40:41===e&&GP(e);break;case 92:RP()}return xP}function UP(e,t){for(;RP()&&e+BP!==57&&(e+BP!==84||47!==NP()););return"/*"+AP(t,xP-1)+"*"+mP(47===e?e:RP())}function $P(e){for(;!OP(NP());)RP();return AP(e,xP)}var jP="-ms-",WP="-moz-",KP="-webkit-",ZP="comm",qP="rule",YP="decl",XP="@keyframes";function QP(e,t){for(var n="",o=yP(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function JP(e,t,n,o){switch(e.type){case"@import":case YP:return e.return=e.return||e.value;case ZP:return"";case XP:return e.return=e.value+"{"+QP(e.children,o)+"}";case qP:e.value=e.props.join(",")}return _P(n=QP(e.children,o))?e.return=e.value+"{"+n+"}":""}function eR(e){return zP(tR("",null,null,null,[""],e=DP(e),0,[0],e))}function tR(e,t,n,o,r,l,i,s,a){for(var c=0,u=0,d=i,p=0,m=0,h=0,g=1,f=1,b=1,v=0,k="",_=r,y=l,E=o,w=k;f;)switch(h=v,v=RP()){case 40:if(108!=h&&58==vP(w,d-1)){-1!=bP(w+=fP(VP(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:w+=VP(v);break;case 9:case 10:case 13:case 32:w+=FP(h);break;case 92:w+=HP(LP()-1,7);continue;case 47:switch(NP()){case 42:case 47:EP(oR(UP(RP(),LP()),t,n),a);break;default:w+="/"}break;case 123*g:s[c++]=_P(w)*b;case 125*g:case 59:case 0:switch(v){case 0:case 125:f=0;case 59+u:m>0&&_P(w)-d&&EP(m>32?rR(w+";",o,n,d-1):rR(fP(w," ","")+";",o,n,d-2),a);break;case 59:w+=";";default:if(EP(E=nR(w,t,n,c,u,r,s,k,_=[],y=[],d),l),123===v)if(0===u)tR(w,t,E,E,_,l,d,s,y);else switch(99===p&&110===vP(w,3)?100:p){case 100:case 109:case 115:tR(e,E,E,o&&EP(nR(e,E,E,0,0,r,s,k,r,_=[],d),y),r,y,d,s,o?_:y);break;default:tR(w,E,E,E,[""],y,0,s,y)}}c=u=m=0,g=b=1,k=w="",d=i;break;case 58:d=1+_P(w),m=h;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==PP())continue;switch(w+=mP(v),v*g){case 38:b=u>0?1:(w+="\f",-1);break;case 44:s[c++]=(_P(w)-1)*b,b=1;break;case 64:45===NP()&&(w+=VP(RP())),p=NP(),u=d=_P(k=w+=$P(LP())),v++;break;case 45:45===h&&2==_P(w)&&(g=0)}}return l}function nR(e,t,n,o,r,l,i,s,a,c,u){for(var d=r-1,p=0===r?l:[""],m=yP(p),h=0,g=0,f=0;h<o;++h)for(var b=0,v=kP(e,d+1,d=pP(g=i[h])),k=e;b<m;++b)(k=gP(g>0?p[b]+" "+v:fP(v,/&\f/g,p[b])))&&(a[f++]=k);return TP(e,t,n,0===r?qP:s,a,c,u)}function oR(e,t,n){return TP(e,t,n,ZP,mP(BP),kP(e,2,-2),0)}function rR(e,t,n,o){return TP(e,t,n,YP,kP(e,0,o),kP(e,o+1,-1),o)}var lR=function(e,t,n){for(var o=0,r=0;o=r,r=NP(),38===o&&12===r&&(t[n]=1),!OP(r);)RP();return AP(e,xP)},iR=function(e,t){return zP(function(e,t){var n=-1,o=44;do{switch(OP(o)){case 0:38===o&&12===NP()&&(t[n]=1),e[n]+=lR(xP-1,t,n);break;case 2:e[n]+=VP(o);break;case 4:if(44===o){e[++n]=58===NP()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=mP(o)}}while(o=RP());return e}(DP(e),t))},sR=new WeakMap,aR=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||sR.get(n))&&!o){sR.set(e,!0);for(var r=[],l=iR(t,r),i=n.props,s=0,a=0;s<l.length;s++)for(var c=0;c<i.length;c++,a++)e.props[a]=r[s]?l[s].replace(/&\f/g,i[c]):i[c]+" "+l[s]}}},cR=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function uR(e,t){switch(function(e,t){return 45^vP(e,0)?(((t<<2^vP(e,0))<<2^vP(e,1))<<2^vP(e,2))<<2^vP(e,3):0}(e,t)){case 5103:return KP+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return KP+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return KP+e+WP+e+jP+e+e;case 6828:case 4268:return KP+e+jP+e+e;case 6165:return KP+e+jP+"flex-"+e+e;case 5187:return KP+e+fP(e,/(\w+).+(:[^]+)/,KP+"box-$1$2"+jP+"flex-$1$2")+e;case 5443:return KP+e+jP+"flex-item-"+fP(e,/flex-|-self/,"")+e;case 4675:return KP+e+jP+"flex-line-pack"+fP(e,/align-content|flex-|-self/,"")+e;case 5548:return KP+e+jP+fP(e,"shrink","negative")+e;case 5292:return KP+e+jP+fP(e,"basis","preferred-size")+e;case 6060:return KP+"box-"+fP(e,"-grow","")+KP+e+jP+fP(e,"grow","positive")+e;case 4554:return KP+fP(e,/([^-])(transform)/g,"$1"+KP+"$2")+e;case 6187:return fP(fP(fP(e,/(zoom-|grab)/,KP+"$1"),/(image-set)/,KP+"$1"),e,"")+e;case 5495:case 3959:return fP(e,/(image-set\([^]*)/,KP+"$1$`$1");case 4968:return fP(fP(e,/(.+:)(flex-)?(.*)/,KP+"box-pack:$3"+jP+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+KP+e+e;case 4095:case 3583:case 4068:case 2532:return fP(e,/(.+)-inline(.+)/,KP+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_P(e)-1-t>6)switch(vP(e,t+1)){case 109:if(45!==vP(e,t+4))break;case 102:return fP(e,/(.+:)(.+)-([^]+)/,"$1"+KP+"$2-$3$1"+WP+(108==vP(e,t+3)?"$3":"$2-$3"))+e;case 115:return~bP(e,"stretch")?uR(fP(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==vP(e,t+1))break;case 6444:switch(vP(e,_P(e)-3-(~bP(e,"!important")&&10))){case 107:return fP(e,":",":"+KP)+e;case 101:return fP(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+KP+(45===vP(e,14)?"inline-":"")+"box$3$1"+KP+"$2$3$1"+jP+"$2box$3")+e}break;case 5936:switch(vP(e,t+11)){case 114:return KP+e+jP+fP(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return KP+e+jP+fP(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return KP+e+jP+fP(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return KP+e+jP+e+e}return e}var dR=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case YP:e.return=uR(e.value,e.length);break;case XP:return QP([MP(e,{value:fP(e.value,"@","@"+KP)})],o);case qP:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return QP([MP(e,{props:[fP(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return QP([MP(e,{props:[fP(t,/:(plac\w+)/,":"+KP+"input-$1")]}),MP(e,{props:[fP(t,/:(plac\w+)/,":-moz-$1")]}),MP(e,{props:[fP(t,/:(plac\w+)/,jP+"input-$1")]})],o)}return""}))}}];const pR=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||dR;var r,l,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)}));var a,c,u,d,p=[JP,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],m=(c=[aR,cR].concat(o,p),u=yP(c),function(e,t,n,o){for(var r="",l=0;l<u;l++)r+=c[l](e,t,n,o)||"";return r});l=function(e,t,n,o){a=n,function(e){QP(eR(e),m)}(e?e+"{"+t.styles+"}":t.styles),o&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new dP({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:l};return h.sheet.hydrate(s),h};const mR=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const hR={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function gR(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var fR=/[A-Z]|^ms/g,bR=/_EMO_([^_]+?)_([^]*?)_EMO_/g,vR=function(e){return 45===e.charCodeAt(1)},kR=function(e){return null!=e&&"boolean"!=typeof e},_R=gR((function(e){return vR(e)?e:e.replace(fR,"-$&").toLowerCase()})),yR=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(bR,(function(e,t,n){return wR={name:t,styles:n,next:wR},t}))}return 1===hR[e]||vR(e)||"number"!=typeof t||0===t?t:t+"px"};function ER(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return wR={name:n.name,styles:n.styles,next:wR},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)wR={name:o.name,styles:o.styles,next:wR},o=o.next;return n.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=ER(e,t,n[r])+";";else for(var l in n){var i=n[l];if("object"!=typeof i)null!=t&&void 0!==t[i]?o+=l+"{"+t[i]+"}":kR(i)&&(o+=_R(l)+":"+yR(l,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var s=ER(e,t,i);switch(l){case"animation":case"animationName":o+=_R(l)+":"+s+";";break;default:o+=l+"{"+s+"}"}}else for(var a=0;a<i.length;a++)kR(i[a])&&(o+=_R(l)+":"+yR(l,i[a])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=wR,l=n(e);return wR=r,ER(e,t,l)}}if(null==t)return n;var i=t[n];return void 0!==i?i:n}var wR,SR=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var CR=!!s.useInsertionEffect&&s.useInsertionEffect,xR=CR||function(e){return e()},BR=(0,s.createContext)("undefined"!=typeof HTMLElement?pR({key:"css"}):null);BR.Provider;var IR=function(e){return(0,s.forwardRef)((function(t,n){var o=(0,s.useContext)(BR);return e(t,o,n)}))},TR=(0,s.createContext)({});var MR=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)},PR=uP,RR=function(e){return"theme"!==e},NR=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?PR:RR},LR=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},AR=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;MR(t,n,o);xR((function(){return function(e,t,n){MR(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}));return null};const OR=function e(t,n){var o,r,l=t.__emotion_real===t,i=l&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var a=LR(t,n,l),c=a||NR(i),u=!c("as");return function(){var d=arguments,p=l&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)p.push.apply(p,d);else{0,p.push(d[0][0]);for(var m=d.length,h=1;h<m;h++)p.push(d[h],d[0][h])}var g=IR((function(e,t,n){var o=u&&e.as||i,l="",d=[],m=e;if(null==e.theme){for(var h in m={},e)m[h]=e[h];m.theme=(0,s.useContext)(TR)}"string"==typeof e.className?l=function(e,t,n){var o="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):o+=n+" "})),o}(t.registered,d,e.className):null!=e.className&&(l=e.className+" ");var g=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";wR=void 0;var l=e[0];null==l||void 0===l.raw?(o=!1,r+=ER(n,t,l)):r+=l[0];for(var i=1;i<e.length;i++)r+=ER(n,t,e[i]),o&&(r+=l[i]);SR.lastIndex=0;for(var s,a="";null!==(s=SR.exec(r));)a+="-"+s[1];return{name:mR(r)+a,styles:r,next:wR}}(p.concat(d),t.registered,m);l+=t.key+"-"+g.name,void 0!==r&&(l+=" "+r);var f=u&&void 0===a?NR(o):c,b={};for(var v in e)u&&"as"===v||f(v)&&(b[v]=e[v]);return b.className=l,b.ref=n,(0,s.createElement)(s.Fragment,null,(0,s.createElement)(AR,{cache:t,serialized:g,isStringTag:"string"==typeof o}),(0,s.createElement)(o,b))}));return g.displayName=void 0!==o?o:"Styled("+("string"==typeof i?i:i.displayName||i.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=i,g.__emotion_styles=p,g.__emotion_forwardProp=a,Object.defineProperty(g,"toString",{value:function(){return"."+r}}),g.withComponent=function(t,o){return e(t,sP({},n,o,{shouldForwardProp:LR(g,o,!0)})).apply(void 0,p)},g}};const DR=OR(_l.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function zR({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var l,i;const a="auto"===t.width?"":null!==(l=t.width)&&void 0!==l?l:"",c="auto"===t.height?"":null!==(i=t.height)&&void 0!==i?i:"",u=e=>o=>{const r={...t};o?r[e]=o:delete r[e],n(r)};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(DR,{label:(0,x.__)("Width"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:u("width"),panelId:e},(0,s.createElement)(_l.__experimentalUnitControl,{label:(0,x.__)("Width"),placeholder:(0,x.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:u("width"),size:"__unstable-large"})),(0,s.createElement)(DR,{label:(0,x.__)("Height"),isShownByDefault:r,hasValue:()=>""!==c,onDeselect:u("height"),panelId:e},(0,s.createElement)(_l.__experimentalUnitControl,{label:(0,x.__)("Height"),placeholder:(0,x.__)("Auto"),labelPosition:"top",units:o,min:0,value:c,onChange:u("height"),size:"__unstable-large"})))}const VR=function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:l,defaultScale:i="fill",unitsOptions:a}){const c=void 0===t.width||"auto"===t.width?null:t.width,d=void 0===t.height||"auto"===t.height?null:t.height,p=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,m=void 0===t.scale||"fill"===t.scale?null:t.scale,[h,g]=(0,u.useState)(m),[f,b]=(0,u.useState)(p),v=c&&d?"custom":f,k=p||c&&d;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Qp,{panelId:e,options:o,defaultValue:r,value:v,onChange:e=>{const o={...t};b(e="auto"===e?null:e),e?o.aspectRatio=e:delete o.aspectRatio,e?h?o.scale=h:(o.scale=i,g(i)):delete o.scale,"custom"!==e&&c&&d&&delete o.height,n(o)}}),(0,s.createElement)(zR,{panelId:e,units:a,value:{width:c,height:d},onChange:({width:e,height:o})=>{const r={...t};o="auto"===o?null:o,(e="auto"===e?null:e)?r.width=e:delete r.width,o?r.height=o:delete r.height,e&&o?delete r.aspectRatio:f&&(r.aspectRatio=f),f||!!e==!!o?h?r.scale=h:(r.scale=i,g(i)):delete r.scale,n(r)}}),k&&(0,s.createElement)(iP,{panelId:e,options:l,defaultValue:i,value:h,onChange:e=>{const o={...t};g(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}}))},FR=[{label:(0,x._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,x._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,x._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,x._x)("Full Size","Image size option for resolution control"),value:"full"}];const HR={};le(HR,{...i,ExperimentalBlockCanvas:jC,ExperimentalBlockEditorProvider:z_,getDuotoneFilter:Um,getRichTextValues:function(e=[]){c.__unstableGetBlockProps.skipFilters=!0;const t=[];return rP(t,e),c.__unstableGetBlockProps.skipFilters=!1,t.map((e=>e instanceof Y.RichTextData?e:Y.RichTextData.fromHTMLString(e)))},PrivateInserter:rw,PrivateQuickInserter:tw,PrivateListView:Tx,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,s.createElement)(fm,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"__unstable-block-tools-after",shift:!1,...n},(0,s.createElement)(_l.ResizableBox,{...t}))},BlockInfo:$T,useCanBlockToolbarBeFocused:function(){return(0,d.useSelect)((e=>{const{__unstableGetEditorMode:t,getBlock:n,getSettings:o,getSelectedBlockClientId:r,getFirstMultiSelectedBlockClientId:l}=ie(e(Nr)),i=l()||r(),s=(0,c.isUnmodifiedDefaultBlock)(n(i)||{});return!!i&&(o().hasFixedToolbar||"edit"===t()&&!s)}),[])},cleanEmptyObject:hl,useStyleOverride:bl,BlockQuickNavigation:jT,LayoutStyle:function({layout:e={},css:t,...n}){const o=Vi(e.type),[r]=Ar("spacing.blockGap"),l=null!==r;if(o){if(t)return(0,s.createElement)("style",null,t);const r=o.getLayoutStyle?.({hasBlockGapSupport:l,layout:e,...n});if(r)return(0,s.createElement)("style",null,r)}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,blockNamesForPrompt:o,messageType:r}=(0,d.useSelect)((e=>ie(e(Nr)).getRemovalPromptData())),{clearBlockRemovalPrompt:l,setBlockRemovalRules:i,privateRemoveBlocks:a}=ie((0,d.useDispatch)(Nr));if((0,u.useEffect)((()=>(i(e),()=>{i()})),[e,i]),!o)return;const c="templates"===r?(0,x._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Deleting these blocks will stop your post or page content from displaying on this template. It is not recommended.",o.length):(0,x._n)("Deleting this block could break patterns on your site that have content linked to it. Are you sure you want to delete it?","Deleting these blocks could break patterns on your site that have content linked to them. Are you sure you want to delete them?",o.length);return(0,s.createElement)(_l.Modal,{title:(0,x.__)("Be careful!"),onRequestClose:l,size:"medium"},(0,s.createElement)("p",null,c),(0,s.createElement)(_l.__experimentalHStack,{justify:"right"},(0,s.createElement)(_l.Button,{variant:"tertiary",onClick:l},(0,x.__)("Cancel")),(0,s.createElement)(_l.Button,{variant:"primary",onClick:()=>{a(t,n,!0),l()}},(0,x.__)("Delete"))))},useLayoutClasses:yh,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,l=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},i=Vi(l?.type||"default"),[s]=Ar("spacing.blockGap"),a=null!==s,c=i?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a});return c},DimensionsTool:VR,ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=FR,defaultValue:r=FR[0].value,isShownByDefault:l=!0}){const i=null!=t?t:r;return(0,s.createElement)(_l.__experimentalToolsPanelItem,{hasValue:()=>i!==r,label:(0,x.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:l,panelId:e},(0,s.createElement)(_l.SelectControl,{label:(0,x.__)("Resolution"),value:i,options:o,onChange:n,help:(0,x.__)("Select the size of the source image."),size:"__unstable-large"}))},ReusableBlocksRenameHint:CM,useReusableBlocksRenameHint:function(){return(0,d.useSelect)((e=>{var t;return null===(t=e(Ws.store).get("core",SM))||void 0===t||t}),[])},usesContextKey:OI,useFlashEditableBlocks:__,selectBlockPatternsKey:X,requiresWrapperOnCopy:ny,PrivateRichText:$I})})(),(window.wp=window.wp||{}).blockEditor=o})();
\ No newline at end of file |