Current File : /home/resuelf/www/wp-content/plugins/gutenberg/build/block-editor/index.min.js
!function(){var e={6411:function(e,t){var n,o;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))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,l=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var l=i("autosize:resized");try{e.dispatchEvent(l)}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 l(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(o=n.apply(t,[e,t]))||(e.exports=o)},4403:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var l=r.apply(null,n);l&&e.push(l)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827: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 i=0,l=t.length,s=0,a=0;i<l;i++){var c=t[i];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=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[l-1];return l>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[l-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 i=this;function l(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 l([{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,f=p&&0<=m&&m<a;if(h||f){if(!h||f&&u.newPos<p.newPos?(r={newPos:(g=p).newPos,components:g.components.slice(0)},i.pushComponent(r.components,void 0,!0)):((r=u).newPos++,i.pushComponent(r.components,!0,void 0)),m=i.extractCommon(r,t,e,n),r.newPos+1>=s&&m+1>=a)return l(o(i,r.components,t,e,i.useLongestToken));d[n]=r}else d[n]=void 0}var g;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,i=n.length,l=e.newPos,s=l-o,a=0;l+1<r&&s+1<i&&this.equals(t[l+1],n[s+1]);)l++,s++,a++;return a&&e.components.push({count:a}),e.newPos=l,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,i=n.onlyScrollIfNeeded,l=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),h=o.offset(e),f=o.outerHeight(e),g=o.outerWidth(e),b=void 0,v=void 0,k=void 0,_=void 0,y=void 0,w=void 0,E=void 0,S=void 0,C=void 0,x=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(E=t,x=o.height(E),C=o.width(E),S={left:o.scrollLeft(E),top:o.scrollTop(E)},y={left:h.left-S.left-c,top:h.top-S.top-a},w={left:h.left+g-(S.left+C)+d,top:h.top+f-(S.top+x)+u},_=S):(b=o.offset(t),v=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:h.left-(b.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:h.top-(b.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},w={left:h.left+g-(b.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:h.top+f-(b.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||w.top>0?!0===l?o.scrollTop(t,_.top+y.top):!1===l?o.scrollTop(t,_.top+w.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+w.top):i||((l=void 0===l||!!l)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+w.top)),r&&(y.left<0||w.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+w.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+w.left):i||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+w.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 i(e){return o(e,!0)}function l(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,i=r.body,l=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=l.clientLeft||i.clientLeft||0,top:o-=l.clientTop||i.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=i(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",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,i=n||r.defaultView.getComputedStyle(e,null);return i&&(o=i.getPropertyValue(t)||i[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],i=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]=i}return""===n?"auto":n});var f=["margin","border","padding"],g=-1,b=2,v=1;function k(e,t,n){var o=0,r=void 0,i=void 0,l=void 0;for(i=0;i<t.length;i++)if(r=t[i])for(l=0;l<n.length;l++){var s;s="border"===r?r+n[l]+"Width":r+n[l],o+=parseFloat(p(e,s))||0}return o}function _(e){return null!=e&&e==e.window}var y={};function w(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,i=(p(e),h(e)),l=0;(null==r||r<=0)&&(r=void 0,(null==(l=p(e,t))||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===n&&(n=i?v:g);var s=void 0!==r||i,a=r||l;if(n===g)return s?a-k(e,["border","padding"],o):l;if(s){var c=n===b?-k(e,["border"],o):k(e,["margin"],o);return a+(n===v?0:c)}return l+k(e,f.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,i=o.documentElement[n];return"CSS1Compat"===o.compatMode&&i||r&&r[n]||i}}));var E={position:"absolute",visibility:"hidden",display:"block"};function S(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=w.apply(void 0,n):function(e,o,r){var i={},l=e.style,s=void 0;for(s in o)o.hasOwnProperty(s)&&(i[s]=l[s],l[s]=o[s]);for(s in function(){t=w.apply(void 0,n)}.call(e),o)o.hasOwnProperty(s)&&(l[s]=i[s])}(e,E),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 i in t)t.hasOwnProperty(i)&&C(e,i,t[i])}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){return void 0===o?t&&S(t,e,g):t?(p(t),h(t)&&(o+=k(t,["padding","border"],n)),C(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return l(e);!function(e,t){"static"===C(e,"position")&&(e.style.position="relative");var n=l(e),o={},r=void 0,i=void 0;for(i in t)t.hasOwnProperty(i)&&(r=parseFloat(C(e,i))||0,o[i]=r+t[i]-n[i]);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,i(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(_(e)){if(void 0===t)return i(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,i;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=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var l=i[r];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},2303: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,i;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=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){var l=i[r];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},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 i=e.nodeName,l=document.createElement(i);l.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&l.setAttribute("rows","1");var s=o(e,"font-size");l.style.fontSize=s,l.style.padding="0px",l.style.border="0px";var a=document.body;a.appendChild(l),n=l.offsetHeight,a.removeChild(l)}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,i,l,s,a,c,u,d,p,m,h,f,g=!1;function b(){if(!g){g=!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),f=/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);l=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),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else t=n=o=i=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()||l>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()||i},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||f},nativeApp:function(){return b()||h},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("","")),e.exports=function(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var l=document.createElement("div");l.setAttribute(n,"return;"),i="function"==typeof l[n]}return!i&&o&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},195:function(e,t,n){"use strict";var o=n(3812),r=n(7939);function i(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}}i.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},9122:function(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},6807:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5959:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n(6807);const r=o(n(4743)),i=o(n(6764));e.exports=(0,i.default)(r.default)},3626:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prefixWrapCSSSelector=t.prefixWrapCSSRule=void 0;const o=n(1146);t.prefixWrapCSSRule=(e,n,r,i,l)=>{const s=e.selector.split(",").filter((e=>!(0,o.cssRuleMatchesPrefixSelector)({selector:e},i)));0!==s.length&&(e.selector=s.map((o=>(0,t.prefixWrapCSSSelector)(o,e,n,r,i,l))).filter(o.isValidCSSSelector).join(", "))},t.prefixWrapCSSSelector=(e,t,n,r,i,l)=>{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)?i+" "+s:l?i+" ."+s:s.replace(/^(body|html|:root)/,i)}},1146:function(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)}},5318:function(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))))},504: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}),i=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 l=i(n(6483));t.asPostCSSv7PluginGenerator=e=>e.plugin(l.PLUGIN_NAME,((e,t)=>new l.default(e,t).prefix()))},2210: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}),i=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 l=i(n(6483));t.isPostCSSv8=e=>void 0!==e.Root,t.asPostCSSv8PluginGenerator=()=>(e,t)=>{const n=new l.default(e,t);return{postcssPlugin:l.PLUGIN_NAME,Once(e){n.prefixRoot(e)}}}},6764:function(e,t,n){"use strict";const o=n(2210),r=n(504);e.exports=e=>(0,o.isPostCSSv8)(e)?(0,o.asPostCSSv8PluginGenerator)():(0,r.asPostCSSv7PluginGenerator)(e)},6483:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLUGIN_NAME=void 0;const o=n(3626),r=n(5318);t.PLUGIN_NAME="postcss-prefixwrap",t.default=class{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)}}}},7036:function(e,t,n){const o=n(825);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const r=o(n.value);let i=!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(),i=!0),!1})),i&&(n.value=o.stringify(r))}}},e.exports.postcss=!0},825:function(e,t,n){var o=n(7746),r=n(1059),i=n(9995);function l(e){return this instanceof l?(this.nodes=o(e),this):new l(e)}l.prototype.toString=function(){return Array.isArray(this.nodes)?i(this.nodes):""},l.prototype.walk=function(e,t){return r(this.nodes,e,t),this},l.unit=n(4358),l.walk=r,l.stringify=i,e.exports=l},7746:function(e){var t="(".charCodeAt(0),n=")".charCodeAt(0),o="'".charCodeAt(0),r='"'.charCodeAt(0),i="\\".charCodeAt(0),l="/".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,f,g,b,v,k,_,y,w,E=[],S=e,C=0,x=S.charCodeAt(C),B=S.length,I=[{nodes:E}],T=0,P="",M="",R="";C<B;)if(x<=32){h=C;do{h+=1,x=S.charCodeAt(h)}while(x<=32);b=S.slice(C,h),g=E[E.length-1],x===n&&T?R=b:g&&"div"===g.type?(g.after=b,g.sourceEndIndex+=b.length):x===s||x===a||x===l&&S.charCodeAt(h+1)!==c&&(!w||w&&"function"===w.type&&"calc"!==w.value)?M=b:E.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:f=x===o?"'":'"'};do{if(v=!1,~(h=S.indexOf(f,h+1)))for(k=h;S.charCodeAt(k-1)===i;)k-=1,v=!v;else h=(S+=f).length-1,b.unclosed=!0}while(v);b.value=S.slice(C+1,h),b.sourceEndIndex=b.unclosed?h:h+1,E.push(b),C=h+1,x=S.charCodeAt(C)}else if(x===l&&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),E.push(b),C=h+2,x=S.charCodeAt(C);else if(x!==l&&x!==c||!w||"function"!==w.type||"calc"!==w.value)if(x===l||x===s||x===a)b=S[C],E.push({type:"div",sourceIndex:C-M.length,sourceEndIndex:C+b.length,value:b,before:M,after:""}),M="",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-P.length,value:P,before:S.slice(y+1,h)},C=h,"url"===P&&x!==o&&x!==r){h-=1;do{if(v=!1,~(h=S.indexOf(")",h+1)))for(k=h;S.charCodeAt(k-1)===i;)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),E.push(b)}else T+=1,b.after="",b.sourceEndIndex=C+1,E.push(b),I.push(b),E=b.nodes=[],w=b;P=""}else if(n===x&&T)C+=1,x=S.charCodeAt(C),w.after=R,w.sourceEndIndex+=R.length,R="",T-=1,I[I.length-1].sourceEndIndex=C,I.pop(),E=(w=I[T]).nodes;else{h=C;do{x===i&&(h+=1),h+=1,x=S.charCodeAt(h)}while(h<B&&!(x<=32||x===o||x===r||x===s||x===a||x===l||x===t||x===c&&w&&"function"===w.type&&"calc"===w.value||x===l&&"function"===w.type&&"calc"===w.value||x===n&&T));b=S.slice(C,h),t===x?P=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||p!==b.charCodeAt(1)||!m.test(b.slice(2))?E.push({type:"word",sourceIndex:C,sourceEndIndex:h,value:b}):E.push({type:"unicode-range",sourceIndex:C,sourceEndIndex:h,value:b}),C=h}else b=S[C],E.push({type:"word",sourceIndex:C-M.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}},9995:function(e){function t(e,t){var o,r,i=e.type,l=e.value;return t&&void 0!==(r=t(e))?r:"word"===i||"space"===i?l:"string"===i?(o=e.quote||"")+l+(e.unclosed?"":o):"comment"===i?"/*"+l+(e.unclosed?"":"*/"):"div"===i?(e.before||"")+l+(e.after||""):Array.isArray(e.nodes)?(o=n(e.nodes,t),"function"!==i?o:l+"("+(e.before||"")+o+(e.after||"")+(e.unclosed?"":")")):l}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},4358:function(e){var t="-".charCodeAt(0),n="+".charCodeAt(0),o=".".charCodeAt(0),r="e".charCodeAt(0),i="E".charCodeAt(0);e.exports=function(e){var l,s,a,c=0,u=e.length;if(0===u||!function(e){var r,i=e.charCodeAt(0);if(i===n||i===t){if((r=e.charCodeAt(1))>=48&&r<=57)return!0;var l=e.charCodeAt(2);return r===o&&l>=48&&l<=57}return i===o?(r=e.charCodeAt(1))>=48&&r<=57:i>=48&&i<=57}(e))return!1;for((l=e.charCodeAt(c))!==n&&l!==t||c++;c<u&&!((l=e.charCodeAt(c))<48||l>57);)c+=1;if(l=e.charCodeAt(c),s=e.charCodeAt(c+1),l===o&&s>=48&&s<=57)for(c+=2;c<u&&!((l=e.charCodeAt(c))<48||l>57);)c+=1;if(l=e.charCodeAt(c),s=e.charCodeAt(c+1),a=e.charCodeAt(c+2),(l===r||l===i)&&(s>=48&&s<=57||(s===n||s===t)&&a>=48&&a<=57))for(c+=s===n||s===t?3:2;c<u&&!((l=e.charCodeAt(c))<48||l>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},1059:function(e){e.exports=function e(t,n,o){var r,i,l,s;for(r=0,i=t.length;r<i;r+=1)l=t[r],o||(s=n(l,r,t)),!1!==s&&"function"===l.type&&Array.isArray(l.nodes)&&e(l.nodes,n,o),o&&n(l,r,t)}},2433:function(e,t,n){"use strict";let o=n(9795);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)},9882:function(e,t,n){"use strict";let o=n(8753);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},9795:function(e,t,n){"use strict";let o,r,i,l,{isClean:s,my:a}=n(3719),c=n(5818),u=n(9882),d=n(8753);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{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}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}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}))}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)})))}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)}))}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}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}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let n,o=0===(e=this.index(e))&&"prepend",r=this.normalize(t,this.proxyOf.nodes[e],o).reverse();for(let t of r)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)n=this.indexes[t],e<=n&&(this.indexes[t]=n+r.length);return this.markDirty(),this}insertAfter(e,t){e=this.index(e);let n,o=this.normalize(t,this.proxyOf.nodes[e]).reverse();for(let t of o)this.proxyOf.nodes.splice(e+1,0,t);for(let t in this.indexes)n=this.indexes[t],e<n&&(this.indexes[t]=n+o.length);return 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}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],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}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}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]}normalize(e,t){if("string"==typeof e)e=p(o(e).nodes);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 i(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)))}getProxyProcessor(){return{set(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0},get(e,t){return"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]}}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}}h.registerParse=e=>{o=e},h.registerRule=e=>{r=e},h.registerAtRule=e=>{i=e},h.registerRoot=e=>{l=e},e.exports=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,i.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,l.prototype),e[a]=!0,e.nodes&&e.nodes.forEach((e=>{h.rebuild(e)}))}},8743:function(e,t,n){"use strict";let o=n(9122),r=n(2868);class i extends Error{constructor(e,t,n,o,r,l){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),l&&(this.plugin=l),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,i)}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,i,l=t.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,l.length),c=String(a).length;if(e){let{bold:e,red:t,gray:r}=o.createColors(!0);n=n=>e(t(n)),i=e=>r(e)}else n=i=e=>e;return l.slice(s,a).map(((e,t)=>{let o=s+1+t,r=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=i(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+i(r)+e+"\n "+t+n("^")}return" "+i(r)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=i,i.default=i},5818:function(e,t,n){"use strict";let o=n(8753);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},3866:function(e,t,n){"use strict";let o,r,i=n(9795);class l extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{r=e},e.exports=l,l.default=l},3667:function(e,t,n){"use strict";let o=n(5818),r=n(2393),i=n(9882),l=n(2433),s=n(9961),a=n(3823),c=n(5871);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 i(d);if("atrule"===d.type)return new l(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},9961:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(209),{fileURLToPath:i,pathToFileURL:l}=n(7414),{resolve:s,isAbsolute:a}=n(9830),{nanoid:c}=n(2961),u=n(2868),d=n(8743),p=n(2393),m=Symbol("fromOffsetCache"),h=Boolean(o&&r),f=Boolean(s&&a);class g{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&&(!f||/^\w+:\/\//.test(t.from)||a(t.from)?this.file=t.from:this.file=s(t.from)),f&&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)}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{line:o+1,col:e-n[o]+1}}error(e,t,n,o={}){let r,i,s;if(t&&"object"==typeof t){let e=t,o=n;if("number"==typeof t.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);i=e.line,s=e.col}else i=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,i,s);return r=a?new d(e,void 0===a.endLine?a.line:{line:a.line,column:a.column},void 0===a.endLine?a.column:{line:a.endLine,column:a.endColumn},a.source,a.file,o.plugin):new d(e,void 0===i?t:{line:t,column:n},void 0===i?n:{line:i,column:s},this.css,this.file,o.plugin),r.input={line:t,column:n,endLine:i,endColumn:s,source:this.css},this.file&&(l&&(r.input.url=l(this.file).toString()),r.input.file=this.file),r}origin(e,t,n,o){if(!this.map)return!1;let r,s,c=this.map.consumer(),u=c.originalPositionFor({line:e,column:t});if(!u.source)return!1;"number"==typeof n&&(r=c.originalPositionFor({line:n,column:o})),s=a(u.source)?l(u.source):new URL(u.source,this.map.consumer().sourceRoot||l(this.map.mapFile));let d={url:s.toString(),line:u.line,column:u.column,endLine:r&&r.line,endColumn:r&&r.column};if("file:"===s.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");d.file=i(s)}let p=c.sourceContentFor(u.source);return p&&(d.source=p),d}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}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}}e.exports=g,g.default=g,u&&u.registerInput&&u.registerInput(g)},3993:function(e,t,n){"use strict";let{isClean:o,my:r}=n(3719),i=n(2491),l=n(2530),s=n(9795),a=n(3866),c=(n(7892),n(2072)),u=n(9301),d=n(3823);const p={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},m={postcssPlugin:!0,prepare:!0,Once:!0,Document:!0,Root:!0,Declaration:!0,Rule:!0,AtRule:!0,Comment:!0,DeclarationExit:!0,RuleExit:!0,AtRuleExit:!0,CommentExit:!0,RootExit:!0,DocumentExit:!0,OnceExit:!0},h={postcssPlugin:!0,prepare:!0,Once:!0},f=0;function g(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,f,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,f,n+"Exit"]:[n,n+"Exit"]}function v(e){let t;return t="document"===e.type?["Document",f,"DocumentExit"]:"root"===e.type?["Root",f,"RootExit"]:b(e),{node:e,events:t,eventIndex:0,visitors:[],visitorIndex:0,iterator:0}}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={..._,result:this.result,postcss:_},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}get[Symbol.toStringTag](){return"LazyResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.stringify().css}get content(){return this.stringify().content}get map(){return this.stringify().map}get root(){return this.sync().root}get messages(){return this.sync().messages}warnings(){return this.sync().warnings()}toString(){return this.css}then(e,t){return this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}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(g(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}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=l;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new i(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}walkSync(e){e[o]=!0;let t=b(e);for(let n of t)if(n===f)e.nodes&&e.each((e=>{e[o]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}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(g(e))throw this.getAsyncError()}}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 g(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)}}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}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(g(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(g(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()}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}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,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[o])return r[o]=!0,void e.push(v(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,e===f)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()}}y.registerPostcss=e=>{_=e},e.exports=y,y.default=y,d.registerLazyResult(y),a.registerLazyResult(y)},8446:function(e){"use strict";let t={split(e,t,n){let o=[],r="",i=!1,l=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?l+=1:")"===n?l>0&&(l-=1):0===l&&t.includes(n)&&(i=!0),i?(""!==r&&o.push(r.trim()),r="",i=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o},space(e){return t.split(e,[" ","\n","\t"])},comma(e){return t.split(e,[","],!0)}};e.exports=t,t.default=t},2491:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(209),{dirname:i,resolve:l,relative:s,sep:a}=n(9830),{pathToFileURL:c}=n(7414),u=n(9961),d=Boolean(o&&r),p=Boolean(i&&l&&s&&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}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}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.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}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)))}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}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,""))}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;n&&!e[n]&&(e[n]=!0,this.map.setSourceContent(this.toUrl(this.path(n)),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)}}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||i(e.file);!1===this.mapOpts.sourcesContent?(t=new o(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}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+" */"}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}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({source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",generated:{line:1,column:0},original:{line:1,column:0}});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]}path(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;if(this.mapOpts.absolute)return e;let t=this.opts.to?i(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=i(l(t,this.mapOpts.annotation))),s(t,e)}toUrl(e){return"\\"===a&&(e=e.replace(/\\/g,"/")),encodeURI(e).replace(/[#?]/g,encodeURIComponent)}sourcePath(e){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);if(this.mapOpts.absolute){if(c)return c(e.source.input.from).toString();throw new Error("`map.absolute` option is not available in this PostCSS build")}return this.toUrl(this.path(e.source.input.from))}generateString(){this.css="",this.map=new r({file:this.outputFile()});let e,t,n=1,o=1,i="<no source>",l={source:"",generated:{line:0,column:0},original:{line:0,column:0}};this.stringify(this.root,((r,s,a)=>{if(this.css+=r,s&&"end"!==a&&(l.generated.line=n,l.generated.column=o-1,s.source&&s.source.start?(l.source=this.sourcePath(s),l.original.line=s.source.start.line,l.original.column=s.source.start.column-1,this.map.addMapping(l)):(l.source=i,l.original.line=1,l.original.column=0,this.map.addMapping(l))),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||s!==e.last||e.raws.semicolon)&&(s.source&&s.source.end?(l.source=this.sourcePath(s),l.original.line=s.source.end.line,l.original.column=s.source.end.column-1,l.generated.line=n,l.generated.column=o-2,this.map.addMapping(l)):(l.source=i,l.original.line=1,l.original.column=0,l.generated.line=n,l.generated.column=o-1,this.map.addMapping(l)))}}))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}}},2882:function(e,t,n){"use strict";let o=n(2491),r=n(2530),i=(n(7892),n(9301));const l=n(2072);class s{constructor(e,t,n){let i;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 l(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get(){return a.root}});let c=new o(s,i,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}get[Symbol.toStringTag](){return"NoWorkResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.result.css}get content(){return this.result.css}get map(){return this.result.map}get root(){if(this._root)return this._root;let e,t=i;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get messages(){return[]}warnings(){return[]}toString(){return this._css}then(e,t){return this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}sync(){if(this.error)throw this.error;return this.result}}e.exports=s,s.default=s},8753:function(e,t,n){"use strict";let{isClean:o,my:r}=n(3719),i=n(8743),l=n(3951),s=n(2530);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],i=typeof r;"parent"===o&&"object"===i?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===i&&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]}error(e,t={}){if(this.source){let{start:n,end:o}=this.rangeBy(t);return this.source.input.error(e,{line:n.line,column:n.column},{line:o.line,column:o.column},t)}return new i(e)}warn(e,t,n){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}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}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}raw(e,t){return(new l).raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}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 i=t.get(o.input);null==i&&(i=r,t.set(o.input,r),r++),n[e]={inputId:i,start:o.start,end:o.end}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}positionInside(e){let t=this.toString(),n=this.source.start.column,o=this.source.start.line;for(let r=0;r<e;r++)"\n"===t[r]?(n=1,o+=1):n+=1;return{line:o,column:n}}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}rangeBy(e){let t={line:this.source.start.line,column:this.source.start.column},n=this.source.end?{line:this.source.end.line,column:this.source.end.column+1}:{line:t.line,column:t.column+1};if(e.word){let o=this.toString().indexOf(e.word);-1!==o&&(t=this.positionInside(o),n=this.positionInside(o+e.word.length))}else e.start?t={line:e.start.line,column:e.start.column}:e.index&&(t=this.positionInside(e.index)),e.end?n={line:e.end.line,column:e.end.column}: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={line:t.line,column:t.column+1}),{start:t,end:n}}getProxyProcessor(){return{set(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0},get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]}}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}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}markDirty(){if(this[o]){this[o]=!1;let e=this;for(;e=e.parent;)e[o]=!1}}get proxyOf(){return this}}e.exports=c,c.default=c},9301:function(e,t,n){"use strict";let o=n(9795),r=n(3915),i=n(9961);function l(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=l,l.default=l,o.registerParse(l)},3915:function(e,t,n){"use strict";let o=n(5818),r=n(9215),i=n(9882),l=n(2433),s=n(3823),a=n(5871);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.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=r(this.input)}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()}comment(e){let t=new i;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);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]}}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,n=null,o=!1,r=null,i=[],l=e[1].startsWith("--"),s=[],a=e;for(;a;){if(n=a[0],s.push(a),"("===n||"["===n)r||(r=a),i.push("("===n?")":"]");else if(l&&o&&"{"===n)r||(r=a),i.push("}");else if(0===i.length){if(";"===n){if(o)return void this.decl(s,l);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(o=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(r),t&&o){if(!l)for(;s.length&&(a=s[s.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}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}decl(e,t){let n=new o;this.init(n,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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));"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 l,s=[];for(;e.length&&(l=e[0][0],"space"===l||"comment"===l);)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)}atrule(e){let t,n,o,r=new l;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let i=!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]),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]))}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),i&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)}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=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}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{offset:e,line:t.line,column:t.col}}init(e,t){this.current.push(e),e.source={start:this.getPosition(t),input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}raw(e,t,n,o){let r,i,l,s,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],i=r[0],"space"!==i||e!==a-1||o?"comment"===i?(s=n[e-1]?n[e-1][0]:"empty",l=n[e+1]?n[e+1][0]:"empty",c[s]||c[l]||","===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]={value:u,raw:o}}e[t]=u}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}colon(e){let t,n,o,r=0;for(let[i,l]of e.entries()){if(t=l,n=t[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return i}this.doubleColon(t)}o=t}return!1}unclosedBracket(e){throw this.input.error("Unclosed bracket",{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})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}precheckMissedSemicolon(){}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])}}},4743:function(e,t,n){"use strict";let o=n(8743),r=n(5818),i=n(3993),l=n(9795),s=n(5937),a=n(2530),c=n(3667),u=n(3866),d=n(9871),p=n(9882),m=n(2433),h=n(2072),f=n(9961),g=n(9301),b=n(8446),v=n(5871),k=n(3823),_=n(8753);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(){return n||(n=r()),n}}),r.process=function(e,t,n){return y([r(n)]).process(e,t)},r},y.stringify=a,y.parse=g,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=l,y.Processor=s,y.Document=u,y.Comment=p,y.Warning=d,y.AtRule=m,y.Result=h,y.Input=f,y.Rule=v,y.Root=k,y.Node=_,i.registerPostcss(y),e.exports=y,y.default=y},2393:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(209),{existsSync:i,readFileSync:l}=n(4777),{dirname:s,join:a}=n(9830);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}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}startWith(e,t){return!!e&&e.substr(0,t.length)===t}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}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)))}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)}loadFile(e){if(this.root=s(e),i(e))return this.mapFile=e,l(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)}}}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}}e.exports=c,c.default=c},5937:function(e,t,n){"use strict";let o=n(2882),r=n(3993),i=n(3866),l=n(3823);class s{constructor(e=[]){this.version="8.4.16",this.plugins=this.normalize(e)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new o(this,e,t):new r(this,e,t)}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}}e.exports=s,s.default=s,l.registerProcessor(s),i.registerProcessor(s)},2072:function(e,t,n){"use strict";let o=n(9871);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},3823:function(e,t,n){"use strict";let o,r,i=n(9795);class l extends i{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}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)}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}toResult(e={}){return new o(new r,this,e).stringify()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{r=e},e.exports=l,l.default=l,i.registerRoot(l)},5871:function(e,t,n){"use strict";let o=n(9795),r=n(8446);class i 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=i,i.default=i,o.registerRule(i)},3951:function(e){"use strict";const t={colon:": ",indent:"    ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};class n{constructor(e){this.builder=e}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)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}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)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}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)}}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],i=this.raw(r,"before");i&&this.builder(i),this.stringify(r,t!==o||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")}raw(e,n,o){let r;if(o||(o=n),n&&(r=e.raws[n],void 0!==r))return r;let i=e.parent;if("before"===o){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return t[o];let l=e.root();if(l.rawCache||(l.rawCache={}),void 0!==l.rawCache[o])return l.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](l,e):l.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var s;return void 0===r&&(r=t[o]),l.rawCache[o]=r,r}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}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}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}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}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}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),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}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}rawValue(e,t){let n=e[t],o=e.raws[t];return o&&o.value===n?o.raw:n}}e.exports=n,n.default=n},2530:function(e,t,n){"use strict";let o=n(3951);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},3719:function(e){"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},9215:function(e){"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),r="/".charCodeAt(0),i="\n".charCodeAt(0),l=" ".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),f="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),v=":".charCodeAt(0),k="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\n"'(/\\]/,E=/[\da-f]/i;e.exports=function(e,S={}){let C,x,B,I,T,P,M,R,A,N,L=e.css.valueOf(),O=S.ignoreErrors,D=L.length,z=0,F=[],V=[];function H(t){throw e.error("Unclosed "+t,z)}return{back:function(e){V.push(e)},nextToken:function(e){if(V.length)return V.pop();if(z>=D)return;let S=!!e&&e.ignoreUnclosed;switch(C=L.charCodeAt(z),C){case i:case l:case a:case c:case s:x=z;do{x+=1,C=L.charCodeAt(x)}while(C===l||C===i||C===a||C===c||C===s);N=["space",L.slice(z,x)],z=x-1;break;case u:case d:case h:case f:case v:case g:case m:{let e=String.fromCharCode(C);N=[e,e,z];break}case p:if(R=F.length?F.pop()[1]:"",A=L.charCodeAt(z+1),"url"===R&&A!==t&&A!==n&&A!==l&&A!==i&&A!==a&&A!==s&&A!==c){x=z;do{if(P=!1,x=L.indexOf(")",x+1),-1===x){if(O||S){x=z;break}H("bracket")}for(M=x;L.charCodeAt(M-1)===o;)M-=1,P=!P}while(P);N=["brackets",L.slice(z,x+1),z,x],z=x}else x=L.indexOf(")",z+1),I=L.slice(z,x+1),-1===x||w.test(I)?N=["(","(",z]:(N=["brackets",I,z,x],z=x);break;case t:case n:B=C===t?"'":'"',x=z;do{if(P=!1,x=L.indexOf(B,x+1),-1===x){if(O||S){x=z+1;break}H("string")}for(M=x;L.charCodeAt(M-1)===o;)M-=1,P=!P}while(P);N=["string",L.slice(z,x+1),z,x],z=x;break;case k:_.lastIndex=z+1,_.test(L),x=0===_.lastIndex?L.length-1:_.lastIndex-2,N=["at-word",L.slice(z,x+1),z,x],z=x;break;case o:for(x=z,T=!0;L.charCodeAt(x+1)===o;)x+=1,T=!T;if(C=L.charCodeAt(x+1),T&&C!==r&&C!==l&&C!==i&&C!==a&&C!==c&&C!==s&&(x+=1,E.test(L.charAt(x)))){for(;E.test(L.charAt(x+1));)x+=1;L.charCodeAt(x+1)===l&&(x+=1)}N=["word",L.slice(z,x+1),z,x],z=x;break;default:C===r&&L.charCodeAt(z+1)===b?(x=L.indexOf("*/",z+2)+1,0===x&&(O||S?x=L.length:H("comment")),N=["comment",L.slice(z,x+1),z,x],z=x):(y.lastIndex=z+1,y.test(L),x=0===y.lastIndex?L.length-1:y.lastIndex-2,N=["word",L.slice(z,x+1),z,x],F.push(N),z=x)}return z++,N},endOfFile:function(){return 0===V.length&&z>=D},position:function(){return z}}}},7892:function(e){"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},9871:function(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,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},5372:function(e,t,n){"use strict";var o=n(9567);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,l){if(l!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,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 __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=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},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=l(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",i({},a,{onChange:this.onChange,style:u?i({},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,i({},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 i(e){return t[e]}var l=function(e){return e.replace(o,i)};e.exports=l,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=l},8240:function(e,t,n){"use strict";let o=n(8376);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)},6065:function(e,t,n){"use strict";let o=n(8282);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},8376:function(e,t,n){"use strict";let o,r,i,l,{isClean:s,my:a}=n(8745),c=n(8218),u=n(6065),d=n(8282);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){return"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){return 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",i=this.normalize(t,this.proxyOf.nodes[o],r).reverse();o=this.index(e);for(let e of i)this.proxyOf.nodes.splice(o,0,e);for(let e in this.indexes)n=this.indexes[e],o<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(o(e).nodes);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 i(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=>{i=e},h.registerRoot=e=>{l=e},e.exports=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,i.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,l.prototype),e[a]=!0,e.nodes&&e.nodes.forEach((e=>{h.rebuild(e)}))}},596:function(e,t,n){"use strict";let o=n(9122),r=n(817);class i extends Error{constructor(e,t,n,o,r,l){super(e),this.name="CssSyntaxError",this.reason=e,r&&(this.file=r),o&&(this.source=o),l&&(this.plugin=l),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,i)}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,i,l=t.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,l.length),c=String(a).length;if(e){let{bold:e,gray:t,red:r}=o.createColors(!0);n=t=>e(r(t)),i=e=>t(e)}else n=i=e=>e;return l.slice(s,a).map(((e,t)=>{let o=s+1+t,r=" "+(" "+o).slice(-c)+" | ";if(o===this.line){let t=i(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+i(r)+e+"\n "+t+n("^")}return" "+i(r)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=i,i.default=i},8218:function(e,t,n){"use strict";let o=n(8282);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},9449:function(e,t,n){"use strict";let o,r,i=n(8376);class l extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new o(new r,this,e).stringify()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{r=e},e.exports=l,l.default=l},6662:function(e,t,n){"use strict";let o=n(8218),r=n(6590),i=n(6065),l=n(8240),s=n(5368),a=n(3008),c=n(1354);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 i(d);if("atrule"===d.type)return new l(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5368:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(3067),{fileURLToPath:i,pathToFileURL:l}=n(6364),{isAbsolute:s,resolve:a}=n(4779),{nanoid:c}=n(2961),u=n(817),d=n(596),p=n(6590),m=Symbol("fromOffsetCache"),h=Boolean(o&&r),f=Boolean(a&&s);class g{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&&(!f||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=a(t.from)),f&&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,i,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);i=e.line,s=e.col}else i=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,i,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===i?t:{column:n,line:t},void 0===i?n:{column:s,line:i},this.css,this.file,o.plugin),r.input={column:n,endColumn:s,endLine:i,line:t,source:this.css},this.file&&(l&&(r.input.url=l(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)?l(u.source):new URL(u.source,this.map.consumer().sourceRoot||l(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(!i)throw new Error("file: protocol is not available in this PostCSS build");d.file=i(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=g,g.default=g,u&&u.registerInput&&u.registerInput(g)},544:function(e,t,n){"use strict";let{isClean:o,my:r}=n(8745),i=n(573),l=n(2847),s=n(8376),a=n(9449),c=(n(5905),n(897)),u=n(8199),d=n(3008);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},f=0;function g(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,f,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,f,n+"Exit"]:[n,n+"Exit"]}function v(e){let t;return t="document"===e.type?["Document",f,"DocumentExit"]:"root"===e.type?["Root",f,"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(g(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(g(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 g(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=l;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new i(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(g(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(g(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,i=t.iterator;for(;r=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!r[o])return r[o]=!0,void e.push(v(r));t.iterator=0,delete n.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,e===f)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===f)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)},454:function(e){"use strict";let t={comma(e){return t.split(e,[","],!0)},space(e){return t.split(e,[" ","\n","\t"])},split(e,t,n){let o=[],r="",i=!1,l=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?l+=1:")"===n?l>0&&(l-=1):0===l&&t.includes(n)&&(i=!0),i?(""!==r&&o.push(r.trim()),r="",i=!1):r+=n;return(n||""!==r)&&o.push(r.trim()),o}};e.exports=t,t.default=t},573:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(3067),{dirname:i,relative:l,resolve:s,sep:a}=n(4779),{pathToFileURL:c}=n(6364),u=n(5368),d=Boolean(o&&r),p=Boolean(i&&s&&l&&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.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||i(e.file);!1===this.mapOpts.sourcesContent?(t=new o(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>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,i="<no source>",l={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&&(l.generated.line=n,l.generated.column=o-1,s.source&&s.source.start?(l.source=this.sourcePath(s),l.original.line=s.source.start.line,l.original.column=s.source.start.column-1,this.map.addMapping(l)):(l.source=i,l.original.line=1,l.original.column=0,this.map.addMapping(l))),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?(l.source=this.sourcePath(s),l.original.line=s.source.end.line,l.original.column=s.source.end.column-1,l.generated.line=n,l.generated.column=o-2,this.map.addMapping(l)):(l.source=i,l.original.line=1,l.original.column=0,l.generated.line=n,l.generated.column=o-1,this.map.addMapping(l)))}}))}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?i(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=i(s(n,this.mapOpts.annotation)));let o=l(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.css,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}}},3351:function(e,t,n){"use strict";let o=n(573),r=n(2847),i=(n(5905),n(8199));const l=n(897);class s{constructor(e,t,n){let i;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 l(this._processor,i,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get(){return a.root}});let c=new o(s,i,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}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=i;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},8282:function(e,t,n){"use strict";let{isClean:o,my:r}=n(8745),i=n(596),l=n(1629),s=n(2847);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],i=typeof r;"parent"===o&&"object"===i?t&&(n[o]=t):"source"===o?n[o]=r:Array.isArray(r)?n[o]=r.map((e=>a(e,n))):("object"===i&&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 i(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,n){return 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 l).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 i=t.get(o.input);null==i&&(i=r,t.set(o.input,r),r++),n[e]={end:o.end,inputId:i,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},8199:function(e,t,n){"use strict";let o=n(8376),r=n(7043),i=n(5368);function l(e,t){let n=new i(e,t),o=new r(n);try{o.parse()}catch(e){throw e}return o.root}e.exports=l,l.default=l,o.registerParse(l)},7043:function(e,t,n){"use strict";let o=n(8218),r=n(9656),i=n(6065),l=n(8240),s=n(3008),a=n(1354);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.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,o,r=new l;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let i=!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()){i=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),i&&(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[i,l]of e.entries()){if(t=l,n=t[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(o){if("word"===o[0]&&"progid"===o[1])continue;return i}this.doubleColon(t)}o=t}return!1}comment(e){let t=new i;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,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[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 l,s=[];for(;e.length&&(l=e[0][0],"space"===l||"comment"===l);)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,i=[],l=e[1].startsWith("--"),s=[],a=e;for(;a;){if(n=a[0],s.push(a),"("===n||"["===n)r||(r=a),i.push("("===n?")":"]");else if(l&&o&&"{"===n)r||(r=a),i.push("}");else if(0===i.length){if(";"===n){if(o)return void this.decl(s,l);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(o=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(r=null));a=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(r),t&&o){if(!l)for(;s.length&&(a=s[s.length-1][0],"space"===a||"comment"===a);)this.tokenizer.back(s.pop());this.decl(s,l)}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,i,l,s,a=n.length,u="",d=!0;for(let e=0;e<a;e+=1)r=n[e],i=r[0],"space"!==i||e!==a-1||o?"comment"===i?(s=n[e-1]?n[e-1][0]:"empty",l=n[e+1]?n[e+1][0]:"empty",c[s]||c[l]||","===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})}}},2438:function(e,t,n){"use strict";let o=n(596),r=n(8218),i=n(544),l=n(8376),s=n(3896),a=n(2847),c=n(6662),u=n(9449),d=n(8526),p=n(6065),m=n(8240),h=n(897),f=n(5368),g=n(8199),b=n(454),v=n(1354),k=n(3008),_=n(8282);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(){return n||(n=r()),n}}),r.process=function(e,t,n){return y([r(n)]).process(e,t)},r},y.stringify=a,y.parse=g,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=l,y.Processor=s,y.Document=u,y.Comment=p,y.Warning=d,y.AtRule=m,y.Result=h,y.Input=f,y.Rule=v,y.Root=k,y.Node=_,i.registerPostcss(y),e.exports=y,y.default=y},6590:function(e,t,n){"use strict";let{SourceMapConsumer:o,SourceMapGenerator:r}=n(3067),{existsSync:i,readFileSync:l}=n(6738),{dirname:s,join:a}=n(4779);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),i(e))return this.mapFile=e,l(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},3896:function(e,t,n){"use strict";let o=n(3351),r=n(544),i=n(9449),l=n(3008);class s{constructor(e=[]){this.version="8.4.30",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 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new o(this,e,t):new r(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=s,s.default=s,l.registerProcessor(s),i.registerProcessor(s)},897:function(e,t,n){"use strict";let o=n(8526);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},3008:function(e,t,n){"use strict";let o,r,i=n(8376);class l extends i{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()}}l.registerLazyResult=e=>{o=e},l.registerProcessor=e=>{r=e},e.exports=l,l.default=l,i.registerRoot(l)},1354:function(e,t,n){"use strict";let o=n(8376),r=n(454);class i 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=i,i.default=i,o.registerRule(i)},1629:function(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],i=this.raw(r,"before");i&&this.builder(i),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 i=e.parent;if("before"===o){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return t[o];let l=e.root();if(l.rawCache||(l.rawCache={}),void 0!==l.rawCache[o])return l.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](l,e):l.walk((e=>{if(r=e.raws[n],void 0!==r)return!1}))}var s;return void 0===r&&(r=t[o]),l.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},2847:function(e,t,n){"use strict";let o=n(1629);function r(e,t){new o(t).stringify(e)}e.exports=r,r.default=r},8745:function(e){"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},9656:function(e){"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),o="\\".charCodeAt(0),r="/".charCodeAt(0),i="\n".charCodeAt(0),l=" ".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),f="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),v=":".charCodeAt(0),k="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,y=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\n"'(/\\]/,E=/[\da-f]/i;e.exports=function(e,S={}){let C,x,B,I,T,P,M,R,A,N,L=e.css.valueOf(),O=S.ignoreErrors,D=L.length,z=0,F=[],V=[];function H(t){throw e.error("Unclosed "+t,z)}return{back:function(e){V.push(e)},endOfFile:function(){return 0===V.length&&z>=D},nextToken:function(e){if(V.length)return V.pop();if(z>=D)return;let S=!!e&&e.ignoreUnclosed;switch(C=L.charCodeAt(z),C){case i:case l:case a:case c:case s:x=z;do{x+=1,C=L.charCodeAt(x)}while(C===l||C===i||C===a||C===c||C===s);N=["space",L.slice(z,x)],z=x-1;break;case u:case d:case h:case f:case v:case g:case m:{let e=String.fromCharCode(C);N=[e,e,z];break}case p:if(R=F.length?F.pop()[1]:"",A=L.charCodeAt(z+1),"url"===R&&A!==t&&A!==n&&A!==l&&A!==i&&A!==a&&A!==s&&A!==c){x=z;do{if(P=!1,x=L.indexOf(")",x+1),-1===x){if(O||S){x=z;break}H("bracket")}for(M=x;L.charCodeAt(M-1)===o;)M-=1,P=!P}while(P);N=["brackets",L.slice(z,x+1),z,x],z=x}else x=L.indexOf(")",z+1),I=L.slice(z,x+1),-1===x||w.test(I)?N=["(","(",z]:(N=["brackets",I,z,x],z=x);break;case t:case n:B=C===t?"'":'"',x=z;do{if(P=!1,x=L.indexOf(B,x+1),-1===x){if(O||S){x=z+1;break}H("string")}for(M=x;L.charCodeAt(M-1)===o;)M-=1,P=!P}while(P);N=["string",L.slice(z,x+1),z,x],z=x;break;case k:_.lastIndex=z+1,_.test(L),x=0===_.lastIndex?L.length-1:_.lastIndex-2,N=["at-word",L.slice(z,x+1),z,x],z=x;break;case o:for(x=z,T=!0;L.charCodeAt(x+1)===o;)x+=1,T=!T;if(C=L.charCodeAt(x+1),T&&C!==r&&C!==l&&C!==i&&C!==a&&C!==c&&C!==s&&(x+=1,E.test(L.charAt(x)))){for(;E.test(L.charAt(x+1));)x+=1;L.charCodeAt(x+1)===l&&(x+=1)}N=["word",L.slice(z,x+1),z,x],z=x;break;default:C===r&&L.charCodeAt(z+1)===b?(x=L.indexOf("*/",z+2)+1,0===x&&(O||S?x=L.length:H("comment")),N=["comment",L.slice(z,x+1),z,x],z=x):(y.lastIndex=z+1,y.test(L),x=0===y.lastIndex?L.length-1:y.lastIndex-2,N=["word",L.slice(z,x+1),z,x],F.push(N),z=x)}return z++,N},position:function(){return z}}}},5905:function(e){"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},8526:function(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},9196:function(e){"use strict";e.exports=window.React},2868:function(){},4777:function(){},9830:function(){},209:function(){},7414:function(){},817:function(){},6738:function(){},4779:function(){},3067:function(){},6364:function(){},2961:function(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 i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.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 Uh},AlignmentToolbar:function(){return Gh},Autocomplete:function(){return kf},BlockAlignmentControl:function(){return $l},BlockAlignmentToolbar:function(){return jl},BlockBreadcrumb:function(){return xf},BlockCanvas:function(){return US},BlockColorsStyleSelector:function(){return WS},BlockContextProvider:function(){return Tf},BlockControls:function(){return bi},BlockEdit:function(){return Nf},BlockEditorKeyboardShortcuts:function(){return e_},BlockEditorProvider:function(){return n_},BlockFormatControls:function(){return gi},BlockIcon:function(){return hh},BlockInspector:function(){return GI},BlockList:function(){return oE},BlockMover:function(){return wE},BlockNavigationDropdown:function(){return EC},BlockPreview:function(){return H_},BlockSelectionClearer:function(){return r_},BlockSettingsMenu:function(){return yS},BlockSettingsMenuControls:function(){return ah},BlockStyles:function(){return xC},BlockTitle:function(){return Cf},BlockToolbar:function(){return NS},BlockTools:function(){return VS},BlockVerticalAlignmentControl:function(){return nl},BlockVerticalAlignmentToolbar:function(){return ol},ButtonBlockAppender:function(){return _w},ButtonBlockerAppender:function(){return kw},ColorPalette:function(){return QC},ColorPaletteControl:function(){return JC},ContrastChecker:function(){return Ou},CopyHandler:function(){return jI},DefaultBlockAppender:function(){return bw},FontSizePicker:function(){return Rh},HeadingLevelDropdown:function(){return MC},HeightControl:function(){return gp},InnerBlocks:function(){return qw},Inserter:function(){return gw},InspectorAdvancedControls:function(){return hs},InspectorControls:function(){return fs},JustifyContentControl:function(){return ll},JustifyToolbar:function(){return sl},LineHeightControl:function(){return ad},MediaPlaceholder:function(){return tB},MediaReplaceFlow:function(){return Fa},MediaUpload:function(){return Ps},MediaUploadCheck:function(){return Ms},MultiSelectScrollIntoView:function(){return ZI},NavigableToolbar:function(){return MS},ObserveTyping:function(){return Jw},PanelColorSettings:function(){return nB},PlainText:function(){return UB},ReusableBlocksRenameHint:function(){return fT},RichText:function(){return FB},RichTextShortcut:function(){return jB},RichTextToolbarButton:function(){return WB},SETTINGS_DEFAULTS:function(){return x},SkipToSelectedBlock:function(){return uI},ToolSelector:function(){return qB},Typewriter:function(){return JI},URLInput:function(){return Gs},URLInputButton:function(){return JB},URLPopover:function(){return Xx},Warning:function(){return Of},WritingFlow:function(){return w_},__experimentalBlockAlignmentMatrixControl:function(){return Ef},__experimentalBlockFullHeightAligmentControl:function(){return yf},__experimentalBlockPatternSetup:function(){return WC},__experimentalBlockPatternsList:function(){return gy},__experimentalBlockVariationPicker:function(){return AC},__experimentalBlockVariationTransforms:function(){return YC},__experimentalBorderRadiusControl:function(){return jc},__experimentalColorGradientControl:function(){return yu},__experimentalColorGradientSettingsDropdown:function(){return sx},__experimentalDateFormatPicker:function(){return nx},__experimentalDuotoneControl:function(){return rm},__experimentalFontAppearanceControl:function(){return sd},__experimentalFontFamilyControl:function(){return od},__experimentalGetBorderClassesAndStyles:function(){return kh},__experimentalGetColorClassesAndStyles:function(){return yh},__experimentalGetElementClassName:function(){return bT},__experimentalGetGapCSSValue:function(){return Ki},__experimentalGetGradientClass:function(){return pu},__experimentalGetGradientObjectByGradientValue:function(){return hu},__experimentalGetMatchingVariation:function(){return kT},__experimentalGetSpacingClassesAndStyles:function(){return Eh},__experimentalImageEditor:function(){return $x},__experimentalImageSizeControl:function(){return Kx},__experimentalImageURLInputUI:function(){return sI},__experimentalInspectorPopoverHeader:function(){return rT},__experimentalLetterSpacingControl:function(){return cd},__experimentalLibrary:function(){return KI},__experimentalLinkControl:function(){return Oa},__experimentalLinkControlSearchInput:function(){return ka},__experimentalLinkControlSearchItem:function(){return ia},__experimentalLinkControlSearchResults:function(){return pa},__experimentalListView:function(){return yC},__experimentalPanelColorGradientSettings:function(){return dx},__experimentalPreviewOptions:function(){return aI},__experimentalPublishDateTimePicker:function(){return iT},__experimentalRecursionProvider:function(){return tT},__experimentalResponsiveBlockControl:function(){return $B},__experimentalSpacingSizesControl:function(){return hp},__experimentalTextDecorationControl:function(){return kd},__experimentalTextTransformControl:function(){return fd},__experimentalUnitControl:function(){return YB},__experimentalUseBlockOverlayActive:function(){return Bf},__experimentalUseBlockPreview:function(){return U_},__experimentalUseBorderProps:function(){return _h},__experimentalUseColorProps:function(){return wh},__experimentalUseCustomSides:function(){return jp},__experimentalUseGradient:function(){return gu},__experimentalUseHasRecursion:function(){return nT},__experimentalUseMultipleOriginColorsAndGradients:function(){return Mc},__experimentalUseResizeCanvas:function(){return cI},__experimentalWritingModeControl:function(){return Ed},__unstableBlockNameContext:function(){return TS},__unstableBlockSettingsMenuFirstItem:function(){return fS},__unstableBlockToolbarLastItem:function(){return nS},__unstableEditorStyles:function(){return O_},__unstableIframe:function(){return x_},__unstableInserterMenuExtension:function(){return ow},__unstableRichTextInputEvent:function(){return KB},__unstableUseBlockSelectionClearer:function(){return o_},__unstableUseClipboardHandler:function(){return $I},__unstableUseMouseMoveTypingReset:function(){return Xw},__unstableUseTypewriter:function(){return QI},__unstableUseTypingObserver:function(){return Qw},createCustomColorsHOC:function(){return Ph},getColorClassName:function(){return Pc},getColorObjectByAttributeValues:function(){return Ic},getColorObjectByColorValue:function(){return Tc},getComputedFluidTypographyValue:function(){return Ar},getCustomValueFromPreset:function(){return Ui},getFontSize:function(){return $d},getFontSizeClass:function(){return Wd},getFontSizeObjectByValue:function(){return jd},getGradientSlugByValue:function(){return fu},getGradientValueBySlug:function(){return mu},getPxFromCssUnit:function(){return _T},getSpacingPresetCssVar:function(){return $i},getTypographyClassesAndStyles:function(){return Sh},isValueSpacingPreset:function(){return Hi},privateApis:function(){return DM},store:function(){return hr},storeConfig:function(){return mr},transformStyles:function(){return N_},useBlockCommands:function(){return mT},useBlockDisplayInformation:function(){return Em},useBlockEditContext:function(){return k},useBlockEditingMode:function(){return Wl},useBlockProps:function(){return zk},useCachedTruthy:function(){return Ch},useInnerBlocksProps:function(){return Zw},useSetting:function(){return xr},useSettings:function(){return Cr},withColorContext:function(){return XC},withColors:function(){return Mh},withFontSizes:function(){return Lh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return cn},__experimentalGetAllowedBlocks:function(){return zt},__experimentalGetAllowedPatterns:function(){return $t},__experimentalGetBlockListSettingsForBlocks:function(){return Xt},__experimentalGetDirectInsertBlock:function(){return Vt},__experimentalGetGlobalBlocksByName:function(){return ve},__experimentalGetLastBlockAttributeChanges:function(){return en},__experimentalGetParsedPattern:function(){return Ut},__experimentalGetPatternTransformItems:function(){return Kt},__experimentalGetPatternsByBlockTypes:function(){return Wt},__experimentalGetReusableBlockTitle:function(){return Qt},__experimentalUserPatternCategories:function(){return Ht},__unstableGetBlockWithoutInnerBlocks:function(){return de},__unstableGetClientIdWithClientIdsTree:function(){return me},__unstableGetClientIdsTree:function(){return he},__unstableGetContentLockingParent:function(){return mn},__unstableGetEditorMode:function(){return on},__unstableGetSelectedBlocksWithPartialSelection:function(){return Je},__unstableGetTemporarilyEditingAsBlocks:function(){return hn},__unstableGetVisibleBlocks:function(){return pn},__unstableHasActiveBlockOverlayActive:function(){return fn},__unstableIsFullySelected:function(){return qe},__unstableIsLastBlockChangeIgnored:function(){return Jt},__unstableIsSelectionCollapsed:function(){return Ye},__unstableIsSelectionMergeable:function(){return Qe},__unstableIsWithinBlockOverlay:function(){return gn},__unstableSelectionHasUnmergeableBlock:function(){return Xe},areInnerBlocksControlled:function(){return an},canEditBlock:function(){return It},canInsertBlockType:function(){return wt},canInsertBlocks:function(){return Et},canLockBlockType:function(){return Tt},canMoveBlock:function(){return xt},canMoveBlocks:function(){return Bt},canRemoveBlock:function(){return St},canRemoveBlocks:function(){return Ct},didAutomaticChange:function(){return ln},getAdjacentBlockClientId:function(){return Le},getAllowedBlocks:function(){return Dt},getBlock:function(){return ue},getBlockAttributes:function(){return ce},getBlockCount:function(){return ye},getBlockEditingMode:function(){return bn},getBlockHierarchyRootClientId:function(){return Ae},getBlockIndex:function(){return tt},getBlockInsertionPoint:function(){return gt},getBlockListSettings:function(){return Zt},getBlockMode:function(){return ct},getBlockName:function(){return se},getBlockNamesByClientId:function(){return _e},getBlockOrder:function(){return et},getBlockParents:function(){return Me},getBlockParentsByBlockName:function(){return Re},getBlockRootClientId:function(){return Pe},getBlockSelectionEnd:function(){return Ce},getBlockSelectionStart:function(){return Se},getBlockTransformItems:function(){return Lt},getBlocks:function(){return pe},getBlocksByClientId:function(){return ke},getClientIdsOfDescendants:function(){return fe},getClientIdsWithDescendants:function(){return ge},getDirectInsertBlock:function(){return Ft},getDraggedBlockClientIds:function(){return pt},getFirstMultiSelectedBlockClientId:function(){return Ue},getGlobalBlockCount:function(){return be},getInserterItems:function(){return Nt},getLastMultiSelectedBlockClientId:function(){return Ge},getLowestCommonAncestorWithSelectedBlock:function(){return Ne},getMultiSelectedBlockClientIds:function(){return Ve},getMultiSelectedBlocks:function(){return He},getMultiSelectedBlocksEndClientId:function(){return Ze},getMultiSelectedBlocksStartClientId:function(){return Ke},getNextBlockClientId:function(){return De},getPatternsByBlockTypes:function(){return jt},getPreviousBlockClientId:function(){return Oe},getSelectedBlock:function(){return Te},getSelectedBlockClientId:function(){return Ie},getSelectedBlockClientIds:function(){return Fe},getSelectedBlockCount:function(){return xe},getSelectedBlocksInitialCaretPosition:function(){return ze},getSelectionEnd:function(){return Ee},getSelectionStart:function(){return we},getSettings:function(){return qt},getTemplate:function(){return kt},getTemplateLock:function(){return _t},hasBlockMovingClientId:function(){return rn},hasDraggedInnerBlock:function(){return rt},hasInserterItems:function(){return Ot},hasMultiSelection:function(){return lt},hasSelectedBlock:function(){return Be},hasSelectedInnerBlock:function(){return ot},isAncestorBeingDragged:function(){return ht},isAncestorMultiSelected:function(){return We},isBlockBeingDragged:function(){return mt},isBlockHighlighted:function(){return sn},isBlockInsertionPointVisible:function(){return bt},isBlockMultiSelected:function(){return je},isBlockSelected:function(){return nt},isBlockValid:function(){return ae},isBlockVisible:function(){return dn},isBlockWithinSelection:function(){return it},isCaretWithinFormattedText:function(){return ft},isDraggingBlocks:function(){return dt},isFirstMultiSelectedBlock:function(){return $e},isGroupable:function(){return kn},isLastBlockChangePersistent:function(){return Yt},isMultiSelecting:function(){return st},isNavigationMode:function(){return nn},isSelectionEnabled:function(){return at},isTyping:function(){return ut},isUngroupable:function(){return vn},isValidTemplate:function(){return vt},wasBlockJustInserted:function(){return un}});var t={};n.r(t),n.d(t,{__experimentalUpdateSettings:function(){return En},clearBlockRemovalPrompt:function(){return In},deleteStyleOverride:function(){return Rn},ensureDefaultBlock:function(){return Bn},hideBlockInterface:function(){return Sn},privateRemoveBlocks:function(){return xn},setBlockRemovalRules:function(){return Tn},setLastFocus:function(){return Nn},setOpenedBlockSettingsMenu:function(){return Pn},setStyleOverride:function(){return Mn},showBlockInterface:function(){return Cn},syncDerivedUpdates:function(){return An}});var r={};n.r(r),n.d(r,{getBlockRemovalRules:function(){return Hn},getEnabledBlockParents:function(){return Fn},getEnabledClientIdsTree:function(){return zn},getInserterMediaCategories:function(){return jn},getLastFocus:function(){return Kn},getLastInsertedBlocksClientIds:function(){return On},getOpenedBlockSettingsMenu:function(){return Un},getRegisteredInserterMediaCategories:function(){return $n},getRemovalPromptData:function(){return Vn},getStyleOverrides:function(){return Gn},hasAllowedPatterns:function(){return Wn},isBlockInterfaceHidden:function(){return Ln},isBlockSubtreeDisabled:function(){return Dn}});var i={};n.r(i),n.d(i,{__unstableDeleteSelection:function(){return Bo},__unstableExpandSelection:function(){return To},__unstableMarkAutomaticChange:function(){return Zo},__unstableMarkLastChangeAsPersistent:function(){return Wo},__unstableMarkNextChangeAsNotPersistent:function(){return Ko},__unstableSaveReusableBlock:function(){return jo},__unstableSetEditorMode:function(){return Yo},__unstableSetTemporarilyEditingAsBlocks:function(){return ir},__unstableSplitSelection:function(){return Io},clearSelectedBlock:function(){return uo},duplicateBlocks:function(){return Qo},enterFormattedText:function(){return Fo},exitFormattedText:function(){return Vo},flashBlock:function(){return nr},hideInsertionPoint:function(){return So},insertAfterBlock:function(){return er},insertBeforeBlock:function(){return Jo},insertBlock:function(){return yo},insertBlocks:function(){return wo},insertDefaultBlock:function(){return Uo},mergeBlocks:function(){return Po},moveBlockToPosition:function(){return _o},moveBlocksDown:function(){return bo},moveBlocksToPosition:function(){return ko},moveBlocksUp:function(){return vo},multiSelect:function(){return co},receiveBlocks:function(){return to},registerInserterMediaCategory:function(){return lr},removeBlock:function(){return Ro},removeBlocks:function(){return Mo},replaceBlock:function(){return fo},replaceBlocks:function(){return ho},replaceInnerBlocks:function(){return Ao},resetBlocks:function(){return Qn},resetSelection:function(){return eo},selectBlock:function(){return ro},selectNextBlock:function(){return lo},selectPreviousBlock:function(){return io},selectionChange:function(){return Ho},setBlockEditingMode:function(){return sr},setBlockMovingClientId:function(){return Xo},setBlockVisibility:function(){return rr},setHasControlledInnerBlocks:function(){return or},setNavigationMode:function(){return qo},setTemplateValidity:function(){return Co},showInsertionPoint:function(){return Eo},startDraggingBlocks:function(){return Do},startMultiSelect:function(){return so},startTyping:function(){return Lo},stopDraggingBlocks:function(){return zo},stopMultiSelect:function(){return ao},stopTyping:function(){return Oo},synchronizeTemplate:function(){return xo},toggleBlockHighlight:function(){return tr},toggleBlockMode:function(){return No},toggleSelection:function(){return po},unsetBlockEditingMode:function(){return ar},updateBlock:function(){return oo},updateBlockAttributes:function(){return no},updateBlockListSettings:function(){return Go},updateSettings:function(){return $o},validateBlocksToTemplate:function(){return Jn}});var l={};n.r(l),n.d(l,{AdvancedPanel:function(){return ZT},BorderPanel:function(){return Jc},ColorPanel:function(){return Lu},DimensionsPanel:function(){return Ap},EffectsPanel:function(){return HT},FiltersPanel:function(){return bm},GlobalStylesContext:function(){return Kr},ImageSettingsPanel:function(){return KT},TypographyPanel:function(){return zd},areGlobalStyleConfigsEqual:function(){return Wr},getBlockCSSSelector:function(){return am},getGlobalStylesChanges:function(){return nP},getLayoutStyles:function(){return xT},useGlobalSetting:function(){return Xr},useGlobalStyle:function(){return Qr},useGlobalStylesOutput:function(){return LT},useGlobalStylesOutputWithConfig:function(){return NT},useGlobalStylesReset:function(){return Yr},useHasBorderPanel:function(){return Wc},useHasColorPanel:function(){return wu},useHasDimensionsPanel:function(){return yp},useHasEffectsPanel:function(){return DT},useHasFiltersPanel:function(){return dm},useHasImageSettingsPanel:function(){return WT},useHasTypographyPanel:function(){return xd},useSettingsForBlockElement:function(){return Jr}});var s=n(9196),a=n.n(s),c=window.wp.blocks,u=window.wp.element,d=window.wp.data,p=window.wp.compose,m=window.wp.hooks;const h=Symbol("mayDisplayControls"),f=Symbol("mayDisplayParentControls"),g={name:"",isSelected:!1},b=(0,u.createContext)(g),{Provider:v}=b;function k(){return(0,u.useContext)(b)}var _=window.wp.deprecated,y=n.n(_),w=n(5619),E=n.n(w),S=window.wp.i18n;const C={insertUsage:{}},x={alignWide:!1,supportsLayout:!0,colors:[{name:(0,S.__)("Black"),slug:"black",color:"#000000"},{name:(0,S.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,S.__)("White"),slug:"white",color:"#ffffff"},{name:(0,S.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,S.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,S.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,S.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,S.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,S.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,S.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,S.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,S.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,S._x)("Small","font size name"),size:13,slug:"small"},{name:(0,S._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,S._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,S._x)("Large","font size name"),size:36,slug:"large"},{name:(0,S._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,S.__)("Thumbnail")},{slug:"medium",name:(0,S.__)("Medium")},{slug:"large",name:(0,S.__)("Large")},{slug:"full",name:(0,S.__)("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,S.__)("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,S.__)("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,S.__)("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,S.__)("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,S.__)("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,S.__)("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,S.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,S.__)("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,S.__)("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,S.__)("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,S.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,S.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function B(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function I(e,t,n,o=1){const r=[...e];return r.splice(t,o),B(r,e.slice(t,t+o),n)}const T=e=>e;function P(e,t=""){const n=new Map,o=[];return n.set(t,o),e.forEach((e=>{const{clientId:t,innerBlocks:r}=e;o.push(t),P(r,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function M(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 R(e,t=T){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 R(e,(e=>{const{attributes:t,...n}=e;return n}))}function N(e){return R(e,(e=>e.attributes))}function L(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&E()(e.clientIds,t.clientIds)&&function(e,t){return E()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function O(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 D(e,t,n=!1){const o=e.tree,r=new Set([]),i=new Set;for(const o of t){let t=n?o:e.parents.get(o);do{if(e.controlledInnerBlocks[t]){i.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 i)o.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>o.get(e)))})}const z=(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:i}=t.byClientId.get(r);"core/block"===i&&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),O(o,n.blocks),D(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)}),D(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)})})),D(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)})),O(o,n.blocks),D(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));D(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)})),D(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),D(o,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=new Map(o.tree),D(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})})),D(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 i=r;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(i.order);Object.keys(o).forEach((e=>{t.order.get(e)&&r.set(e,t.order.get(e))})),i.order=r,i.tree=new Map(i.tree),Object.keys(o).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(A(n.blocks)),attributes:new Map(N(n.blocks)),order:P(n.blocks),parents:new Map(M(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),O(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,i)=>{let l,s=e(r,i);var a;if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,l=null===(a=r.isPersistentChange)||void 0===a||a),void 0!==n)return l=n,l===s.isPersistentChange?s:{...s,isPersistentChange:l};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||o;var u;return r!==s||c?(s={...s,isPersistentChange:c?!o:!L(i,t)},t=i,o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s):(o="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,l=null===(u=r?.isPersistentChange)||void 0===u||u,r.isPersistentChange===l?r:{...s,isPersistentChange: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 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 N(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 i of t.clientIds){var n;const l=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===l.length)continue;let s=!1;const a=e.get(i),c={};l.forEach((([e,t])=>{a[e]!==t&&(s=!0,c[e]=t)})),o=o||s,s&&r.set(i,{...a,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),N(t.blocks).forEach((([e,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=P(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=P(t.blocks,n),{index:i=o.length}=t,l=new Map(e);return r.forEach(((e,t)=>{l.set(t,e)})),l.set(n,B(o,r.get(n),i)),l}case"MOVE_BLOCKS_TO_POSITION":{var o;const{fromRootClientId:n="",toRootClientId:r="",clientIds:i}=t,{index:l=e.get(r).length}=t;if(n===r){const t=e.get(r).indexOf(i[0]),n=new Map(e);return n.set(r,I(e.get(r),t,l,i.length)),n}const s=new Map(e);return s.set(n,null!==(o=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==o?o:[]),s.set(r,B(e.get(r),i,l)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=e.get(o);if(!i.length||r===i[0])return e;const l=i.indexOf(r),s=new Map(e);return s.set(o,I(i,l,l-1,n.length)),s}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=n[0],i=n[n.length-1],l=e.get(o);if(!l.length||i===l[l.length-1])return e;const s=l.indexOf(r),a=new Map(e);return a.set(o,I(l,s,s+1,n.length)),a}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=P(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 i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...o.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);r.set(t,i)})),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 i=null!==(r=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==r?r:[];i.length!==e.length&&n.set(o,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return M(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return M(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)})),M(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 F(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 V=(0,d.combineReducers)({blocks:z,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:i}=t;return r===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const l=e?.selectionStart?.clientId,s=e?.selectionEnd?.clientId;if(!l&&!s)return e;if(!t.blocks.some((e=>e.clientId===l)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===s)))return{...e,selectionEnd:e.selectionStart}}const n=F(e.selectionStart,t),o=F(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 E()(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:i}=t,l={rootClientId:n,index:o,__unstableWithInserter:r,operation:i};return E()(e,l)?e:l}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=x,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...x,...t.settings}:{...e,...t.settings}:e},preferences:function(e=C,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:r}=n;let i=r;const l=(0,d.select)(c.store).getActiveBlockVariation(r,o);return l?.name&&(i+="/"+l.name),"core/block"===r&&(i+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[i]:{time:t.time,count:e.insertUsage[i]?e.insertUsage[i].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},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 H=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}}(V),U={};function G(e){return[e]}function $(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 j(e,t){var n,o=t||G;function r(){n=new WeakMap}function i(){var t,r,i,l,s,a=arguments.length;for(l=new Array(a),i=0;i<a;i++)l[i]=arguments[i];for(t=function(e){var t,o,r,i,l,s=n,a=!0;for(t=0;t<e.length;t++){if(!(l=o=e[t])||"object"!=typeof l){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(U)||((i=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(U,i)),s.get(U)}(s=o.apply(null,l)),t.isUniqueByDependants||(t.lastDependants&&!$(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),r=t.head;r;){if($(r.args,l,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,l)},l[0]=null,r.args=l,t.head&&(t.head.prev=r,r.next=t.head),t.head=r,r.val}return i.getDependants=o,i.clear=r,r(),i}var W=window.wp.primitives,K=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),Z=window.wp.richText;const q={user:"user",theme:"theme",directory:"directory"},Y={full:"fully",unsynced:"unsynced"},X={name:"allPatterns",label:(0,S.__)("All")},Q={name:"myPatterns",label:(0,S.__)("My patterns")};function J(e,t,n){const o=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==q.theme||!o&&!r)||!(t!==q.directory||!o&&r)||t===q.user&&e.type!==q.user||n===Y.full&&""!==e.syncStatus||!(n!==Y.unsynced||"unsynced"===e.syncStatus||!o)}const ee=[];function te(e){var t,n;const o=null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ee,r=null!==(n=e?.settings?.__experimentalUserPatternCategories)&&void 0!==n?n:[],i=new Map;return r.forEach((e=>i.set(e.id,e))),o.map((e=>({name:`core/block/${e.id}`,id:e.id,type:q.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>i&&i.get(e)?i.get(e).slug:e)),content:e.content.raw,syncStatus:e.wp_pattern_sync_status})))}const ne=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,oe=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!ne(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0};function re(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(o,r)=>{let i,l;if("function"==typeof e?(i=e(o),l=e(r)):(i=o[e],l=r[e]),i>l)return"asc"===n?1:-1;if(l>i)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})(t,e,n))}const ie=[],le=new Set;function se(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 ae(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function ce(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function ue(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const de=j(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:ce(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function pe(e,t){const n=t&&an(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||ie}const me=j(((e,t)=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:he(e,t)})),(e=>[e.blocks.order])),he=j(((e,t="")=>(y()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),et(e,t).map((t=>me(e,t))))),(e=>[e.blocks.order])),fe=j(((e,t)=>{const n=Array.isArray(t)?t:[t],o=[];for(const t of n)for(const n of et(e,t))o.push(n,...fe(e,n));return o}),(e=>[e.blocks.order])),ge=j((e=>{const t=[];for(const n of et(e))t.push(n,...fe(e,n));return t}),(e=>[e.blocks.order])),be=j(((e,t)=>{const n=ge(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])),ve=j(((e,t)=>{if(!t)return ie;const n=Array.isArray(t)?t:[t],o=ge(e).filter((t=>{const o=e.blocks.byClientId.get(t);return n.includes(o.name)}));return o.length>0?o:ie}),(e=>[e.blocks.order,e.blocks.byClientId])),ke=j(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>ue(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),_e=j(((e,t)=>ke(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ke(e,t)));function ye(e,t){return et(e,t).length}function we(e){return e.selection.selectionStart}function Ee(e){return e.selection.selectionEnd}function Se(e){return e.selection.selectionStart.clientId}function Ce(e){return e.selection.selectionEnd.clientId}function xe(e){return Ve(e).length||(e.selection.selectionStart.clientId?1:0)}function Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function Te(e){const t=Ie(e);return t?ue(e,t):null}function Pe(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const Me=j(((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():ie}),(e=>[e.blocks.parents])),Re=j(((e,t,n,o=!1)=>{const r=Me(e,t,o),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter((t=>i(se(e,t))))}),(e=>[e.blocks.parents]));function Ae(e,t){let n,o=t;do{n=o,o=e.blocks.parents.get(o)}while(o);return n}function Ne(e,t){const n=Ie(e),o=[...Me(e,t),t],r=[...Me(e,n),n];let i;const l=Math.min(o.length,r.length);for(let e=0;e<l&&o[e]===r[e];e++)i=o[e];return i}function Le(e,t,n=1){if(void 0===t&&(t=Ie(e)),void 0===t&&(t=n<0?Ue(e):Ge(e)),!t)return null;const o=Pe(e,t);if(null===o)return null;const{order:r}=e.blocks,i=r.get(o),l=i.indexOf(t)+1*n;return l<0||l===i.length?null:i[l]}function Oe(e,t){return Le(e,t,-1)}function De(e,t){return Le(e,t,1)}function ze(e){return e.initialPosition}const Fe=j((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return ie;if(t.clientId===n.clientId)return[t.clientId];const o=Pe(e,t.clientId);if(null===o)return ie;const r=et(e,o),i=r.indexOf(t.clientId),l=r.indexOf(n.clientId);return i>l?r.slice(l,i+1):r.slice(i,l+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?ie:Fe(e)}const He=j((e=>{const t=Ve(e);return t.length?t.map((t=>ue(e,t))):ie}),(e=>[...Fe.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ue(e){return Ve(e)[0]||null}function Ge(e){const t=Ve(e);return t[t.length-1]||null}function $e(e,t){return Ue(e)===t}function je(e,t){return-1!==Ve(e).indexOf(t)}const We=j(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=Pe(e,n),o=je(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ke(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function qe(e){const t=we(e),n=Ee(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ye(e){const t=we(e),n=Ee(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Xe(e){return Fe(e).some((t=>{const n=se(e,t);return!(0,c.getBlockType)(n).merge}))}function Qe(e,t){const n=we(e),o=Ee(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=Pe(e,n.clientId);if(r!==Pe(e,o.clientId))return!1;const i=et(e,r);let l,s;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(l=o,s=n):(l=n,s=o);const a=t?s.clientId:l.clientId,u=t?l.clientId:s.clientId,d=se(e,a);if(!(0,c.getBlockType)(d).merge)return!1;const p=ue(e,u);if(p.name===d)return!0;const m=(0,c.switchToBlockType)(p,d);return m&&m.length}const Je=e=>{const t=we(e),n=Ee(e);if(t.clientId===n.clientId)return ie;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return ie;const o=Pe(e,t.clientId);if(o!==Pe(e,n.clientId))return ie;const r=et(e,o),i=r.indexOf(t.clientId),l=r.indexOf(n.clientId),[s,a]=i>l?[n,t]:[t,n],c=ue(e,s.clientId),u=ue(e,a.clientId),d=c.attributes[s.attributeKey],p=u.attributes[a.attributeKey];let m=(0,Z.create)({html:d}),h=(0,Z.create)({html:p});return m=(0,Z.remove)(m,0,s.offset),h=(0,Z.remove)(h,a.offset,h.text.length),[{...c,attributes:{...c.attributes,[s.attributeKey]:(0,Z.toHTMLString)({value:m})}},{...u,attributes:{...u.attributes,[a.attributeKey]:(0,Z.toHTMLString)({value:h})}}]};function et(e,t){return e.blocks.order.get(t||"")||ie}function tt(e,t){return et(e,Pe(e,t)).indexOf(t)}function nt(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function ot(e,t,n=!1){return et(e,t).some((t=>nt(e,t)||je(e,t)||n&&ot(e,t,n)))}function rt(e,t,n=!1){return et(e,t).some((t=>mt(e,t)||n&&rt(e,t,n)))}function it(e,t){if(!t)return!1;const n=Ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function lt(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function st(e){return e.isMultiSelecting}function at(e){return e.isSelectionEnabled}function ct(e,t){return e.blocksMode[t]||"visual"}function ut(e){return e.isTyping}function dt(e){return!!e.draggedBlocks.length}function pt(e){return e.draggedBlocks}function mt(e,t){return e.draggedBlocks.includes(t)}function ht(e,t){return!!dt(e)&&Me(e,t).some((t=>mt(e,t)))}function ft(){return y()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const gt=j((e=>{let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:i}=r;return i?(t=Pe(e,i)||void 0,n=tt(e,r.clientId)+1):n=et(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function bt(e){return null!==e.insertionPoint}function vt(e){return e.template.isValid}function kt(e){return e.settings.template}function _t(e,t){var n,o;return t?null!==(n=Zt(e,t)?.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const yt=(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}=qt(e);if(!ne(r,t,!0))return!1;if(_t(e,n))return!1;if("disabled"===bn(e,null!=n?n:""))return!1;const i=Zt(e,n);if(n&&void 0===i)return!1;const l=i?.allowedBlocks,s=ne(l,t),a=o.parent,u=se(e,n),d=ne(a,u);let p=!0;const h=o.ancestor;h&&(p=[n,...Me(e,n)].some((t=>ne(h,se(e,t)))));const f=p&&(null===s&&null===d||!0===s||!0===d);return f?(0,m.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,o,n,{getBlock:ue.bind(null,e),getBlockParentsByBlockName:Re.bind(null,e)}):f},wt=j(yt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]));function Et(e,t,n=null){return t.every((t=>wt(e,se(e,t),n)))}function St(e,t,n=null){const o=ce(e,t);return null===o||(void 0!==o.lock?.remove?!o.lock.remove:!_t(e,n)&&"disabled"!==bn(e,n))}function Ct(e,t,n=null){return t.every((t=>St(e,t,n)))}function xt(e,t,n=null){const o=ce(e,t);return null===o||(void 0!==o.lock?.move?!o.lock.move:"all"!==_t(e,n)&&"disabled"!==bn(e,n))}function Bt(e,t,n=null){return t.every((t=>xt(e,t,n)))}function It(e,t){const n=ce(e,t);if(null===n)return!0;const{lock:o}=n;return!o?.edit}function Tt(e,t){return!!(0,c.hasBlockSupport)(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Pt(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Mt=(e,t,n)=>!!(0,c.hasBlockSupport)(t,"inserter",!0)&&yt(e,t.name,n),Rt=(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}},At=(e,{buildScope:t="inserter"})=>n=>{const o=n.name;let r=!1;(0,c.hasBlockSupport)(n.name,"multiple",!0)||(r=ke(e,ge(e)).some((({name:e})=>e===n.name)));const{time:i,count:l=0}=Pt(e,o)||{},s={id:o,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:Rt(i,l)};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}},Nt=j(((e,t=null)=>{const n=yt(e,"core/block",t)?tn(e).map((t=>{const n=t.wp_pattern_sync_status?K:{src:K,foreground:"var(--wp-block-synced-color)"},o=`core/block/${t.id}`,{time:r,count:i=0}=Pt(e,o)||{},l=Rt(r,i);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:l,content:t.content?.raw,syncStatus:t.wp_pattern_sync_status}})):[],o=At(e,{buildScope:"inserter"}),r=(0,c.getBlockTypes)().filter((n=>Mt(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:i=0}=Pt(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:Rt(r,i)}})(e,n);t.push(...o.map(r))}return t}),[]),{core:i,noncore:l}=r.reduce(((e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e}),{core:[],noncore:[]});return[...i,...l,...n]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,tn(e),(0,c.getBlockTypes)()])),Lt=j(((e,t,n=null)=>{const o=Array.isArray(t)?t:[t],r=At(e,{buildScope:"transform"}),i=(0,c.getBlockTypes)().filter((t=>Mt(e,t,n))).map(r),l=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),s=(0,c.getPossibleBlockTransformations)(o).reduce(((e,t)=>(l[t?.name]&&e.push(l[t.name]),e)),[]);return re(s,(e=>l[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,c.getBlockTypes)()])),Ot=j(((e,t=null)=>!!(0,c.getBlockTypes)().some((n=>Mt(e,n,t)))||yt(e,"core/block",t)&&tn(e).length>0),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,tn(e),(0,c.getBlockTypes)()])),Dt=j(((e,t=null)=>{if(t)return[...(0,c.getBlockTypes)().filter((n=>Mt(e,n,t))),...yt(e,"core/block",t)&&tn(e).length>0?["core/block"]:[]]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,tn(e),(0,c.getBlockTypes)()])),zt=j(((e,t=null)=>(y()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Dt(e,t))),((e,t)=>[...Dt.getDependants(e,t)])),Ft=j(((e,t=null)=>{if(!t)return;const n=e.blockListSettings[t]?.defaultBlock,o=e.blockListSettings[t]?.directInsert;return n&&o?"function"==typeof o?o(ue(e,t))?n:null:n:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Vt=j(((e,t=null)=>(y()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Ft(e,t))),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Ht=j((e=>e?.settings?.__experimentalUserPatternCategories),(e=>[e.settings.__experimentalUserPatternCategories])),Ut=j(((e,t)=>{const n=[...e.settings.__experimentalBlockPatterns,...te(e)].find((({name:e})=>e===t));return n?{...n,blocks:(0,c.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e?.settings?.__experimentalUserPatternCategories])),Gt=j((e=>{const t=e.settings.__experimentalBlockPatterns,n=te(e),{allowedBlockTypes:o}=qt(e),r=[...n,...t].filter((({inserter:e=!0})=>!!e)).map((({name:t})=>Ut(e,t))),i=r.filter((({blocks:e})=>oe(e,o)));return i}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.__experimentalReusableBlocks,e.settings.allowedBlockTypes,e?.settings?.__experimentalUserPatternCategories])),$t=j(((e,t=null)=>{const n=Gt(e).filter((({blocks:n})=>n.every((({name:n})=>wt(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)])),jt=j(((e,t,n=null)=>{if(!t)return ie;const o=$t(e,n),r=Array.isArray(t)?t:[t],i=o.filter((e=>e?.blockTypes?.some?.((e=>r.includes(e)))));return 0===i.length?ie:i}),((e,t,n)=>[...$t.getDependants(e,n)])),Wt=j(((e,t,n=null)=>(y()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),jt(e,t,n))),((e,t,n)=>[...$t.getDependants(e,n)])),Kt=j(((e,t,n=null)=>{if(!t)return ie;if(t.some((({clientId:t,innerBlocks:n})=>n.length||an(e,t))))return ie;const o=Array.from(new Set(t.map((({name:e})=>e))));return jt(e,o,n)}),((e,t,n)=>[...jt.getDependants(e,n)]));function Zt(e,t){return e.blockListSettings[t]}function qt(e){return e.settings}function Yt(e){return e.blocks.isPersistentChange}const Xt=j(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),Qt=j(((e,t)=>{const n=tn(e).find((e=>e.id===t));return n?n.title?.raw:null}),(e=>[tn(e)]));function Jt(e){return e.blocks.isIgnoredChange}function en(e){return e.lastBlockAttributesChange}function tn(e){var t;return null!==(t=e?.settings?.__experimentalReusableBlocks)&&void 0!==t?t:ie}function nn(e){return"navigation"===e.editorMode}function on(e){return e.editorMode}function rn(e){return e.hasBlockMovingClientId}function ln(e){return!!e.automaticChangeStatus}function sn(e,t){return e.highlightedBlock===t}function an(e,t){return!!e.blocks.controlledInnerBlocks[t]}const cn=j(((e,t)=>{if(!t.length)return null;const n=Ie(e);if(t.includes(se(e,n)))return n;const o=Ve(e),r=Re(e,n||o[0],t);return r?r[r.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function un(e,t,n){const{lastBlockInserted:o}=e;return o.clientIds?.includes(t)&&o.source===n}function dn(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const pn=j((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?le:t}),(e=>[e.blockVisibility])),mn=j(((e,t)=>{let n,o=t;for(;e.blocks.parents.has(o);)o=e.blocks.parents.get(o),(o&&"core/block"===se(e,o)&&window.__experimentalPatternPartialSyncing||o&&"contentOnly"===_t(e,o))&&(n=o);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function hn(e){return e.temporarilyEditingAsBlocks}function fn(e,t){if("default"!==bn(e,t))return!1;if(!It(e,t))return!0;const n=on(e);if("zoom-out"===n&&t&&!Pe(e,t))return!0;const o=(0,c.hasBlockSupport)(se(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!o&&an(e,t))&&!nt(e,t)&&!ot(e,t,!0)}function gn(e,t){let n=e.blocks.parents.get(t);for(;n;){if(fn(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const bn=(0,d.createRegistrySelector)((e=>(t,n="")=>{if(t.blockEditingModes.has(n))return t.blockEditingModes.get(n);if(!n)return"default";const o=Pe(t,n);if("contentOnly"===_t(t,o)){const o=se(t,n);return e(c.store).__experimentalHasContentRoleAttribute(o)?"contentOnly":"disabled"}const r=bn(t,o);return"contentOnly"===r?"default":r})),vn=(0,d.createRegistrySelector)((e=>(t,n="")=>{const o=n||Ie(t);if(!o)return!1;const{getGroupingBlockName:r}=e(c.store),i=ue(t,o),l=r();return i&&(i.name===l||(0,c.getBlockType)(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&St(t,o)})),kn=(0,d.createRegistrySelector)((e=>(t,n=ie)=>{const{getGroupingBlockName:o}=e(c.store),r=o(),i=n?.length?n:Fe(t),l=i?.length?Pe(t,i[0]):void 0;return wt(t,r,l)&&i.length&&Ct(t,i,l)})),yn=new WeakSet,wn=["inserterMediaCategories","blockInspectorAnimation"];function En(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let o=e;if(t&&"web"===u.Platform.OS){o={};for(const t in e)wn.includes(t)||(o[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:o,reset:n}}function Sn(){return{type:"HIDE_BLOCK_INTERFACE"}}function Cn(){return{type:"SHOW_BLOCK_INTERFACE"}}const xn=(e,t=!0,n=!1)=>({select:o,dispatch:r,registry:i})=>{if(!e||!e.length)return;var l;l=e,e=Array.isArray(l)?l:[l];const s=o.getBlockRootClientId(e[0]);if(!o.canRemoveBlocks(e,s))return;const a=!n&&o.getBlockRemovalRules();if(a){const n=new Set,i=[...e];for(;i.length;){const e=i.shift(),t=o.getBlockName(e);a[t]&&n.add(t);const r=o.getBlockOrder(e);i.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),i.batch((()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(Bn())}))},Bn=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function In(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Tn(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Pn(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Mn(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Rn(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();yn.add(o)}))}}function Nn(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Ln(e){return e.isBlockInterfaceHidden}function On(e){return e?.lastBlockInserted?.clientIds}const Dn=j(((e,t)=>{const n=t=>"disabled"===bn(e,t)&&et(e,t).every(n);return"disabled"===bn(e,t)&&et(e,t).every(n)}),(e=>[e.blocks.parents,e.blocks.order,e.blockEditingModes,e.blockListSettings])),zn=j(((e,t="")=>et(e,t).flatMap((t=>"disabled"!==bn(e,t)?[{clientId:t,innerBlocks:zn(e,t)}]:zn(e,t)))),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Fn=j(((e,t,n=!1)=>Me(e,t,n).filter((t=>"disabled"!==bn(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Vn(e){return e.removalPromptData}function Hn(e){return e.blockRemovalRules}function Un(e){return e.openedBlockSettingsMenu}function Gn(e){return e.styleOverrides}function $n(e){return e.registeredInserterMediaCategories}const jn=j((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:o},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const i=t?.map((({name:e})=>e))||[];return[...t||[],...(r||[]).filter((({name:e})=>!i.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])),Wn=j(((e,t=null)=>{const n=e.settings.__experimentalBlockPatterns,o=te(e),{allowedBlockTypes:r}=qt(e);return[...o,...n].some((({name:n,inserter:o=!0})=>{if(!o)return!1;const{blocks:i}=Ut(e,n);return oe(i,r)&&i.every((({name:n})=>wt(e,n,t)))}))}),((e,t)=>[...$t.getDependants(e,t)]));function Kn(e){return e.lastFocus}var Zn=window.wp.a11y;const qn="†";function Yn(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof Z.RichTextData)&&-1!==n.toString().indexOf(qn)}))}const Xn=e=>Array.isArray(e)?e:[e],Qn=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(Jn(e))},Jn=e=>({select:t,dispatch:n})=>{const o=t.getTemplate(),r=t.getTemplateLock(),i=!o||"all"!==r||(0,c.doBlocksMatchTemplate)(e,o);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function eo(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function to(e){return y()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function no(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Xn(e),attributes:t,uniqueByBlock:n}}function oo(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function ro(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const io=(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)}},lo=e=>({select:t,dispatch:n})=>{const o=t.getNextBlockClientId(e);o&&n.selectBlock(o)};function so(){return{type:"START_MULTI_SELECT"}}function ao(){return{type:"STOP_MULTI_SELECT"}}const co=(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 i=o.getSelectedBlockCount();(0,Zn.speak)((0,S.sprintf)(/* translators: %s: number of selected blocks */
(0,S._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function uo(){return{type:"CLEAR_SELECTED_BLOCK"}}function po(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function mo(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,i=o[t];return{...e,attributes:{...r,className:`${n||""} is-style-${i}`.trim()}}}))}const ho=(e,t,n,o=0,r)=>({select:i,dispatch:l,registry:s})=>{e=Xn(e),t=mo(Xn(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s.batch((()=>{l({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),l.ensureDefaultBlock()}))};function fo(e,t){return ho(e,t)}const go=e=>(t,n)=>({select:o,dispatch:r})=>{o.canMoveBlocks(t,n)&&r({type:e,clientIds:Xn(t),rootClientId:n})},bo=go("MOVE_BLOCKS_DOWN"),vo=go("MOVE_BLOCKS_UP"),ko=(e,t="",n="",o)=>({select:r,dispatch:i})=>{if(r.canMoveBlocks(e,t)){if(t!==n){if(!r.canRemoveBlocks(e,t))return;if(!r.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}};function _o(e,t="",n="",o){return ko([e],t,n,o)}function yo(e,t,n,o,r){return wo([e],t,n,o,0,r)}const wo=(e,t,n,o=!0,r=0,i)=>({select:l,dispatch:s})=>{null!==r&&"object"==typeof r&&(i=r,r=0,y()("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=mo(Xn(e),l.getSettings());const a=[];for(const t of e)l.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:i})};function Eo(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 xo=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=e.getBlocks(),o=e.getTemplate(),r=(0,c.synchronizeBlocksWithTemplate)(n,o);t.resetBlocks(r)},Bo=e=>({registry:t,select:n,dispatch:o})=>{const r=n.getSelectionStart(),i=n.getSelectionEnd();if(r.clientId===i.clientId)return;if(!r.attributeKey||!i.attributeKey||void 0===r.offset||void 0===i.offset)return!1;const l=n.getBlockRootClientId(r.clientId);if(l!==n.getBlockRootClientId(i.clientId))return;const s=n.getBlockOrder(l);let a,u;s.indexOf(r.clientId)>s.indexOf(i.clientId)?(a=i,u=r):(a=r,u=i);const d=e?u:a,p=n.getBlock(d.clientId),m=(0,c.getBlockType)(p.name);if(!m.merge)return;const h=a,f=u,g=n.getBlock(h.clientId),b=n.getBlock(f.clientId),v=g.attributes[h.attributeKey],k=b.attributes[f.attributeKey];let _=(0,Z.create)({html:v}),y=(0,Z.create)({html:k});_=(0,Z.remove)(_,h.offset,_.text.length),y=(0,Z.insert)(y,qn,0,f.offset);const w=(0,c.cloneBlock)(g,{[h.attributeKey]:(0,Z.toHTMLString)({value:_})}),E=(0,c.cloneBlock)(b,{[f.attributeKey]:(0,Z.toHTMLString)({value:y})}),S=e?w:E,C=g.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,E.attributes)}else{const e=C.shift();x=m.merge(w.attributes,e.attributes)}const B=Yn(x),I=x[B],T=(0,Z.create)({html:I}),P=T.text.indexOf(qn),M=(0,Z.remove)(T,P,P+1),R=(0,Z.toHTMLString)({value:M});x[B]=R;const A=n.getSelectedBlockClientIds(),N=[...e?C:[],{...p,attributes:{...p.attributes,...x}},...e?[]:C];t.batch((()=>{o.selectionChange(p.clientId,B,P,P),o.replaceBlocks(A,N,0,n.getSelectedBlocksInitialCaretPosition())}))},Io=()=>({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 i=e.getBlockOrder(r);let l,s;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(l=o,s=n):(l=n,s=o);const a=l,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,Z.create)({html:p}),f=(0,Z.create)({html:m});h=(0,Z.remove)(h,a.offset,h.text.length),f=(0,Z.remove)(f,0,c.offset),t.replaceBlocks(e.getSelectedBlockClientIds(),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,Z.toHTMLString)({value:h})}},{...d,attributes:{...d.attributes,[c.attributeKey]:(0,Z.toHTMLString)({value:f})}}])},To=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),o=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:o.clientId}})},Po=(e,t)=>({registry:n,select:o,dispatch:r})=>{const i=[e,t];r({type:"MERGE_BLOCKS",blocks:i});const[l,s]=i,a=o.getBlock(l),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,l),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=o.getNextBlockClientId(l);if(e&&o.getBlockName(l)===o.getBlockName(e)){const t=o.getBlockAttributes(l),n=o.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(r.moveBlocksToPosition(o.getBlockOrder(e),e,l),r.removeBlock(e,!1))}}))}if((0,c.isUnmodifiedDefaultBlock)(a))return void r.removeBlock(l,o.isBlockSelected(l));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:f}=o.getSelectionStart(),g=(m===l?u:p).attributes[h],b=(m===l||m===s)&&void 0!==h&&void 0!==f&&!!g;g||("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===l?v:k,t=e.attributes[h],n=(0,Z.insert)((0,Z.create)({html:t}),qn,f,f);e.attributes[h]=(0,Z.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=Yn(y),t=y[e],n=(0,Z.create)({html:t}),o=n.text.indexOf(qn),i=(0,Z.remove)(n,o,o+1),l=(0,Z.toHTMLString)({value:i});y[e]=l,r.selectionChange(a.clientId,e,o,o)}r.replaceBlocks([a.clientId,d.clientId],[{...a,attributes:{...a.attributes,...y}},..._.slice(1)],0)},Mo=(e,t=!0)=>xn(e,t);function Ro(e,t){return Mo([e],t)}function Ao(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 No(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Lo(){return{type:"START_TYPING"}}function Oo(){return{type:"STOP_TYPING"}}function Do(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function zo(){return{type:"STOP_DRAGGING_BLOCKS"}}function Fo(){return y()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vo(){return y()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Ho(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Uo=(e,t,n)=>({dispatch:o})=>{const r=(0,c.getDefaultBlockName)();if(!r)return;const i=(0,c.createBlock)(r,e);return o.insertBlock(i,n,t)};function Go(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function $o(e){return En(e,{stripExperimentalSettings:!0})}function jo(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Wo(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ko(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Zo=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},qo=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Yo=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,Zn.speak)((0,S.__)("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,Zn.speak)((0,S.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Zn.speak)((0,S.__)("You are currently in zoom-out mode."))},Xo=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Zn.speak)((0,S.__)("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."))},Qo=(e,t=!0)=>({select:n,dispatch:o})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some((e=>!e)))return;const i=r.map((e=>e.name));if(i.some((e=>!(0,c.hasBlockSupport)(e,"multiple",!0))))return;const l=n.getBlockRootClientId(e[0]),s=Xn(e),a=n.getBlockIndex(s[s.length-1]),u=r.map((e=>(0,c.__experimentalCloneSanitizedBlock)(e)));return o.insertBlocks(u,a+1,l,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))},Jo=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)},er=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 tr(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const nr=e=>async({dispatch:t})=>{t(tr(e,!0)),await new Promise((e=>setTimeout(e,150))),t(tr(e,!1))};function or(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function rr(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function ir(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const lr=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 sr(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function ar(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const cr="core/block-editor";var ur=window.wp.privateApis;const{lock:dr,unlock:pr}=(0,ur.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),mr={reducer:H,selectors:e,actions:i},hr=(0,d.createReduxStore)(cr,{...mr,persist:["preferences"]}),fr=(0,d.registerStore)(cr,{...mr,persist:["preferences"]});function gr(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}pr(fr).registerPrivateActions(t),pr(fr).registerPrivateSelectors(r),pr(hr).registerPrivateActions(t),pr(hr).registerPrivateSelectors(r);const br=(e,t,n)=>{var o;const r=Array.isArray(t)?t:t.split(".");let i=e;return r.forEach((e=>{i=i?.[e]})),null!==(o=i)&&void 0!==o?o:n},vr=["color","border","dimensions","typography","spacing"],kr={"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},_r={"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"},yr=e=>_r[e]||e;function wr(e){let t=Er.get(e);return t||(t=["default","theme","custom"].flatMap((t=>{var n;return null!==(n=e[t])&&void 0!==n?n:[]})),Er.set(e,t)),t}const Er=new WeakMap;function Sr(e){return["default","theme","custom"].some((t=>e?.[t]?.length))}function Cr(...e){const{name:t,clientId:n=null}=k();return e=(0,u.useMemo)((()=>e),e),(0,d.useSelect)((o=>{const r=n?[n,...o(hr).getBlockParents(n,!0)].filter((e=>{const t=o(hr).getBlockName(e);return(0,c.hasBlockSupport)(t,"__experimentalSettings",!1)})):[];return e.map((e=>{if(vr.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,m.applyFilters)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==i)return i;const l=yr(e);for(const e of r){var s;const n=o(hr).getBlockAttributes(e);if(i=null!==(s=br(n.settings?.blocks?.[t],l))&&void 0!==s?s:br(n.settings,l),void 0!==i)break}const a=o(hr).getSettings();if(void 0===i&&t&&(i=br(a.__experimentalFeatures?.blocks?.[t],l)),void 0===i&&(i=br(a.__experimentalFeatures,l)),void 0!==i)return c.__EXPERIMENTAL_PATHS_WITH_MERGE[l]?wr(i):i;const u=kr[l]?.(a);return void 0!==u?u:"typography.dropCap"===l||void 0}))}),[t,n,e])}function xr(e){y()("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]=Cr(e);return t}const Br="1600px",Ir="320px",Tr=1,Pr=.25,Mr=.75,Rr="14px";function Ar({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:o=Ir,maximumViewportWidth:r=Br,scaleFactor:i=Tr,minimumFontSizeLimit:l}){if(l=Nr(l)?l:Rr,n){const o=Nr(n);if(!o?.unit)return null;const r=Nr(l,{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),Pr),Mr),i=Lr(o.value*n,3);e=r?.value&&i<r?.value?`${r.value}${r.unit}`:`${i}${o.unit}`}}const s=Nr(e),a=s?.unit||"rem",c=Nr(t,{coerceTo:a});if(!s||!c)return null;const u=Nr(e,{coerceTo:"rem"}),d=Nr(r,{coerceTo:a}),p=Nr(o,{coerceTo:a});if(!d||!p||!u)return null;const m=Lr(p.value/100,3),h=Lr(m,3)+a,f=Lr(((c.value-s.value)/(d.value-p.value)*100||1)*i,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${h}) * ${f}), ${t})`}function Nr(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},i=r?.join("|"),l=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),s=e.match(l);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:Lr(u,3),unit:c}}function Lr(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function Or(e,t){const{size:n}=e;if(!Dr(t))return n;if(!n||"0"===n||!1===e?.fluid)return n;const o="object"==typeof t?.fluid?t?.fluid:{};return Ar({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:o?.minFontSize,maximumViewportWidth:o?.maxViewportWidth,minimumViewportWidth:o?.minViewportWidth})||n}function Dr(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=Nr(n?.wideSize)?n?.wideSize:null;return Dr(t)&&o?{fluid:{maxViewportWidth:o,...t.fluid}}:{fluid:t?.fluid}}const Fr="body",Vr=[{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)=>Or(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:[]}],Hr={"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"},Ur={popoverProps:{placement:"left-start",offset:259}};function Gr(e,t,n,o,r){const i=[br(e,["blocks",t,...n]),br(e,n)];for(const l of i)if(l){const i=["custom","theme","default"];for(const s of i){const i=l[s];if(i){const l=i.find((e=>e[o]===r));if(l)return"slug"===o||Gr(e,t,n,"slug",l.slug)[o]===l[o]?l:void 0}}}}function $r(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=br(e,t))||n?.ref)return n}}let o;if(n.startsWith("var:"))o=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;o=n.slice(10,-1).split("--")}const[r,...i]=o;return"preset"===r?function(e,t,n,[o,r]){const i=Vr.find((e=>e.cssVarInfix===o));if(!i)return n;const l=Gr(e.settings,t,i.path,"slug",r);if(l){const{valueKey:n}=i;return $r(e,t,l[n])}return n}(e,t,n,i):"custom"===r?function(e,t,n,o){var r;const i=null!==(r=br(e.settings,["blocks",t,"custom",...o]))&&void 0!==r?r:br(e.settings,["custom",...o]);return i?$r(e,t,i):n}(e,t,n,i):n}function jr(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 Wr(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:E()(e?.styles,t?.styles)&&E()(e?.settings,t?.settings)}const Kr=(0,u.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Zr={settings:{},styles:{}},qr=["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.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"],Yr=()=>{const{user:e,setUserConfig:t}=(0,u.useContext)(Kr);return[!!e&&!E()(e,Zr),(0,u.useCallback)((()=>t((()=>Zr))),[t])]};function Xr(e,t,n="all"){const{setUserConfig:o,...r}=(0,u.useContext)(Kr),i=t?".blocks."+t:"",l=e?"."+e:"",s=`settings${i}${l}`,a=`settings${l}`,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=br(t,s))&&void 0!==n?n:br(t,a);let o={};return qr.forEach((e=>{var n;const r=null!==(n=br(t,`settings${i}.${e}`))&&void 0!==n?n:br(t,`settings.${e}`);void 0!==r&&(o=gr(o,e.split("."),r))})),o}),[r,c,e,s,a,i]),e=>{o((t=>gr(t,s.split("."),e)))}]}function Qr(e,t,n="all",{shouldDecodeEncode:o=!0}={}){const{merged:r,base:i,user:l,setUserConfig:s}=(0,u.useContext)(Kr),a=e?"."+e:"",c=t?`styles.blocks.${t}${a}`:`styles${a}`;let d,p;switch(n){case"all":d=br(r,c),p=o?$r(r,t,d):d;break;case"user":d=br(l,c),p=o?$r(r,t,d):d;break;case"base":d=br(i,c),p=o?$r(i,t,d):d;break;default:throw"Unsupported source"}return[p,n=>{s((i=>gr(i,c.split("."),o?function(e,t,n,o){if(!o)return o;const r=Hr[n],i=Vr.find((e=>e.cssVarInfix===r));if(!i)return o;const{valueKey:l,path:s}=i,a=Gr(e,t,s,l,o);return a?`var:preset|${r}|${a.slug}`:o}(r.settings,t,e,n):n)))}]}function Jr(e,t,n){const{supportedStyles:o,supports:r}=(0,d.useSelect)((e=>({supportedStyles:pr(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}})})),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 ei(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,S._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,S._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,S._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,o,r])}function ti(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,S._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&o&&o.length&&e.push({name:(0,S._x)("Default","Indicates this palette comes from WordPress."),gradients:o}),t&&t.length&&e.push({name:(0,S._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,o,r])}var ni=n(4403),oi=n.n(ni);const ri=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,ri(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function ii(e,t,n,o,r,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===o.length)return n;let l=o[0]?.attributes;if(i.length>1&&o.length>1){if(!o[r])return n;l=o[r]?.attributes}let s=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=br(l,e);t&&(s={...s,attributes:gr(s.attributes,e,t)})}))})),s}function li(e,t,n){const o=(0,c.getBlockSupport)(e,t),r=o?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}function si({id:e,css:t,assets:n,__unstableType:o}={}){const{setStyleOverride:r,deleteStyleOverride:i}=pr((0,d.useDispatch)(hr)),l=(0,u.useId)();(0,u.useEffect)((()=>{if(!t&&!n)return;const s=e||l;return r(s,{id:e,css:t,assets:n,__unstableType:o}),()=>{i(s)}}),[e,t,n,o,l,r,i])}function ai(e,t){const[n,o,r,i,l,s,a,c,d,p,m,h,f,g,b,v,k,_,y,w,E,S,C,x,B,I,T,P,M,R,A,N,L,O,D,z,F,V,H,U,G,$,j,W]=Cr("background.backgroundImage","background.backgroundSize","typography.fontFamilies","typography.fontSizes","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.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");return Jr((0,u.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:o},color:{palette:{custom:I,theme:P,default:M},gradients:{custom:D,theme:z,default:F},duotone:{custom:N,theme:L,default:O},defaultGradients:V,defaultPalette:R,defaultDuotone:A,custom:B,customGradient:H,customDuotone:T,background:U,link:G,heading:j,button:W,text:$},typography:{fontFamilies:{custom:r},fontSizes:{custom:i},customFontSize:l,fontStyle:s,fontWeight:a,lineHeight:c,textColumns:d,textDecoration:p,textTransform:h,letterSpacing:f,writingMode:m},spacing:{spacingSizes:{custom:k},padding:g,margin:b,blockGap:v,units:_},border:{color:E,radius:S,style:C,width:x},dimensions:{minHeight:y},layout:w,parentLayout:t})),[n,o,r,i,l,s,a,c,d,p,h,f,m,g,b,v,k,_,y,w,t,E,S,C,x,B,I,T,P,M,R,A,N,L,O,D,z,F,V,H,U,G,$,j,W]),e)}const ci=(0,p.pure)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...o}){const r=t(o),i=t=>n((n=>{const o=[...n];return o[e]=t,o}));return(0,u.useEffect)((()=>(i(r),()=>{i(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}));var ui=window.wp.components,di={default:(0,ui.createSlotFill)("BlockControls"),block:(0,ui.createSlotFill)("BlockControlsBlock"),inline:(0,ui.createSlotFill)("BlockFormatControls"),other:(0,ui.createSlotFill)("BlockControlsOther"),parent:(0,ui.createSlotFill)("BlockControlsParent")};function pi({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:o=!1}){const r=function(e,t){const n=k();return n[h]?di[e]?.Fill:n[f]&&t?di.parent.Fill:null}(e,o);if(!r)return null;const i=(0,s.createElement)(s.Fragment,null,"default"===e&&(0,s.createElement)(ui.ToolbarGroup,{controls:t}),n);return(0,s.createElement)(ui.__experimentalStyleProvider,{document:document},(0,s.createElement)(r,null,(e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,s.createElement)(t,{...n},e)),i)})))}window.wp.warning;const{ComponentsContext:mi}=pr(ui.privateApis);function hi({group:e="default",...t}){const n=(0,u.useContext)(ui.__experimentalToolbarContext),o=(0,u.useContext)(mi),r=(0,u.useMemo)((()=>({forwardedContext:[[ui.__experimentalToolbarContext.Provider,{value:n}],[mi.Provider,{value:o}]]})),[n,o]),i=di[e]?.Slot,l=(0,ui.__experimentalUseSlotFills)(i?.__unstableName);if(!i)return null;if(!l?.length)return null;const a=(0,s.createElement)(i,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?a:(0,s.createElement)(ui.ToolbarGroup,null,a)}const fi=pi;fi.Slot=hi;const gi=e=>(0,s.createElement)(pi,{group:"inline",...e});gi.Slot=e=>(0,s.createElement)(hi,{group:"inline",...e});var bi=fi,vi=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ki=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})),_i=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),yi=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),wi=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})),Ei=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})),Si=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 Ci={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 xi(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Bi(e,t=Ci,n,o){let r="";return t?.[n]?.spacingStyles?.length&&o&&t[n].spacingStyles.forEach((t=>{r+=`${xi(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||o}`)).join("; "),r+="; }"})),r}function Ii(e){const{contentSize:t,wideSize:n,type:o="default"}=e,r={},i=/^(?!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 i.test(t)&&"constrained"===o&&(
// translators: %s: container size (i.e. 600px etc)
r.none=(0,S.sprintf)((0,S.__)("Max %s wide"),t)),i.test(n)&&(
// translators: %s: container size (i.e. 600px etc)
r.wide=(0,S.sprintf)((0,S.__)("Max %s wide"),n)),r}var Ti=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})),Pi=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,s.createElement)(W.Path,{d:"m18 7.5v9h1.5v-9z"})),Mi=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,s.createElement)(W.Path,{d:"m7.5 19.5h9v-1.5h-9z"})),Ri=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m16.5 6h-9v-1.5h9z"})),Ai=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m18 16.5v-9h1.5v9z"})),Ni=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m16.5 19.5h-9v-1.5h9z",style:{fill:"#1e1e1e"}}));const Li=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.Path,{d:"m4.5 16.5v-9h1.5v9z"})),Oi=["top","right","bottom","left"],Di={top:void 0,right:void 0,bottom:void 0,left:void 0},zi={custom:Ti,axial:Ti,horizontal:Pi,vertical:Mi,top:Ri,right:Ai,bottom:Ni,left:Li},Fi={default:(0,S.__)("Spacing control"),top:(0,S.__)("Top"),bottom:(0,S.__)("Bottom"),left:(0,S.__)("Left"),right:(0,S.__)("Right"),mixed:(0,S.__)("Mixed"),vertical:(0,S.__)("Vertical"),horizontal:(0,S.__)("Horizontal"),axial:(0,S.__)("Horizontal & vertical"),custom:(0,S.__)("Custom")},Vi={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function Hi(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function Ui(e,t){if(!Hi(e))return e;const n=ji(e),o=t.find((e=>String(e.slug)===n));return o?.size}function Gi(e,t){if(!e||Hi(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 $i(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function ji(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 Wi(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 Ki(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=$i(n?.top)||t,r=$i(n?.left)||t;return o===r?o:`${o} ${r}`}const Zi=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(ui.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),qi=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(ui.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Yi=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(ui.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),Xi=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(ui.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),Qi=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(ui.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),Ji={top:{icon:Yi,title:(0,S._x)("Align top","Block vertical alignment setting")},center:{icon:qi,title:(0,S._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Zi,title:(0,S._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:Xi,title:(0,S._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:Qi,title:(0,S._x)("Space between","Block vertical alignment setting")}},el=["top","center","bottom"];var tl=function({value:e,onChange:t,controls:n=el,isCollapsed:o=!0,isToolbar:r}){function i(n){return()=>t(e===n?void 0:n)}const l=Ji[e],a=Ji.top,c=r?ui.ToolbarGroup:ui.ToolbarDropdownMenu,u=r?{isCollapsed:o}:{};return(0,s.createElement)(c,{icon:l?l.icon:a.icon,label:(0,S._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...Ji[t],isActive:e===t,role:o?"menuitemradio":void 0,onClick:i(t)}))),...u})};const nl=e=>(0,s.createElement)(tl,{...e,isToolbar:!1}),ol=e=>(0,s.createElement)(tl,{...e,isToolbar:!0}),rl={left:vi,center:ki,right:_i,"space-between":yi,stretch:wi};var il=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:o,popoverProps:r,isToolbar:i}){const l=e=>{n(e===o?void 0:e)},a=o?rl[o]:rl.left,c=[{name:"left",icon:vi,title:(0,S.__)("Justify items left"),isActive:"left"===o,onClick:()=>l("left")},{name:"center",icon:ki,title:(0,S.__)("Justify items center"),isActive:"center"===o,onClick:()=>l("center")},{name:"right",icon:_i,title:(0,S.__)("Justify items right"),isActive:"right"===o,onClick:()=>l("right")},{name:"space-between",icon:yi,title:(0,S.__)("Space between items"),isActive:"space-between"===o,onClick:()=>l("space-between")},{name:"stretch",icon:wi,title:(0,S.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>l("stretch")}],u=i?ui.ToolbarGroup:ui.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,s.createElement)(u,{icon:a,popoverProps:r,label:(0,S.__)("Change items justification"),controls:c.filter((t=>e.includes(t.name))),...d})};const ll=e=>(0,s.createElement)(il,{...e,isToolbar:!1}),sl=e=>(0,s.createElement)(il,{...e,isToolbar:!0}),al={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},cl={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},ul={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},dl=["wrap","nowrap"];var pl={name:"flex",label:(0,S.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:o=!0}=n;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.Flex,null,(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(fl,{layout:e,onChange:t})),(0,s.createElement)(ui.FlexItem,null,o&&(0,s.createElement)(bl,{layout:e,onChange:t}))),(0,s.createElement)(gl,{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)(bi,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(fl,{layout:e,onChange:t,isToolbar:!0}),o&&(0,s.createElement)(ml,{layout:e,onChange:t,isToolbar:!0}))},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Ci}){const{orientation:l="horizontal"}=t,s=n?.spacing?.blockGap&&!li(o,"spacing","blockGap")?Ki(n?.spacing?.blockGap,"0.5em"):void 0,a=al[t.justifyContent],c=dl.includes(t.flexWrap)?t.flexWrap:"wrap",u=ul[t.verticalAlignment],d=cl[t.justifyContent]||cl.left;let p="";const m=[];return c&&"wrap"!==c&&m.push(`flex-wrap: ${c}`),"horizontal"===l?(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=`${xi(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&s&&(p+=Bi(e,i,"flex",s)),p},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function ml({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:o="horizontal"}=e,r="horizontal"===o?ul.center:ul.top,{verticalAlignment:i=r}=e,l=n=>{t({...e,verticalAlignment:n})};if(n)return(0,s.createElement)(nl,{onChange:l,value:i,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,S.__)("Align items top")},{value:"center",label:(0,S.__)("Align items center")},{value:"flex-end",label:(0,S.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,S.__)("Vertical alignment")),(0,s.createElement)("div",null,a.map(((e,t,n)=>(0,s.createElement)(ui.Button,{key:e,label:n,icon:t,isPressed:i===e,onClick:()=>l(e)})))))}const hl={placement:"bottom-start"};function fl({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:o="left",orientation:r="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},l=["left","center","right"];if("horizontal"===r?l.push("space-between"):l.push("stretch"),n)return(0,s.createElement)(ll,{allowedControls:l,value:o,onChange:i,popoverProps:hl});const a=[{value:"left",icon:vi,label:(0,S.__)("Justify items left")},{value:"center",icon:ki,label:(0,S.__)("Justify items center")},{value:"right",icon:_i,label:(0,S.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:yi,label:(0,S.__)("Space between items")}):a.push({value:"stretch",icon:wi,label:(0,S.__)("Stretch items")}),(0,s.createElement)(ui.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Justification"),value:o,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls"},a.map((({value:e,icon:t,label:n})=>(0,s.createElement)(ui.__experimentalToggleGroupControlOptionIcon,{key:e,value:e,icon:t,label:n}))))}function gl({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function bl({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:o,justifyContent:r}=e;return(0,s.createElement)(ui.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,S.__)("Orientation"),value:n,onChange:n=>{let i=o,l=r;return"horizontal"===n?("space-between"===o&&(i="center"),"stretch"===r&&(l="left")):("stretch"===o&&(i="top"),"space-between"===r&&(l="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:l})}},(0,s.createElement)(ui.__experimentalToggleGroupControlOptionIcon,{icon:Ei,value:"horizontal",label:(0,S.__)("Horizontal")}),(0,s.createElement)(ui.__experimentalToggleGroupControlOptionIcon,{icon:Si,value:"vertical",label:(0,S.__)("Vertical")}))}var vl={name:"default",label:(0,S.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:o,layoutDefinitions:r=Ci}){const i=Ki(t?.spacing?.blockGap);let l="";li(n,"spacing","blockGap")||(i?.top?l=Ki(i?.top):"string"==typeof i&&(l=Ki(i)));let s="";return o&&l&&(s+=Bi(e,r,"default",l)),s},getOrientation(){return"vertical"},getAlignments(e,t){const n=Ii(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}},kl=(0,u.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:o})})),_l=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})),yl=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})),wl=window.wp.styleEngine,El={name:"constrained",label:(0,S.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:o,contentSize:r,justifyContent:i="center"}=e,{allowJustification:l=!0,allowCustomContentAndWideSize:a=!0}=n,c=[{value:"left",icon:vi,label:(0,S.__)("Justify items left")},{value:"center",icon:ki,label:(0,S.__)("Justify items center")},{value:"right",icon:_i,label:(0,S.__)("Justify items right")}],[u]=Cr("spacing.units"),d=(0,ui.__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)(ui.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,S.__)("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)(kl,{icon:_l})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(ui.__experimentalUnitControl,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,S.__)("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)(kl,{icon:yl}))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,S.__)("Customize the width for all elements that are assigned to the center or wide columns."))),l&&(0,s.createElement)(ui.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})}},c.map((({value:e,icon:t,label:n})=>(0,s.createElement)(ui.__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:i=Ci}){const{contentSize:l,wideSize:s,justifyContent:a}=t,c=Ki(n?.spacing?.blockGap);let u="";li(o,"spacing","blockGap")||(c?.top?u=Ki(c?.top):"string"==typeof c&&(u=Ki(c)));const d="left"===a?"0 !important":"auto !important",p="right"===a?"0 !important":"auto !important";let m=l||s?`\n\t\t\t\t\t${xi(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=l?l: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${xi(e,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${null!=s?s:l};\n\t\t\t\t\t}\n\t\t\t\t\t${xi(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===a?m+=`${xi(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===a&&(m+=`${xi(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${p}; }`),n?.spacing?.padding&&(0,wl.getCSSRules)(n).forEach((t=>{"paddingRight"===t.key?m+=`\n\t\t\t\t\t${xi(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${xi(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`)})),r&&u&&(m+=Bi(e,i,"constrained",u)),m},getOrientation(){return"vertical"},getAlignments(e){const t=Ii(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 Sl={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};var Cl={name:"grid",label:(0,S.__)("Grid"),inspectorControls:function({layout:e={},onChange:t}){return e?.columnCount?(0,s.createElement)(Bl,{layout:e,onChange:t}):(0,s.createElement)(xl,{layout:e,onChange:t})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:o,hasBlockGapSupport:r,layoutDefinitions:i=Ci}){const{minimumColumnWidth:l="12rem",columnCount:s=null}=t,a=n?.spacing?.blockGap&&!li(o,"spacing","blockGap")?Ki(n?.spacing?.blockGap,"0.5em"):void 0;let c="";const u=[];return s?u.push(`grid-template-columns: repeat(${s}, minmax(0, 1fr))`):l&&u.push(`grid-template-columns: repeat(auto-fill, minmax(min(${l}, 100%), 1fr))`),u.length&&(c=`${xi(e)} { ${u.join("; ")}; }`),r&&a&&(c+=Bi(e,i,"grid",a)),c},getOrientation(){return"horizontal"},getAlignments(){return[]}};function xl({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[o,r]=(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(n);return(0,s.createElement)("fieldset",null,(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},(0,S.__)("Minimum column width")),(0,s.createElement)(ui.Flex,{gap:4},(0,s.createElement)(ui.FlexItem,{isBlock:!0},(0,s.createElement)(ui.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===r?i=(o/16).toFixed(2)+n:["em","rem"].includes(r)&&"px"===n?i=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&&(i=100+n),t({...e,minimumColumnWidth:i})},value:n,min:0})),(0,s.createElement)(ui.FlexItem,{isBlock:!0},(0,s.createElement)(ui.RangeControl,{onChange:n=>{t({...e,minimumColumnWidth:[n,r].join("")})},value:o,min:0,max:Sl[r]||600,withInputField:!1}))))}function Bl({layout:e,onChange:t}){const{columnCount:n=3}=e;return(0,s.createElement)(ui.RangeControl,{label:(0,S.__)("Columns"),value:n,onChange:n=>t({...e,columnCount:n}),min:1,max:6})}const Il=[vl,pl,El,Cl];function Tl(e="default"){return Il.find((t=>t.name===e))}const Pl={type:"default"},Ml=(0,u.createContext)(Pl),Rl=Ml.Provider;function Al(){return(0,u.useContext)(Ml)}const Nl=[],Ll=["none","left","center","right","wide","full"],Ol=["wide","full"];function Dl(e=Ll){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(hr).getSettings();return[null!==(n=o.alignWide)&&void 0!==n&&n,o.supportsLayout,o.__unstableIsBlockBasedTheme]}),[t]),i=Al();if(t)return Nl;const l=Tl(i?.type);if(o){const t=l.getAlignments(i,r).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?Nl:t}if("default"!==l.name&&"constrained"!==l.name)return Nl;const s=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&Ol.includes(e))&&Ll.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Nl:s}var zl=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})),Fl=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})),Vl=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})),Hl=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"}));const Ul={none:{icon:zl,title:(0,S._x)("None","Alignment option")},left:{icon:Fl,title:(0,S.__)("Align left")},center:{icon:_l,title:(0,S.__)("Align center")},right:{icon:Vl,title:(0,S.__)("Align right")},wide:{icon:yl,title:(0,S.__)("Wide width")},full:{icon:Hl,title:(0,S.__)("Full width")}};var Gl=function({value:e,onChange:t,controls:n,isToolbar:o,isCollapsed:r=!0}){const i=Dl(n);if(!i.length)return null;function l(n){t([e,"none"].includes(n)?void 0:n)}const a=Ul[e],c=Ul.none,u=o?ui.ToolbarGroup:ui.ToolbarDropdownMenu,d={icon:a?a.icon:c.icon,label:(0,S.__)("Align")},p=o?{isCollapsed:r,controls:i.map((({name:t})=>({...Ul[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>l(t)})))}:{toggleProps:{describedBy:(0,S.__)("Change alignment")},children:({onClose:t})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},i.map((({name:n,info:o})=>{const{icon:r,title:i}=Ul[n],a=n===e||!e&&"none"===n;return(0,s.createElement)(ui.MenuItem,{key:n,icon:r,iconPosition:"left",className:oi()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{l(n),t()},role:"menuitemradio",info:o},i)}))))};return(0,s.createElement)(u,{...d,...p})};const $l=e=>(0,s.createElement)(Gl,{...e,isToolbar:!1}),jl=e=>(0,s.createElement)(Gl,{...e,isToolbar:!0});function Wl(e){const{clientId:t=""}=k(),n=(0,d.useSelect)((e=>e(hr).getBlockEditingMode(t)),[t]),{setBlockEditingMode:o,unsetBlockEditingMode:r}=(0,d.useDispatch)(hr);return(0,u.useEffect)((()=>(e&&o(t,e),()=>{e&&r(t)})),[t,e,o,r]),n}const Kl=["left","center","right","wide","full"],Zl=["wide","full"];function ql(e,t=!0,n=!0){let o;return o=Array.isArray(e)?Kl.filter((t=>e.includes(t))):!0===e?[...Kl]:[],!n||!0===e&&!t?o.filter((e=>!Zl.includes(e))):o}var Yl={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const o=Dl(ql((0,c.getBlockSupport)(e,"align"),(0,c.hasBlockSupport)(e,"alignWide",!0))).map((({name:e})=>e)),r=Wl();return o.length&&"default"===r?(0,s.createElement)(bi,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)($l,{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}){return Dl(ql((0,c.getBlockSupport)(e,"align"),(0,c.hasBlockSupport)(e,"alignWide",!0))).some((e=>e.name===t))?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:o}=n;return ql((0,c.getBlockSupport)(t,"align"),(0,c.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=oi()(`align${o}`,e.className)),e},attributeKeys:["align"],hasSupport(e){return(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:[...Kl,""]}}),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 Xl=(0,ui.createSlotFill)("InspectorControls"),Ql=(0,ui.createSlotFill)("InspectorAdvancedControls"),Jl=(0,ui.createSlotFill)("InspectorControlsBackground"),es=(0,ui.createSlotFill)("InspectorControlsBorder"),ts=(0,ui.createSlotFill)("InspectorControlsColor"),ns=(0,ui.createSlotFill)("InspectorControlsFilter"),os=(0,ui.createSlotFill)("InspectorControlsDimensions"),rs=(0,ui.createSlotFill)("InspectorControlsPosition"),is=(0,ui.createSlotFill)("InspectorControlsTypography");var ls={default:Xl,advanced:Ql,background:Jl,border:es,color:ts,dimensions:os,filter:ns,list:(0,ui.createSlotFill)("InspectorControlsListView"),position:rs,settings:Xl,styles:(0,ui.createSlotFill)("InspectorControlsStyles"),typography:is};function ss({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:o}){n&&(y()("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=k(),i=ls[t]?.Fill;return i&&r[h]?(0,s.createElement)(ui.__experimentalStyleProvider,{document:document},(0,s.createElement)(i,null,(t=>(0,s.createElement)(cs,{fillProps:t,children:e,resetAllFilter:o})))):null}function as({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:o}=(0,u.useContext)(ui.__experimentalToolsPanelContext);return(0,u.useEffect)((()=>{if(e&&n&&o)return n(e),()=>{o(e)}}),[e,n,o]),t}function cs({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:o=[]}=n,r=(0,s.createElement)(as,{resetAllFilter:t},e);return o.reduce(((e,[t,n])=>(0,s.createElement)(t,{...n},e)),r)}function us({children:e,group:t,label:n}){const{updateBlockAttributes:o}=(0,d.useDispatch)(hr),{getBlockAttributes:r,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:l,hasMultiSelection:a}=(0,d.useSelect)(hr),c=l(),p=(0,u.useCallback)(((e=[])=>{const t={},n=a()?i():[c];n.forEach((n=>{const{style:o}=r(n);let i={style:o};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:ri(i.style)},t[n]=i})),o(n,t,!0)}),[r,i,a,c,o]);return(0,s.createElement)(ui.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:n,resetAll:p,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Ur},e)}function ds({Slot:e,fillProps:t,...n}){const o=(0,u.useContext)(ui.__experimentalToolsPanelContext),r=(0,u.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[ui.__experimentalToolsPanelContext.Provider,{value:o}]]}}),[o,t]);return(0,s.createElement)(e,{...n,fillProps:r,bubblesVirtually:!0})}function ps({__experimentalGroup:e,group:t="default",label:n,fillProps:o,...r}){e&&(y()("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=ls[t]?.Slot,l=(0,ui.__experimentalUseSlotFills)(i?.__unstableName),a=(0,u.useContext)(ui.__unstableMotionContext),c=(0,u.useMemo)((()=>{var e;return{...null!=o?o:{},forwardedContext:[...null!==(e=o?.forwardedContext)&&void 0!==e?e:[],[ui.__unstableMotionContext.Provider,{value:a}]]}}),[a,o]);return i&&l?.length?n?(0,s.createElement)(us,{group:t,label:n},(0,s.createElement)(ds,{...r,fillProps:c,Slot:i})):(0,s.createElement)(i,{...r,fillProps:c,bubblesVirtually:!0}):null}const ms=ss;ms.Slot=ps;const hs=e=>(0,s.createElement)(ss,{...e,group:"advanced"});hs.Slot=e=>(0,s.createElement)(ps,{...e,group:"advanced"}),hs.slotName="InspectorAdvancedControls";var fs=ms;const gs=/[\s#]/g,bs={type:"string",source:"attribute",attribute:"id",selector:"*"};var vs={addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({name:e,anchor:t,setAttributes:n}){const o=Wl(),r="web"===u.Platform.OS,i=(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,S.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,S.__)("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)(ui.ExternalLink,{href:(0,S.__)("https://wordpress.org/documentation/article/page-jumps/")},(0,S.__)("Learn more about anchors"))),value:t||"",placeholder:r?null:(0,S.__)("Add an anchor"),onChange:e=>{e=e.replace(gs,"-"),n({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,r&&"default"===o&&(0,s.createElement)(fs,{group:"advanced"},i),!r&&"core/heading"===e&&(0,s.createElement)(fs,null,(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Heading settings")},i)))},attributeKeys:["anchor"],hasSupport(e){return(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:bs}),e}));const ks={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};var _s={addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport(e){return(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:ks}),e}));var ys={edit:function({className:e,setAttributes:t}){return"default"!==Wl()?null:(0,s.createElement)(fs,{group:"advanced"},(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,S.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,S.__)("Separate multiple classes with spaces.")}))},addSaveProps:function(e,t,n){return(0,c.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=oi()(e.className,n.className)),e},attributeKeys:["className"],hasSupport(e){return(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}));var ws=window.wp.blob,Es=window.wp.dom,Ss=window.wp.notices,Cs=window.wp.url,xs=window.wp.keycodes,Bs=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,s.createElement)(W.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"})),Is=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),Ts=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),Ps=(0,ui.withFilters)("editor.MediaUpload")((()=>null)),Ms=function({fallback:e=null,children:t}){const n=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return!!t().mediaUpload}),[]);return n?t:e},Rs=window.wp.isShallowEqual,As=n.n(Rs),Ns=window.wp.preferences,Ls=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(W.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"})),Os=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),Ds=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),zs=function e({children:t,settingsOpen:n,setSettingsOpen:o}){const r=(0,p.useReducedMotion)(),i=r?u.Fragment:ui.__unstableAnimatePresence,l=r?"div":ui.__unstableMotion.div,a=`link-control-settings-drawer-${(0,p.useInstanceId)(e)}`;return(0,s.createElement)(u.Fragment,null,(0,s.createElement)(ui.Button,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>o(!n),icon:(0,S.isRTL)()?Os:Ds,"aria-controls":a},(0,S._x)("Advanced","Additional link settings")),(0,s.createElement)(i,null,n&&(0,s.createElement)(l,{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))))},Fs=n(5425),Vs=n.n(Fs);function Hs(e){return"function"==typeof e}class Us 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,Vs()(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,Cs.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,S.sprintf)(/* translators: %s: number of results. */
(0,S._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,S.__)("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 xs.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case xs.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case xs.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case xs.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case xs.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case xs.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,S.__)("Link selected.")));break;case xs.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,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 i=r;const l=e&&e.length;return o||l||(i=!1),!0===n&&(i=!1),{showSuggestions:i,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:i=(0,S.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:a="",hideLabelFromVision:c=!1}=this.props,{loading:u,showSuggestions:d,selectedSuggestion:p,suggestionsListboxId:m,suggestionOptionIdPrefix:h}=this.state,f=`url-input-control-${r}`,g={id:f,label:t,className:oi()("block-editor-url-input",n,{"is-full-width":o}),hideLabelFromVision:c},b={id:f,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,S.__)("URL"),"aria-expanded":d,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==p?`${h}-${p}`:void 0,ref:this.inputRef};return l?l(g,b,u):(e||y()("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)(ui.BaseControl,{__nextHasNoMarginBottom:e,...g},(0,s.createElement)("input",{...b}),u&&(0,s.createElement)(ui.Spinner,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:o,suggestionsValue:r,selectedSuggestion:i,suggestionsListboxId:l,suggestionOptionIdPrefix:a,loading:c}=this.state;if(!n||0===o.length)return null;const u={id:l,ref:this.autocompleteRef,role:"listbox"},d=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return Hs(t)?t({suggestions:o,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,s.createElement)(ui.Popover,{placement:"bottom",focusOnMount:!1},(0,s.createElement)("div",{...u,className:oi()("block-editor-url-input__suggestions",`${e}__suggestions`)},o.map(((e,t)=>(0,s.createElement)(ui.Button,{...d(0,t),key:e.id,className:oi()("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))))}}var Gs=(0,p.compose)(p.withSafeTimeout,ui.withSpokenMessages,p.withInstanceId,(0,d.withSelect)(((e,t)=>{if(Hs(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(hr);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Us),$s=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),js=({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,S.sprintf)(/* translators: %s: search term. */
(0,S.__)("Create: <mark>%s</mark>"),e),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(ui.MenuItem,{...n,iconPosition:"left",icon:$s,className:"block-editor-link-control__search-item",onClick:t},r)},Ws=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),Ks=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,s.createElement)(W.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"})),Zs=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),qs=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),Ys=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),Xs=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),Qs=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),Js=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"}));const ea={post:Ws,page:Ks,post_tag:Zs,category:qs,attachment:Ys};function ta({isURL:e,suggestion:t}){let n=null;return e?n=Xs:t.type in ea&&(n=ea[t.type],"page"===t.type&&(t.isFrontPage&&(n=Qs),t.isBlogHome&&(n=Js))),n?(0,s.createElement)(kl,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function na(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function oa(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function ra(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}var ia=({itemProps:e,suggestion:t,searchTerm:n,onClick:o,isURL:r=!1,shouldShowType:i=!1})=>{const l=r?(0,S.__)("Press ENTER to add this link"):(a=t.url)?(0,p.pipe)(Cs.safeDecodeURI,Cs.getPath,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(Cs.filterURLForDisplay,24),oa,na)(a):a;var a;return(0,s.createElement)(ui.MenuItem,{...e,info:l,iconPosition:"left",icon:(0,s.createElement)(ta,{suggestion:t,isURL:r}),onClick:o,shortcut:i&&ra(t),className:"block-editor-link-control__search-item"},(0,s.createElement)(ui.TextHighlight,{text:(0,Es.__unstableStripHTML)(t.title),highlight:n}))};const la="__CREATE__",sa="link",aa="mailto",ca="internal",ua=[sa,aa,"tel",ca],da=[{id:"opensInNewTab",title:(0,S.__)("Open in new tab")}];function pa({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:i,suggestions:l,selectedSuggestion:a,isLoading:c,isInitialSuggestions:u,createSuggestionButtonText:d,suggestionsQuery:p}){const m=oi()("block-editor-link-control__search-results",{"is-loading":c}),h=1===l.length&&ua.includes(l[0].type),f=t&&!h&&!u,g=!p?.type,b=`block-editor-link-control-search-results-label-${e}`,v=u?(0,S.__)("Suggestions"):(0,S.sprintf)(/* translators: %s: search term. */
(0,S.__)('Search results for "%s"'),n),k=(0,s.createElement)(ui.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)(ui.MenuGroup,null,l.map(((e,t)=>f&&la===e.type?(0,s.createElement)(js,{searchTerm:n,buttonText:d,onClick:()=>o(e),key:e.type,itemProps:i(e,t),isSelected:t===a}):la===e.type?null:(0,s.createElement)(ia,{key:`${e.id}-${e.type}`,itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===a,isURL:ua.includes(e.type),searchTerm:n,shouldShowType:g,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome}))))))}function ma(e){if(e.includes(" "))return!1;const t=(0,Cs.getProtocol)(e),n=(0,Cs.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."),i=e?.startsWith("#")&&(0,Cs.isValidFragment)(e);return n||r||i||o}const ha=()=>Promise.resolve([]),fa=e=>{let t=sa;const n=(0,Cs.getProtocol)(e)||"";return n.includes("mailto")&&(t=aa),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=ca),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Cs.prependHTTP)(e):e,type:t}])};const ga=()=>Promise.resolve([]),ba=()=>{},va=(0,u.forwardRef)((({value:e,children:t,currentLink:n={},className:o=null,placeholder:r=null,withCreateSuggestion:i=!1,onCreateSuggestion:l=ba,onChange:a=ba,onSelect:c=ba,showSuggestions:m=!0,renderSuggestions:h=(e=>(0,s.createElement)(pa,{...e})),fetchSuggestions:f=null,allowDirectEntry:g=!0,showInitialSuggestions:b=!1,suggestionsQuery:v={},withURLSuggestion:k=!0,createSuggestionButtonText:_,hideLabelFromVision:y=!1},w)=>{const E=function(e,t,n){const{fetchSearchSuggestions:o,pageOnFront:r,pageForPosts:i}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?fa:ha;return(0,u.useCallback)(((t,{isInitialSuggestions:s})=>ma(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,o,r,i)=>{const{isInitialSuggestions:l}=t,s=await n(e,t);return s.map((e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),l||ma(e)||!o?s:s.concat({title:e,url:e,type:la})})(t,{...e,isInitialSuggestions:s},o,n,r,i)),[l,o,r,i,e,n])}(v,g,i),C=m?f||E:ga,x=(0,p.useInstanceId)(va),[B,I]=(0,u.useState)(),T=async e=>{let t=e;if(la!==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 l(e.title),t?.url&&c(t)}catch(e){}},P=oi()(o,{});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Gs,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,S.__)("Link"),hideLabelFromVision:y,className:P,value:e,onChange:(e,t)=>{a(e),I(t)},placeholder:null!=r?r:(0,S.__)("Search or type url"),__experimentalRenderSuggestions:m?e=>h({...e,instanceId:x,withCreateSuggestion:i,createSuggestionButtonText:_,suggestionsQuery:v,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:C,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:b,onSubmit:(t,n)=>{const o=t||B;o||e?.trim()?.length?T(o||{url:e}):n.preventDefault()},ref:w}),t)}));var ka=va,_a=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),ya=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})),wa=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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:Ea,Fill:Sa}=(0,ui.createSlotFill)("BlockEditorLinkControlViewer");function Ca(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 xa=function(e){const[t,n]=(0,u.useReducer)(Ca,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);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 Ba({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:o=!1,onRemove:r,additionalControls:i}){const l=n?e?.url:null,{richData:a,isFetching:c}=xa(l),u=a&&Object.keys(a).length,d=e&&(0,Cs.filterURLForDisplay)((0,Cs.safeDecodeURI)(e.url),16)||"",p=!e?.url?.length,m=!p&&(0,Es.__unstableStripHTML)(a?.title||e?.title||d);let h;return h=a?.icon?(0,s.createElement)("img",{src:a?.icon,alt:""}):p?(0,s.createElement)(kl,{icon:_a,size:32}):(0,s.createElement)(kl,{icon:Xs}),(0,s.createElement)("div",{"aria-label":(0,S.__)("Currently selected"),className:oi()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":p,"is-url-title":m===d})},(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:oi()("block-editor-link-control__search-item-icon",{"is-image":a?.icon})},h),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},p?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,S.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.Tooltip,{text:e.url,placement:"bottom-start"},(0,s.createElement)(ui.ExternalLink,{className:"block-editor-link-control__search-item-title",href:e.url},m)),e?.url&&m!==d&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},d)))),(0,s.createElement)(ui.Button,{icon:ya,label:(0,S.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:t,iconSize:24}),o&&(0,s.createElement)(ui.Button,{icon:wa,label:(0,S.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:r,iconSize:24}),(0,s.createElement)(Ea,{fillProps:e})),!!(u&&(a?.image||a?.description)||c)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},(a?.image||c)&&(0,s.createElement)("div",{"aria-hidden":!a?.image,className:oi()("block-editor-link-control__search-item-image",{"is-placeholder":!a?.image})},a?.image&&(0,s.createElement)("img",{src:a?.image,alt:""})),(a?.description||c)&&(0,s.createElement)("div",{"aria-hidden":!a?.description,className:oi()("block-editor-link-control__search-item-description",{"is-placeholder":!a?.description})},a?.description&&(0,s.createElement)(ui.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))),i&&i())}const Ia=()=>{};var Ta=({value:e,onChange:t=Ia,settings:n})=>{if(!n||!n.length)return null;const o=n=>o=>{t({...e,[n.id]:o})},r=n.map((t=>(0,s.createElement)(ui.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)(ui.VisuallyHidden,{as:"legend"},(0,S.__)("Currently selected link settings")),r)};var Pa=n(2303),Ma=n.n(Pa);const Ra=()=>{},Aa="core/block-editor",Na="linkControlSettingsDrawer";function La({searchInputPlaceholder:e,value:t,settings:n=da,onChange:o=Ra,onRemove:r,onCancel:i,noDirectEntry:l=!1,showSuggestions:a=!0,showInitialSuggestions:c,forceIsEditingLink:p,createSuggestion:m,withCreateSuggestion:h,inputValue:f="",suggestionsQuery:g={},noURLSuggestion:b=!1,createSuggestionButtonText:v,hasRichPreviews:k=!1,hasTextControl:_=!1,renderControlBottom:y=null}){void 0===h&&m&&(h=!0);const[w,E]=(0,u.useState)(!1),{advancedSettingsPreference:C}=(0,d.useSelect)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(Ns.store).get(Aa,Na))&&void 0!==t&&t}}),[]),{set:x}=(0,d.useDispatch)(Ns.store),B=C||w,I=(0,u.useRef)(!0),T=(0,u.useRef)(),P=(0,u.useRef)(),M=(0,u.useRef)(!1),R=n.map((({id:e})=>e)),[A,N,L,O,D]=function(e){const[t,n]=(0,u.useState)(e||{}),[o,r]=(0,u.useState)(e);return Ma()(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,Rs.isShallowEqualObjects)(A,t),[F,V]=(0,u.useState)(void 0!==p?p:!t||!t.url),{createPage:H,isCreatingPage:U,errorMessage:G}=function(e){const t=(0,u.useRef)(),[n,o]=(0,u.useState)(!1),[r,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),i(null);try{return t.current=(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}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,S.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(m);(0,u.useEffect)((()=>{void 0!==p&&V(p)}),[p]),(0,u.useEffect)((()=>{I.current?I.current=!1:((Es.focus.focusable.find(T.current)[0]||T.current).focus(),M.current=!1)}),[F,U]);const $=t?.url?.trim()?.length>0,j=()=>{M.current=!!T.current?.contains(T.current.ownerDocument.activeElement),V(!1)},W=()=>{z&&o({...t,...A,url:K}),j()},K=f||A?.url||"",Z=!K?.trim()?.length,q=r&&t&&!F&&!U,Y=F&&$,X=$&&_,Q=(F||!t)&&!U,J=!z||Z,ee=!!n?.length&&F&&$;return(0,s.createElement)("div",{tabIndex:-1,ref:T,className:"block-editor-link-control"},U&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(ui.Spinner,null)," ",(0,S.__)("Creating"),"…"),Q&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:oi()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":X,"has-actions":Y})},X&&(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,ref:P,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,S.__)("Text"),value:A?.title,onChange:O,onKeyDown:e=>{const{keyCode:t}=e;t!==xs.ENTER||Z||(e.preventDefault(),W())},size:"__unstable-large"}),(0,s.createElement)(ka,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:K,withCreateSuggestion:h,onCreateSuggestion:H,onChange:L,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(R.includes(n)||(t[n]=e[n]),t)),{});o({...A,...t,title:A?.title||e?.title}),j()},showInitialSuggestions:c,allowDirectEntry:!l,showSuggestions:a,suggestionsQuery:g,withURLSuggestion:!b,createSuggestionButtonText:v,hideLabelFromVision:!X}),!Y&&(0,s.createElement)("div",{className:"block-editor-link-control__search-enter"},(0,s.createElement)(ui.Button,{onClick:J?Ra:W,label:(0,S.__)("Submit"),icon:Ls,className:"block-editor-link-control__search-submit","aria-disabled":J}))),G&&(0,s.createElement)(ui.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),t&&!F&&!U&&(0,s.createElement)(Ba,{key:t?.url,value:t,onEditClick:()=>V(!0),hasRichPreviews:k,hasUnlinkControl:q,additionalControls:()=>{if(n?.find((e=>"opensInNewTab"===e.id)))return(0,s.createElement)(Ta,{value:A,settings:n?.filter((({id:e})=>"opensInNewTab"===e)),onChange:o})},onRemove:()=>{r(),V(!0)}}),ee&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},!Z&&(0,s.createElement)(zs,{settingsOpen:B,setSettingsOpen:e=>{x&&x(Aa,Na,e),E(e)}},(0,s.createElement)(Ta,{value:A,settings:n,onChange:D(R)}))),Y&&(0,s.createElement)(ui.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions"},(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),N(t),$?j():r?.(),i?.()}},(0,S.__)("Cancel")),(0,s.createElement)(ui.Button,{variant:"primary",onClick:J?Ra:W,className:"block-editor-link-control__search-submit","aria-disabled":J},(0,S.__)("Save"))),y&&y())}La.ViewerFill=Sa,La.DEFAULT_LINK_SETTINGS=da;var Oa=La;const Da=()=>{};let za=0;var Fa=(0,p.compose)([(0,d.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Ss.store);return{createNotice:t,removeNotice:n}})),(0,ui.withFilters)("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:o,accept:r,onError:i,onSelect:l,onSelectURL:a,onToggleFeaturedImage:c,useFeaturedImage:p,onFilesUpload:m=Da,name:h=(0,S.__)("Replace"),createNotice:f,removeNotice:g,children:b,multiple:v=!1,addToGallery:k,handleUpload:_=!0,popoverProps:y})=>{const w=(0,d.useSelect)((e=>e(hr).getSettings().mediaUpload),[]),E=!!w,C=(0,u.useRef)(),x="block-editor/media-replace-flow/error-notice/"+ ++za,B=e=>{const t=(0,Es.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{f("error",t,{speak:!0,id:x,isDismissible:!0})}),1e3)},I=(e,t)=>{p&&c&&c(),t(),l(e),(0,Zn.speak)((0,S.__)("The media file has been replaced")),g(x)},T=e=>{e.keyCode===xs.DOWN&&(e.preventDefault(),e.target.click())},P=v&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(ui.Dropdown,{popoverProps:y,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(ui.ToolbarButton,{ref:C,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:T},h),renderContent:({onClose:i})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(Ms,null,(0,s.createElement)(Ps,{gallery:P,addToGallery:k,multiple:v,value:v?n:t,onSelect:e=>I(e,i),allowedTypes:o,render:({open:e})=>(0,s.createElement)(ui.MenuItem,{icon:Bs,onClick:e},(0,S.__)("Open Media Library"))}),(0,s.createElement)(ui.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!_)return t(),l(n);m(n),w({allowedTypes:o,filesList:n,onFileChange:([e])=>{I(e,t)},onError:B})})(e,i)},accept:r,multiple:!!v,render:({openFileDialog:e})=>(0,s.createElement)(ui.MenuItem,{icon:Is,onClick:()=>{e()}},(0,S.__)("Upload"))})),c&&(0,s.createElement)(ui.MenuItem,{icon:Ts,onClick:c,isPressed:p},(0,S.__)("Use featured image")),b),a&&(0,s.createElement)("form",{className:oi()("block-editor-media-flow__url-input",{"has-siblings":E||c})},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,S.__)("Current media URL:")),(0,s.createElement)(Oa,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),C.current.focus()}})))})}));const Va="background",Ha="image";function Ua(e){return!!e?.background?.backgroundImage?.id||!!e?.background?.backgroundImage?.url}function Ga(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,Va);return!!(!0===n||("any"===t?n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat:n?.[t]))}function $a(e={},t){t({style:ri({...e,background:{...e?.background,backgroundImage:void 0}})})}function ja(e){return Ua(e)?"has-background":""}function Wa({label:e,filename:t,url:n}){const o=e||(0,Cs.getFilename)(n);return(0,s.createElement)(ui.__experimentalItemGroup,{as:"span"},(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start",as:"span"},(0,s.createElement)("span",{className:oi()("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)(ui.FlexItem,{as:"span"},(0,s.createElement)(ui.__experimentalTruncate,{numberOfLines:1,className:"block-editor-hooks__background__inspector-media-replace-title"},o),(0,s.createElement)(ui.VisuallyHidden,{as:"span"},t?(0,S.sprintf)(/* translators: %s: file name */
(0,S.__)("Selected image: %s"),t):(0,S.__)("No image selected")))))}function Ka({clientId:e,isShownByDefault:t,setAttributes:n}){const{style:o,mediaUpload:r}=(0,d.useSelect)((t=>{const{getBlockAttributes:n,getSettings:o}=t(hr);return{style:n(e)?.style,mediaUpload:o().mediaUpload}}),[e]),{id:i,title:l,url:a}=o?.background?.backgroundImage||{},c=(0,u.useRef)(),{createErrorNotice:p}=(0,d.useDispatch)(Ss.store),m=e=>{p(e,{type:"snackbar"})},h=e=>{if(!e||!e.url){const e={...o,background:{...o?.background,backgroundImage:void 0}},t={style:ri(e)};return void n(t)}if((0,ws.isBlobURL)(e.url))return;if(e.media_type&&e.media_type!==Ha||!e.media_type&&e.type&&e.type!==Ha)return void m((0,S.__)("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:ri(t)};n(r)},f=(0,u.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),g=Ua(o);return(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>g,label:(0,S.__)("Background image"),onDeselect:()=>$a(o,n),isShownByDefault:t,resetAllFilter:f,panelId:e},(0,s.createElement)("div",{className:"block-editor-hooks__background__inspector-media-replace-container",ref:c},(0,s.createElement)(Fa,{mediaId:i,mediaURL:a,allowedTypes:[Ha],accept:"image/*",onSelect:h,name:(0,s.createElement)(Wa,{label:(0,S.__)("Background image"),filename:l,url:a}),variant:"secondary"},g&&(0,s.createElement)(ui.MenuItem,{onClick:()=>{const[e]=Es.focus.tabbable.find(c.current);e?.focus(),e?.click(),$a(o,n)}},(0,S.__)("Reset "))),(0,s.createElement)(ui.DropZone,{onFilesDrop:e=>{r({allowedTypes:["image"],filesList:e,onFileChange([e]){(0,ws.isBlobURL)(e?.url)||h(e)},onError:m})},label:(0,S.__)("Drop to upload")})))}function Za({clientId:e,isShownByDefault:t,setAttributes:n}){const o=(0,d.useSelect)((t=>t(hr).getBlockAttributes(e)?.style),[e]),r=o?.background?.backgroundSize,i=o?.background?.backgroundRepeat,l=void 0!==r&&"cover"!==r&&"contain"!==r||""===r?"auto":r||"cover",a="no-repeat"!==i&&("cover"!==l||void 0!==i),c=function(e){return 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=i;"contain"===e&&(t="no-repeat"),"cover"!==l&&"contain"!==l||"auto"!==e||(t=void 0),n({style:ri({...o,background:{...o?.background,backgroundRepeat:t,backgroundSize:e}})})};return(0,s.createElement)(ui.__experimentalVStack,{as:ui.__experimentalToolsPanelItem,spacing:2,className:"single-column",hasValue:()=>c,label:(0,S.__)("Size"),onDeselect:()=>function(e={},t){t({style:ri({...e,background:{...e?.background,backgroundRepeat:void 0,backgroundSize:void 0}})})}(o,n),isShownByDefault:t,resetAllFilter:p,panelId:e},(0,s.createElement)(ui.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,S.__)("Size"),value:l,onChange:m,isBlock:!0,help:(h=r,"cover"===h||void 0===h?(0,S.__)("Stretch image to cover the block."):"contain"===h?(0,S.__)("Resize image to fit without cropping."):(0,S.__)("Set a fixed width."))},(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"cover",value:"cover",label:(0,S.__)("Cover")}),(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"contain",value:"contain",label:(0,S.__)("Contain")}),(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"fixed",value:"auto",label:(0,S.__)("Fixed")})),void 0!==r&&"cover"!==r&&"contain"!==r?(0,s.createElement)(ui.__experimentalUnitControl,{size:"__unstable-large",onChange:m,value:r}):null,"cover"!==l&&(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Repeat image"),checked:a,onChange:()=>{n({style:ri({...o,background:{...o?.background,backgroundRepeat:!0===a?"no-repeat":void 0}})})}}));var h}function qa(e){const[t,n]=Cr("background.backgroundImage","background.backgroundSize");if(!t||!Ga(e.name,"backgroundImage"))return null;const o=!(!n||!Ga(e.name,"backgroundSize")),r=(0,c.getBlockSupport)(e.name,[Va,"__experimentalDefaultControls"]);return(0,s.createElement)(fs,{group:"background"},(0,s.createElement)(Ka,{isShownByDefault:r?.backgroundImage,...e}),o&&(0,s.createElement)(Za,{isShownByDefault:r?.backgroundSize,...e}))}var Ya={grad:.9,turn:360,rad:360/(2*Math.PI)},Xa=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Qa=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ja=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},ec=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},tc=function(e){return{r:Ja(e.r,0,255),g:Ja(e.g,0,255),b:Ja(e.b,0,255),a:Ja(e.a)}},nc=function(e){return{r:Qa(e.r),g:Qa(e.g),b:Qa(e.b),a:Qa(e.a,3)}},oc=/^#([0-9a-f]{3,8})$/i,rc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ic=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=Math.max(t,n,o),l=i-Math.min(t,n,o),s=l?i===t?(n-o)/l:i===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(s<0?s+6:s),s:i?l/i*100:0,v:i/255*100,a:r}},lc=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var i=Math.floor(t),l=o*(1-n),s=o*(1-(t-i)*n),a=o*(1-(1-t+i)*n),c=i%6;return{r:255*[o,s,l,l,a,o][c],g:255*[a,o,o,s,l,l][c],b:255*[l,l,a,o,o,s][c],a:r}},sc=function(e){return{h:ec(e.h),s:Ja(e.s,0,100),l:Ja(e.l,0,100),a:Ja(e.a)}},ac=function(e){return{h:Qa(e.h),s:Qa(e.s),l:Qa(e.l),a:Qa(e.a,3)}},cc=function(e){return lc((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},uc=function(e){return{h:(t=ic(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},dc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pc=/^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,hc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fc={string:[[function(e){var t=oc.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?Qa(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?Qa(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=mc.exec(e)||hc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:tc({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=dc.exec(e)||pc.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)*(Ya[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return cc(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=void 0===r?1:r;return Xa(t)&&Xa(n)&&Xa(o)?tc({r:Number(t),g:Number(n),b:Number(o),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,i=void 0===r?1:r;if(!Xa(t)||!Xa(n)||!Xa(o))return null;var l=sc({h:Number(t),s:Number(n),l:Number(o),a:Number(i)});return cc(l)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,i=void 0===r?1:r;if(!Xa(t)||!Xa(n)||!Xa(o))return null;var l=function(e){return{h:ec(e.h),s:Ja(e.s,0,100),v:Ja(e.v,0,100),a:Ja(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(i)});return lc(l)},"hsv"]]},gc=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]},bc=function(e,t){var n=uc(e);return{h:n.h,s:Ja(n.s+100*t,0,100),l:n.l,a:n.a}},vc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},kc=function(e,t){var n=uc(e);return{h:n.h,s:n.s,l:Ja(n.l+100*t,0,100),a:n.a}},_c=function(){function e(e){this.parsed=function(e){return"string"==typeof e?gc(e.trim(),fc.string):"object"==typeof e&&null!==e?gc(e,fc.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Qa(vc(this.rgba),2)},e.prototype.isDark=function(){return vc(this.rgba)<.5},e.prototype.isLight=function(){return vc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=nc(this.rgba)).r,n=e.g,o=e.b,i=(r=e.a)<1?rc(Qa(255*r)):"","#"+rc(t)+rc(n)+rc(o)+i;var e,t,n,o,r,i},e.prototype.toRgb=function(){return nc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=nc(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 ac(uc(this.rgba))},e.prototype.toHslString=function(){return t=(e=ac(uc(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=ic(this.rgba),{h:Qa(e.h),s:Qa(e.s),v:Qa(e.v),a:Qa(e.a,3)};var e},e.prototype.invert=function(){return yc({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),yc(bc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),yc(bc(this.rgba,-e))},e.prototype.grayscale=function(){return yc(bc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),yc(kc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),yc(kc(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?yc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Qa(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=uc(this.rgba);return"number"==typeof e?yc({h:e,s:t.s,l:t.l,a:t.a}):Qa(t.h)},e.prototype.isEqual=function(e){return this.toHex()===yc(e).toHex()},e}(),yc=function(e){return e instanceof _c?e:new _c(e)},wc=[],Ec=function(e){e.forEach((function(e){wc.indexOf(e)<0&&(e(_c,fc),wc.push(e))}))};function Sc(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 i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,l,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(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,l=i[p],Math.pow(r.r-l.r,2)+Math.pow(r.g-l.g,2)+Math.pow(r.b-l.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 Cc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},xc=function(e){return.2126*Cc(e.r)+.7152*Cc(e.g)+.0722*Cc(e.b)};function Bc(e){e.prototype.luminance=function(){return e=xc(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,i,l,s,a,c=t instanceof e?t:new e(t);return i=this.rgba,l=c.toRgb(),n=(s=xc(i))>(a=xc(l))?(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)>=(l=void 0===(i=(n=t).size)?"normal":i,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===l?7:"AA"===r&&"large"===l?3:4.5);var n,o,r,i,l}}Ec([Sc,Bc]);const Ic=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},Tc=(e,t)=>e?.find((e=>e.color===t));function Pc(e,t){if(!e||!t)return;const{kebabCase:n}=pr(ui.privateApis);return`has-${n(t)}-${e}`}function Mc(){const[e,t,n,o,r,i,l,s,a,c]=Cr("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:!i};return d.colors=(0,u.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,S._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,S._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,S._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,S._x)("Theme","Indicates this palette comes from the theme."),gradients:s}),c&&a&&a.length&&e.push({name:(0,S._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,S._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,s,a,c]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}function Rc(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Ac(e={}){const{flat:t,...n}=e;return t||Rc(Object.values(n).filter(Boolean))||"px"}function Nc(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,ui.__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]:"",i=Rc(o);return 0===r||r?`${r}${i}`:void 0}function Lc(e={}){const t=Nc(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function Oc(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Dc({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){let i=Nc(o);void 0===i&&(i=Ac(t));const l=Oc(o)&&Lc(o),a=l?(0,S.__)("Mixed"):null;return(0,s.createElement)(ui.__experimentalUnitControl,{...r,"aria-label":(0,S.__)("Border radius"),disableUnits:l,isOnly:!0,value:i,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 zc={topLeft:(0,S.__)("Top left"),topRight:(0,S.__)("Top right"),bottomLeft:(0,S.__)("Bottom left"),bottomRight:(0,S.__)("Bottom right")};function Fc({onChange:e,selectedUnits:t,setSelectedUnits:n,values:o,...r}){const i=t=>n=>{if(!e)return;const o=isNaN(parseFloat(n))?void 0:n;e({...l,[t]:o})},l="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(zc).map((([e,o])=>{const[a,c]=(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(l[e]),u=l[e]?c:t[e]||t.flat;return(0,s.createElement)(ui.Tooltip,{text:o,placement:"top",key:e},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(ui.__experimentalUnitControl,{...r,"aria-label":o,value:[a,u].join(""),onChange:i(e),onUnitChange:(d=e,e=>{const o={...t};o[d]=e,n(o)}),size:"__unstable-large"})));var d})))}var Vc=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 Hc({isLinked:e,...t}){const n=e?(0,S.__)("Unlink radii"):(0,S.__)("Link radii");return(0,s.createElement)(ui.Tooltip,{text:n},(0,s.createElement)(ui.Button,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?Vc:wa,iconSize:24,"aria-label":n}))}const Uc={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},Gc=0,$c={px:100,em:20,rem:20};function jc({onChange:e,values:t}){const[n,o]=(0,u.useState)(!Oc(t)||!Lc(t)),[r,i]=(0,u.useState)({flat:"string"==typeof t?(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[l]=Cr("spacing.units"),a=(0,ui.__experimentalUseCustomUnits)({availableUnits:l||["px","em","rem"]}),c=Ac(r),d=a&&a.find((e=>e.value===c)),p=d?.step||1,[m]=(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(Nc(t));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},(0,S.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},n?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Dc,{className:"components-border-radius-control__unit-control",values:t,min:Gc,onChange:e,selectedUnits:r,setSelectedUnits:i,units:a}),(0,s.createElement)(ui.RangeControl,{label:(0,S.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=m?m:"",min:Gc,max:$c[c],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${c}`:void 0)},step:p,__nextHasNoMarginBottom:!0})):(0,s.createElement)(Fc,{min:Gc,onChange:e,selectedUnits:r,setSelectedUnits:i,values:t||Uc,units:a}),(0,s.createElement)(Hc,{onClick:()=>o(!n),isLinked:n})))}function Wc(e){return[Kc(e),Zc(e),qc(e),Yc(e)].some(Boolean)}function Kc(e){return e?.border?.color}function Zc(e){return e?.border?.radius}function qc(e){return e?.border?.style}function Yc(e){return e?.border?.width}function Xc({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S.__)("Border"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Ur},r)}const Qc={radius:!0,color:!0,width:!0};function Jc({as:e=Xc,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=Qc}){const a=ei(r),c=e=>{const t=a.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},d=(0,u.useCallback)((e=>{const t=a.flatMap((({colors:e})=>e)).find((({slug:t})=>e==="var:preset|color|"+t));return t?t.color:e}),[a]),p=(0,u.useMemo)((()=>{if((0,ui.__experimentalHasSplitBorders)(o?.border)){const e={...o?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:d(e[t]?.color)}})),e}return{...o?.border,color:o?.border?.color?d(o?.border?.color):void 0}}),[o?.border,d]),m=e=>n({...t,border:e}),h=Kc(r),f=qc(r),g=Yc(r),b=Zc(r),v=(k=p?.radius,$r({settings:r},"",k));var k;const _=e=>m({...p,radius:e}),y=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},w=(0,u.useCallback)((e=>({...e,border:void 0})),[]),E=l?.color||l?.width;return(0,s.createElement)(e,{resetAllFilter:w,value:t,onChange:n,panelId:i},(g||h)&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>(0,ui.__experimentalIsDefinedBorder)(t?.border),label:(0,S.__)("Border"),onDeselect:()=>(()=>{if(y())return m({radius:t?.border?.radius});m(void 0)})(),isShownByDefault:E,panelId:i},(0,s.createElement)(ui.__experimentalBorderBoxControl,{colors:a,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};(0,ui.__experimentalHasSplitBorders)(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:c(t[e]?.color)})})):t&&(t.color=c(t.color)),m({radius:p?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:p,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),b&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:y,label:(0,S.__)("Radius"),onDeselect:()=>_(void 0),isShownByDefault:l.radius,panelId:i},(0,s.createElement)(jc,{values:v,onChange:e=>{_(e||void 0)}})))}const eu="__experimentalBorder",tu=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},nu=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=tu(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return tu(e,"color",n)||{color:n}};function ou(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function ru(e){if((0,ui.__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:ri(o),borderColor:n}}function iu(e){return(0,ui.__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 lu({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=iu(e),o=t(n);return{...e,...ru(o)}}),[t]);return(0,s.createElement)(fs,{group:"border",resetAllFilter:n},e)}function su({clientId:e,name:t,setAttributes:n,settings:o}){const r=Wc(o),{style:i,borderColor:l}=(0,d.useSelect)((function(t){const{style:n,borderColor:o}=t(hr).getBlockAttributes(e)||{};return{style:n,borderColor:o}}),[e]),a=(0,u.useMemo)((()=>iu({style:i,borderColor:l})),[i,l]);if(!r)return null;const p=(0,c.getBlockSupport)(t,[eu,"__experimentalDefaultControls"]);return(0,s.createElement)(Jc,{as:lu,panelId:e,settings:o,value:a,onChange:e=>{n(ru(e))},defaultControls:p})}function au(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,eu);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function cu(e,t,n){if(!au(t,"color")||li(t,eu,"color"))return e;const o=uu(n),r=oi()(e.className,o);return e.className=r||void 0,e}function uu(e){const{borderColor:t,style:n}=e,o=Pc("border-color",t);return oi()({"has-border-color":t||n?.border?.color,[o]:!!o})}var du={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:o}=Mc();if(!au(e,"color")||li(e,eu,"color"))return{};const{color:r}=nu({colors:o,namedColor:t}),{color:i}=nu({colors:o,namedColor:ou(n?.border?.top?.color)}),{color:l}=nu({colors:o,namedColor:ou(n?.border?.right?.color)}),{color:s}=nu({colors:o,namedColor:ou(n?.border?.bottom?.color)}),{color:a}=nu({colors:o,namedColor:ou(n?.border?.left?.color)});return cu({style:ri({borderTopColor:i||r,borderRightColor:l||r,borderBottomColor:s||r,borderLeftColor:a||r})||{}},e,{borderColor:t,style:n})},addSaveProps:cu,attributeKeys:["borderColor","style"],hasSupport(e){return au(e,"color")}};function pu(e){if(e)return`has-${e}-gradient-background`}function mu(e,t){const n=e?.find((e=>e.slug===t));return n&&n.gradient}function hu(e,t){const n=e?.find((e=>e.gradient===t));return n}function fu(e,t){const n=hu(e,t);return n&&n.slug}function gu({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=k(),[o,r,i]=Cr("color.gradients.custom","color.gradients.theme","color.gradients.default"),l=(0,u.useMemo)((()=>[...o||[],...r||[],...i||[]]),[o,r,i]),{gradient:s,customGradient:a}=(0,d.useSelect)((o=>{const{getBlockAttributes:r}=o(hr),i=r(n)||{};return{customGradient:i[t],gradient:i[e]}}),[n,e,t]),{updateBlockAttributes:c}=(0,d.useDispatch)(hr),p=(0,u.useCallback)((o=>{const r=fu(l,o);c(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[l,n,c]),m=pu(s);let h;return h=s?mu(l,s):a,{gradientClass:m,gradientValue:h,setGradient:p}}(0,m.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return au(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));const bu=["colors","disableCustomColors","gradients","disableCustomGradients"],vu={color:"color",gradient:"gradient"};function ku({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,className:i,label:l,onColorChange:a,onGradientChange:c,colorValue:u,gradientValue:d,clearable:p,showTitle:m=!0,enableAlpha:h,headingLevel:f}){const g=a&&(e&&e.length>0||!n),b=c&&(t&&t.length>0||!o);if(!g&&!b)return null;const v={[vu.color]:(0,s.createElement)(ui.ColorPalette,{value:u,onChange:b?e=>{a(e),c()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:p,enableAlpha:h,headingLevel:f}),[vu.gradient]:(0,s.createElement)(ui.GradientPicker,{__nextHasNoMargin:!0,value:d,onChange:g?e=>{c(e),a()}:c,gradients:t,disableCustomGradients:o,__experimentalIsRenderedInSidebar:r,clearable:p,headingLevel:f})},k=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},v[e]),{Tabs:_}=pr(ui.privateApis);return(0,s.createElement)(ui.BaseControl,{__nextHasNoMarginBottom:!0,className:oi()("block-editor-color-gradient-control",i)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(ui.__experimentalVStack,{spacing:1},m&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(ui.BaseControl.VisualLabel,null,l))),g&&b&&(0,s.createElement)("div",null,(0,s.createElement)(_,{initialTabId:d?vu.gradient:!!g&&vu.color},(0,s.createElement)(_.TabList,null,(0,s.createElement)(_.Tab,{tabId:vu.color},(0,S.__)("Solid")),(0,s.createElement)(_.Tab,{tabId:vu.gradient},(0,S.__)("Gradient"))),(0,s.createElement)(_.TabPanel,{tabId:vu.color,className:"block-editor-color-gradient-control__panel",focusable:!1},v.color),(0,s.createElement)(_.TabPanel,{tabId:vu.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1},v.gradient))),!b&&k(vu.color),!g&&k(vu.gradient))))}function _u(e){const[t,n,o,r]=Cr("color.palette","color.gradients","color.custom","color.customGradient");return(0,s.createElement)(ku,{colors:t,gradients:n,disableCustomColors:!o,disableCustomGradients:!r,...e})}var yu=function(e){return bu.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(ku,{...e}):(0,s.createElement)(_u,{...e})};function wu(e){const t=Eu(e),n=Iu(e),o=Su(e),r=xu(e),i=Bu(e),l=Cu(e);return t||n||o||r||i||l}function Eu(e){const t=ei(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Su(e){const t=ei(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Cu(e){const t=ei(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function xu(e){const t=ei(e),n=ti(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Bu(e){const t=ei(e),n=ti(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Iu(e){const t=ei(e),n=ti(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function Tu({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S.__)("Color"),resetAll:()=>{const o=e(n);t(o)},panelId:o,hasInnerWrapper:!0,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Ur},(0,s.createElement)("div",{className:"color-block-support-panel__inner-wrapper"},r))}const Pu={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},Mu={placement:"left-start",offset:36,shift:!0},Ru=({indicators:e,label:t})=>(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ui.__experimentalZStack,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,s.createElement)(ui.Flex,{key:t,expanded:!1},(0,s.createElement)(ui.ColorIndicator,{colorValue:e}))))),(0,s.createElement)(ui.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function Au({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,s.createElement)(yu,{...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 Nu({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:r,tabs:i,colorGradientControlSettings:l,panelId:a}){const c=i.find((e=>void 0!==e.userValue)),{Tabs:u}=pr(ui.privateApis);return(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:a},(0,s.createElement)(ui.Dropdown,{popoverProps:Mu,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:oi()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,S.sprintf)(/* translators: %s is the type of color property, e.g., "background" */
(0,S.__)("Color %s styles"),e)};return(0,s.createElement)(ui.Button,{...o},(0,s.createElement)(Ru,{indicators:r,label:e}))},renderContent:()=>(0,s.createElement)(ui.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===i.length&&(0,s.createElement)(Au,{...i[0],colorGradientControlSettings:l}),i.length>1&&(0,s.createElement)(u,{initialTabId:c?.key},(0,s.createElement)(u.TabList,null,i.map((e=>(0,s.createElement)(u.Tab,{key:e.key,tabId:e.key},e.label)))),i.map((e=>(0,s.createElement)(u.TabPanel,{key:e.key,tabId:e.key,focusable:!1},(0,s.createElement)(Au,{...e,colorGradientControlSettings:l})))))))}))}function Lu({as:e=Tu,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=Pu,children:a}){const c=ei(r),d=ti(r),p=r?.color?.custom,m=r?.color?.customGradient,h=c.length>0||p,f=d.length>0||m,g=e=>$r({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=Iu(r),_=g(o?.color?.background),y=g(t?.color?.background),w=g(o?.color?.gradient),E=g(t?.color?.gradient),C=Su(r),x=g(o?.elements?.link?.color?.text),B=g(t?.elements?.link?.color?.text),I=g(o?.elements?.link?.[":hover"]?.color?.text),T=g(t?.elements?.link?.[":hover"]?.color?.text),P=Eu(r),M=g(o?.color?.text),R=g(t?.color?.text),A=e=>{let o=gr(t,["color","text"],b(e));M===x&&(o=gr(o,["elements","link","color","text"],b(e))),n(o)},N=[{name:"caption",label:(0,S.__)("Captions"),showPanel:Cu(r)},{name:"button",label:(0,S.__)("Button"),showPanel:Bu(r)},{name:"heading",label:(0,S.__)("Heading"),showPanel:xu(r)},{name:"h1",label:(0,S.__)("H1"),showPanel:xu(r)},{name:"h2",label:(0,S.__)("H2"),showPanel:xu(r)},{name:"h3",label:(0,S.__)("H3"),showPanel:xu(r)},{name:"h4",label:(0,S.__)("H4"),showPanel:xu(r)},{name:"h5",label:(0,S.__)("H5"),showPanel:xu(r)},{name:"h6",label:(0,S.__)("H6"),showPanel:xu(r)}],L=(0,u.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...N.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),O=[P&&{key:"text",label:(0,S.__)("Text"),hasValue:()=>!!R,resetValue:()=>A(void 0),isShownByDefault:l.text,indicators:[M],tabs:[{key:"text",label:(0,S.__)("Text"),inheritedValue:M,setValue:A,userValue:R}]},k&&{key:"background",label:(0,S.__)("Background"),hasValue:()=>!!y||!!E,resetValue:()=>{const e=gr(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:l.background,indicators:[null!=w?w:_],tabs:[h&&{key:"background",label:(0,S.__)("Solid"),inheritedValue:_,setValue:e=>{const o=gr(t,["color","background"],b(e));o.color.gradient=void 0,n(o)},userValue:y},f&&{key:"gradient",label:(0,S.__)("Gradient"),inheritedValue:w,setValue:e=>{const o=gr(t,["color","gradient"],v(e));o.color.background=void 0,n(o)},userValue:E,isGradient:!0}].filter(Boolean)},C&&{key:"link",label:(0,S.__)("Link"),hasValue:()=>!!B||!!T,resetValue:()=>{let e=gr(t,["elements","link",":hover","color","text"],void 0);e=gr(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:l.link,indicators:[x,I],tabs:[{key:"link",label:(0,S.__)("Default"),inheritedValue:x,setValue:e=>{n(gr(t,["elements","link","color","text"],b(e)))},userValue:B},{key:"hover",label:(0,S.__)("Hover"),inheritedValue:I,setValue:e=>{n(gr(t,["elements","link",":hover","color","text"],b(e)))},userValue:T}]}].filter(Boolean);return N.forEach((({name:e,label:r,showPanel:i})=>{if(!i)return;const s=g(o?.elements?.[e]?.color?.background),a=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),m="caption"!==e;O.push({key:e,label:r,hasValue:()=>!!(p||u||d),resetValue:()=>{const o=gr(t,["elements",e,"color","background"],void 0);o.elements[e].color.gradient=void 0,o.elements[e].color.text=void 0,n(o)},isShownByDefault:l[e],indicators:m?[c,null!=a?a:s]:[c],tabs:[h&&{key:"text",label:(0,S.__)("Text"),inheritedValue:c,setValue:o=>{n(gr(t,["elements",e,"color","text"],b(o)))},userValue:p},h&&m&&{key:"background",label:(0,S.__)("Background"),inheritedValue:s,setValue:o=>{const r=gr(t,["elements",e,"color","background"],b(o));r.elements[e].color.gradient=void 0,n(r)},userValue:u},f&&m&&{key:"gradient",label:(0,S.__)("Gradient"),inheritedValue:a,setValue:o=>{const r=gr(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:L,value:t,onChange:n,panelId:i},O.map((e=>(0,s.createElement)(Nu,{key:e.key,...e,colorGradientControlSettings:{colors:c,disableCustomColors:!p,gradients:d,disableCustomGradients:!m},panelId:i}))),a)}Ec([Sc,Bc]);var Ou=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:o,fontSize:r,isLargeText:i,textColor:l,linkColor:a,enableAlphaChecker:c=!1}){const u=e||t;if(!u)return null;const d=l||n,p=a||o;if(!d&&!p)return null;const m=[{color:d,description:(0,S.__)("text color")},{color:p,description:(0,S.__)("link color")}],h=yc(u),f=h.alpha()<1,g=h.brightness(),b={level:"AA",size:i||!1!==i&&r>=24?"large":"small"};let v="",k="";for(const e of m){if(!e.color)continue;const t=yc(e.color),n=t.isReadable(h,b),o=t.alpha()<1;if(!n){if(f||o)continue;v=g<t.brightness()?(0,S.sprintf)(
// translators: %s is a type of text color, e.g., "text color" or "link color".
(0,S.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,S.sprintf)(
// translators: %s is a type of text color, e.g., "text color" or "link color".
(0,S.__)("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,S.__)("This color combination may be hard for people to read.");break}o&&c&&(v=(0,S.__)("Transparent text may be hard for people to read."),k=(0,S.__)("Transparent text may be hard for people to read."))}return v?((0,Zn.speak)(k),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(ui.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},v))):null};const Du=(0,u.createContext)({refs:new Map,callbacks:new Map});function zu({children:e}){const t=(0,u.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Du.Provider,{value:t},e)}function Fu(e){const{refs:t,callbacks:n}=(0,u.useContext)(Du),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 Vu(e){const{refs:t}=(0,u.useContext)(Du),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 Hu(e){const{callbacks:t}=(0,u.useContext)(Du),n=Vu(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 Uu(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Gu({clientId:e}){const[t,n]=(0,u.useState)(),[o,r]=(0,u.useState)(),[i,l]=(0,u.useState)(),a=Vu(e);return(0,u.useEffect)((()=>{if(!a.current)return;r(Uu(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&l(Uu(e).color);let t=a.current,o=Uu(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,o=Uu(t).backgroundColor;n(o)})),(0,s.createElement)(Ou,{backgroundColor:t,textColor:o,enableAlphaChecker:!0,linkColor:i})}const $u="color",ju=e=>{const t=(0,c.getBlockSupport)(e,$u);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Wu=e=>{if("web"!==u.Platform.OS)return!1;const t=(0,c.getBlockSupport)(e,$u);return null!==t&&"object"==typeof t&&!!t.link},Ku=e=>{const t=(0,c.getBlockSupport)(e,$u);return null!==t&&"object"==typeof t&&!!t.gradients},Zu=e=>{const t=(0,c.getBlockSupport)(e,$u);return t&&!1!==t.background},qu=e=>{const t=(0,c.getBlockSupport)(e,$u);return t&&!1!==t.text};function Yu(e,t,n){if(!ju(t)||li(t,$u))return e;const o=Ku(t),{backgroundColor:r,textColor:i,gradient:l,style:s}=n,a=e=>!li(t,$u,e),c=a("text")?Pc("color",i):void 0,u=a("gradients")?pu(l):void 0,d=a("background")?Pc("background-color",r):void 0,p=a("background")||a("gradients"),m=r||s?.color?.background||o&&(l||s?.color?.gradient),h=oi()(e.className,c,u,{[d]:!(o&&s?.color?.gradient||!d),"has-text-color":a("text")&&(i||s?.color?.text),"has-background":p&&m,"has-link-color":a("link")&&s?.elements?.link?.color});return e.className=h||void 0,e}function Xu(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,i=e?.color?.gradient,l=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,s={...e};return s.color={...s.color,text:n?void 0:t,background:r?void 0:o,gradient:l?void 0:i},{style:ri(s),textColor:n,backgroundColor:r,gradient:l}}function Qu(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 Ju({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=Qu(e),o=t(n);return{...e,...Xu(o)}}),[t]);return(0,s.createElement)(fs,{group:"color",resetAllFilter:n},e)}function ed({clientId:e,name:t,setAttributes:n,settings:o}){const r=wu(o),{style:i,textColor:l,backgroundColor:a,gradient:p}=(0,d.useSelect)((function(t){const{style:n,textColor:o,backgroundColor:r,gradient:i}=t(hr).getBlockAttributes(e)||{};return{style:n,textColor:o,backgroundColor:r,gradient:i}}),[e]),m=(0,u.useMemo)((()=>Qu({style:i,textColor:l,backgroundColor:a,gradient:p})),[i,l,a,p]);if(!r)return null;const h=(0,c.getBlockSupport)(t,[$u,"__experimentalDefaultControls"]),f="web"===u.Platform.OS&&!m?.color?.gradient&&(o?.color?.text||o?.color?.link)&&!1!==(0,c.getBlockSupport)(t,[$u,"enableContrastChecker"]);return(0,s.createElement)(Lu,{as:Ju,panelId:e,settings:o,value:m,onChange:e=>{n(Xu(e))},defaultControls:h,enableContrastChecker:!1!==(0,c.getBlockSupport)(t,[$u,"enableContrastChecker"])},f&&(0,s.createElement)(Gu,{clientId:e}))}var td={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:o,style:r}){const[i,l,s]=Cr("color.palette.custom","color.palette.theme","color.palette.default"),a=(0,u.useMemo)((()=>[...i||[],...l||[],...s||[]]),[i,l,s]);if(!ju(e)||li(e,$u))return{};const c={};n&&!li(e,$u,"text")&&(c.color=Ic(a,n)?.color),t&&!li(e,$u,"background")&&(c.backgroundColor=Ic(a,t)?.color);const d=Yu({style:c},e,{textColor:n,backgroundColor:t,gradient:o,style:r}),p=t||r?.color?.background||o||r?.color?.gradient;return{...d,className:oi()(d.className,!p&&ja(r))}},addSaveProps:Yu,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:ju};const nd={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function od({value:e="",onChange:t,fontFamilies:n,...o}){const[r]=Cr("typography.fontFamilies");if(n||(n=r),!n||0===n.length)return null;const i=[{value:"",label:(0,S.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,s.createElement)(ui.SelectControl,{label:(0,S.__)("Font"),options:i,value:e,onChange:t,labelPosition:"top",...o})}(0,m.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return ju(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Ku(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 ii({linkColor:Wu(r),textColor:qu(r),backgroundColor:Zu(r),gradient:Ku(r)},nd,e,t,n,o)}));const rd=[{name:(0,S._x)("Regular","font style"),value:"normal"},{name:(0,S._x)("Italic","font style"),value:"italic"}],id=[{name:(0,S._x)("Thin","font weight"),value:"100"},{name:(0,S._x)("Extra Light","font weight"),value:"200"},{name:(0,S._x)("Light","font weight"),value:"300"},{name:(0,S._x)("Regular","font weight"),value:"400"},{name:(0,S._x)("Medium","font weight"),value:"500"},{name:(0,S._x)("Semi Bold","font weight"),value:"600"},{name:(0,S._x)("Bold","font weight"),value:"700"},{name:(0,S._x)("Extra Bold","font weight"),value:"800"},{name:(0,S._x)("Black","font weight"),value:"900"}],ld=(e,t)=>e?t?(0,S.__)("Appearance"):(0,S.__)("Font style"):(0,S.__)("Font weight");function sd(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:i},...l}=e,a=n||o,c=ld(n,o),d={key:"default",name:(0,S.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},p=(0,u.useMemo)((()=>n&&o?(()=>{const e=[d];return rd.forEach((({name:t,value:n})=>{id.forEach((({name:o,value:r})=>{const i="normal"===n?o:(0,S.sprintf)(/* translators: 1: Font weight name. 2: Font style name. */
(0,S.__)("%1$s %2$s"),o,t);e.push({key:`${n}-${r}`,name:i,style:{fontStyle:n,fontWeight:r}})}))})),e})():n?(()=>{const e=[d];return rd.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[d];return id.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===i))||p[0];return a&&(0,s.createElement)(ui.CustomSelectControl,{...l,className:"components-font-appearance-control",label:c,describedBy:m?n?o?(0,S.sprintf)(
// translators: %s: Currently selected font appearance.
(0,S.__)("Currently selected font appearance: %s"),m.name):(0,S.sprintf)(
// translators: %s: Currently selected font style.
(0,S.__)("Currently selected font style: %s"),m.name):(0,S.sprintf)(
// translators: %s: Currently selected font weight.
(0,S.__)("Currently selected font weight: %s"),m.name):(0,S.__)("No selected font appearance"),options:p,value:m,onChange:({selectedItem:e})=>t(e.style),__nextUnconstrainedWidth:!0})}var ad=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:o="60px",...r})=>{const i=function(e){return void 0!==e&&""!==e}(e),l=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},a=i?e:"";n||y()("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)(ui.__experimentalNumberControl,{...r,__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),o=l(e.value,n);return{...e,value:o}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(l(`${e}`,!1)):t()},label:(0,S.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"}))};function cd({value:e,onChange:t,__unstableInputWidth:n="60px",...o}){const[r]=Cr("spacing.units"),i=(0,ui.__experimentalUseCustomUnits)({availableUnits:r||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(ui.__experimentalUnitControl,{...o,label:(0,S.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:i,onChange:t})}var ud=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M7 11.5h10V13H7z"})),dd=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),pd=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),md=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 hd=[{name:(0,S.__)("None"),value:"none",icon:ud},{name:(0,S.__)("Uppercase"),value:"uppercase",icon:dd},{name:(0,S.__)("Lowercase"),value:"lowercase",icon:pd},{name:(0,S.__)("Capitalize"),value:"capitalize",icon:md}];function fd({className:e,value:t,onChange:n}){return(0,s.createElement)("fieldset",{className:oi()("block-editor-text-transform-control",e)},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},(0,S.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},hd.map((e=>(0,s.createElement)(ui.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}var gd=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),bd=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 vd=[{name:(0,S.__)("None"),value:"none",icon:ud},{name:(0,S.__)("Underline"),value:"underline",icon:gd},{name:(0,S.__)("Strikethrough"),value:"line-through",icon:bd}];function kd({value:e,onChange:t,className:n}){return(0,s.createElement)("fieldset",{className:oi()("block-editor-text-decoration-control",n)},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},(0,S.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},vd.map((n=>(0,s.createElement)(ui.Button,{key:n.value,icon:n.icon,label:n.name,isPressed:n.value===e,onClick:()=>{t(n.value===e?void 0:n.value)}})))))}var _d=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),yd=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 wd=[{name:(0,S.__)("Horizontal"),value:"horizontal-tb",icon:_d},{name:(0,S.__)("Vertical"),value:(0,S.isRTL)()?"vertical-lr":"vertical-rl",icon:yd}];function Ed({className:e,value:t,onChange:n}){return(0,s.createElement)("fieldset",{className:oi()("block-editor-writing-mode-control",e)},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},(0,S.__)("Orientation")),(0,s.createElement)("div",{className:"block-editor-writing-mode-control__buttons"},wd.map((e=>(0,s.createElement)(ui.Button,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const Sd=1,Cd=6;function xd(e){const t=Id(e),n=Td(e),o=Pd(e),r=Md(e),i=Rd(e),l=Ad(e),s=Nd(e),a=Ld(e),c=Bd(e);return t||n||o||r||i||c||l||s||a}function Bd(e){return Sr(e?.typography?.fontSizes)||e?.typography?.customFontSize}function Id(e){return Sr(e?.typography?.fontFamilies)}function Td(e){return e?.typography?.lineHeight}function Pd(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function Md(e){return e?.typography?.letterSpacing}function Rd(e){return e?.typography?.textTransform}function Ad(e){return e?.typography?.textDecoration}function Nd(e){return e?.typography?.writingMode}function Ld(e){return e?.typography?.textColumns}function Od({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S.__)("Typography"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Ur},r)}const Dd={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function zd({as:e=Od,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=Dd}){const a=e=>$r({settings:r},"",e),c=Id(r),d=r?.typography?.fontFamilies,p=d?wr(d):[],m=a(o?.typography?.fontFamily),h=e=>{const o=p?.find((({fontFamily:t})=>t===e))?.slug;n(gr(t,["typography","fontFamily"],o?`var:preset|font-family|${o}`:e||void 0))},f=Bd(r),g=!r?.typography?.customFontSize,b=function(e){const t=e?.typography?.fontSizes,n=t?wr(t):[],o=[];for(const e of n)o.some((({slug:t})=>t===e.slug))||o.push(e);return o}(r),v=a(o?.typography?.fontSize),k=(e,o)=>{n(gr(t,["typography","fontSize"],(o?.slug?`var:preset|font-size|${o?.slug}`:e)||void 0))},_=Pd(r),y=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,S.__)("Appearance"):(0,S.__)("Font style"):(0,S.__)("Font weight")}(r),w=r?.typography?.fontStyle,E=r?.typography?.fontWeight,C=a(o?.typography?.fontStyle),x=a(o?.typography?.fontWeight),B=({fontStyle:e,fontWeight:o})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:o||void 0}})},I=Td(r),T=a(o?.typography?.lineHeight),P=e=>{n(gr(t,["typography","lineHeight"],e||void 0))},M=Md(r),R=a(o?.typography?.letterSpacing),A=e=>{n(gr(t,["typography","letterSpacing"],e||void 0))},N=Ld(r),L=a(o?.typography?.textColumns),O=e=>{n(gr(t,["typography","textColumns"],e||void 0))},D=Rd(r),z=a(o?.typography?.textTransform),F=e=>{n(gr(t,["typography","textTransform"],e||void 0))},V=Ad(r),H=a(o?.typography?.textDecoration),U=e=>{n(gr(t,["typography","textDecoration"],e||void 0))},G=Nd(r),$=a(o?.typography?.writingMode),j=e=>{n(gr(t,["typography","writingMode"],e||void 0))},W=(0,u.useCallback)((e=>({...e,typography:{}})),[]);return(0,s.createElement)(e,{resetAllFilter:W,value:t,onChange:n,panelId:i},c&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Font family"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:l.fontFamily,panelId:i},(0,s.createElement)(od,{fontFamilies:p,value:m,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})),f&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Font size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>k(void 0),isShownByDefault:l.fontSize,panelId:i},(0,s.createElement)(ui.FontSizePicker,{value:v,onChange:k,fontSizes:b,disableCustomFontSizes:g,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),_&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:y,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{B({})},isShownByDefault:l.fontAppearance,panelId:i},(0,s.createElement)(sd,{value:{fontStyle:C,fontWeight:x},onChange:B,hasFontStyles:w,hasFontWeights:E,size:"__unstable-large",__nextHasNoMarginBottom:!0})),I&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>P(void 0),isShownByDefault:l.lineHeight,panelId:i},(0,s.createElement)(ad,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:T,onChange:P,size:"__unstable-large"})),M&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>A(void 0),isShownByDefault:l.letterSpacing,panelId:i},(0,s.createElement)(cd,{value:R,onChange:A,size:"__unstable-large",__unstableInputWidth:"auto"})),N&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Text columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>O(void 0),isShownByDefault:l.textColumns,panelId:i},(0,s.createElement)(ui.__experimentalNumberControl,{label:(0,S.__)("Text columns"),max:Cd,min:Sd,onChange:O,size:"__unstable-large",spinControls:"custom",value:L,initialPosition:1})),V&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Text decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>U(void 0),isShownByDefault:l.textDecoration,panelId:i},(0,s.createElement)(kd,{value:H,onChange:U,size:"__unstable-large",__unstableInputWidth:"auto"})),G&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Text orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>j(void 0),isShownByDefault:l.writingMode,panelId:i},(0,s.createElement)(Ed,{value:$,onChange:j,size:"__unstable-large",__nextHasNoMarginBottom:!0})),D&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>F(void 0),isShownByDefault:l.textTransform,panelId:i},(0,s.createElement)(fd,{value:z,onChange:F,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}var Fd=window.wp.tokenList,Vd=n.n(Fd);const Hd="typography.__experimentalFontFamily";function Ud(e,t,n){if(!(0,c.hasBlockSupport)(t,Hd))return e;if(li(t,Qd,"fontFamily"))return e;if(!n?.fontFamily)return e;const o=new(Vd())(e.className),{kebabCase:r}=pr(ui.privateApis);o.add(`has-${r(n?.fontFamily)}-font-family`);const i=o.value;return e.className=i||void 0,e}var Gd={useBlockProps:function({name:e,fontFamily:t}){return Ud({},e,{fontFamily:t})},addSaveProps:Ud,attributeKeys:["fontFamily"],hasSupport(e){return(0,c.hasBlockSupport)(e,Hd)}};(0,m.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,c.hasBlockSupport)(e,Hd)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const $d=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function jd(e,t){const n=e?.find((({size:e})=>e===t));return n||{size:t}}function Wd(e){if(!e)return;const{kebabCase:t}=pr(ui.privateApis);return`has-${t(e)}-font-size`}const Kd="typography.fontSize";function Zd(e,t,n){if(!(0,c.hasBlockSupport)(t,Kd))return e;if(li(t,Qd,"fontSize"))return e;const o=new(Vd())(e.className);o.add(Wd(n.fontSize));const r=o.value;return e.className=r||void 0,e}var qd={useBlockProps:function({name:e,fontSize:t,style:n}){const[o]=Cr("typography.fontSizes");if(!(0,c.hasBlockSupport)(e,Kd)||li(e,Qd,"fontSize")||!t)return;let r={};n?.typography?.fontSize||(r={style:{fontSize:$d(o,t,n?.typography?.fontSize).size}});const i=zr((0,d.select)(hr).getSettings().__experimentalFeatures);return t&&(r={style:{fontSize:Or({size:t},i)}}),Zd(r,e,{fontSize:t})},addSaveProps:Zd,attributeKeys:["fontSize","style"],hasSupport(e){return(0,c.hasBlockSupport)(e,Kd)}};const Yd={fontSize:[["fontSize"],["style","typography","fontSize"]]};function Xd(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,Kd)?(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 ii({fontSize:(0,c.hasBlockSupport)(r,Kd)},Yd,e,t,n,o)}));const Qd="typography",Jd=["typography.lineHeight",Kd,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",Hd,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function ep(e){const t={...Xd(e,["fontFamily"])},n=e?.typography?.fontSize,o=e?.typography?.fontFamily,r=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=o?.startsWith("var:preset|font-family|")?o.substring(23):void 0;return t.typography={...Xd(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:ri(t),fontFamily:i,fontSize:r}}function tp(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 np({children:e,resetAllFilter:t}){const n=(0,u.useCallback)((e=>{const n=tp(e),o=t(n);return{...e,...ep(o)}}),[t]);return(0,s.createElement)(fs,{group:"typography",resetAllFilter:n},e)}function op({clientId:e,name:t,setAttributes:n,settings:o}){const{style:r,fontFamily:i,fontSize:l}=(0,d.useSelect)((function(t){const{style:n,fontFamily:o,fontSize:r}=t(hr).getBlockAttributes(e)||{};return{style:n,fontFamily:o,fontSize:r}}),[e]),a=xd(o),p=(0,u.useMemo)((()=>tp({style:r,fontFamily:i,fontSize:l})),[r,l,i]);if(!a)return null;const m=(0,c.getBlockSupport)(t,[Qd,"__experimentalDefaultControls"]);return(0,s.createElement)(zd,{as:np,panelId:e,settings:o,value:p,onChange:e=>{n(ep(e))},defaultControls:m})}var rp=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.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 ip={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 lp({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:l=!0,side:a,spacingSizes:c,type:m,value:h}){var f,g;h=Gi(h,c);let b=c;const v=c.length<=8,k=(0,d.useSelect)((e=>{const t=e(hr).getSettings();return t?.disableCustomSpacingSizes})),[_,y]=(0,u.useState)(!k&&void 0!==h&&!Hi(h)),w=(0,p.usePrevious)(h);h&&w!==h&&!Hi(h)&&!0!==_&&y(!0);const[E]=Cr("spacing.units"),C=(0,ui.__experimentalUseCustomUnits)({availableUnits:E||["px","em","rem"]});let x=null;v||_||void 0===h||!(!Hi(h)||Hi(h)&&t)?t||(x=_?Ui(h,c):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":ji(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(h,c)):(b=[...c,{name:t?(0,S.__)("Mixed"):
// translators: A custom measurement, eg. a number followed by a unit like 12px.
(0,S.sprintf)((0,S.__)("Custom (%s)"),h),slug:"custom",size:h}],x=b.length-1);const B=(0,u.useMemo)((()=>(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(x)),[x])[1]||C[0]?.value,I=parseFloat(x,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}`},P=t?(0,S.__)("Mixed"):null,M=b.map(((e,t)=>({key:t,name:e.name}))),R=c.map(((e,t)=>({value:t,label:void 0}))),A=Oi.includes(a)&&l?Fi[a]:"",N=l?m?.toLowerCase():m,L=(0,S.sprintf)(
// translators: 1: The side of the block being modified (top, bottom, left, All sides etc.). 2. Type of spacing being modified (Padding, margin, etc)
(0,S.__)("%1$s %2$s"),A,N).trim();return(0,s.createElement)(ui.__experimentalHStack,{className:"spacing-sizes-control__wrapper"},e&&(0,s.createElement)(ui.Icon,{className:"spacing-sizes-control__icon",icon:e,size:24}),_&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.__experimentalUnitControl,{onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,onChange:e=>o((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:x,units:C,min:n,placeholder:P,disableUnits:t,label:L,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,s.createElement)(ui.RangeControl,{onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r,value:I,min:0,max:null!==(f=ip[B]?.max)&&void 0!==f?f:10,step:null!==(g=ip[B]?.steps)&&void 0!==g?g:.1,withInputField:!1,onChange:e=>{o([e,B].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),v&&!_&&(0,s.createElement)(ui.RangeControl,{onMouseOver:i,onMouseOut:r,className:"spacing-sizes-control__range-control",value:x,onChange:e=>o(T(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===h&&o("0")},withInputField:!1,"aria-valuenow":x,"aria-valuetext":c[x]?.name,renderTooltipContent:e=>void 0===h?void 0:c[e]?.name,min:0,max:c.length-1,marks:R,label:L,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:r}),!v&&!_&&(0,s.createElement)(ui.CustomSelectControl,{className:"spacing-sizes-control__custom-select-control",value:M.find((e=>e.key===x))||"",onChange:e=>{o(T(e.selectedItem.key,"selectList"))},options:M,label:L,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:r,onFocus:i,onBlur:r}),!k&&(0,s.createElement)(ui.Button,{label:_?(0,S.__)("Use size preset"):(0,S.__)("Set custom size"),icon:rp,onClick:()=>{y(!_)},isPressed:_,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24}))}const sp=["vertical","horizontal"];function ap({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:l,values:a}){const c=e=>n=>{if(!t)return;const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Gi(a[t],i),e)),{})};"vertical"===e&&(o.top=n,o.bottom=n),"horizontal"===e&&(o.left=n,o.right=n),t(o)},u=r?.length?sp.filter((e=>Wi(r,e))):sp;return(0,s.createElement)(s.Fragment,null,u.map((t=>{const r="vertical"===t?a.top:a.left;return(0,s.createElement)(lp,{key:`spacing-sizes-control-${t}`,icon:zi[t],label:Fi[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:l,value:r,withInputField:!1})})))}function cp({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,sides:r,spacingSizes:i,type:l,values:a}){const c=r?.length?Oi.filter((e=>r.includes(e))):Oi,u=e=>n=>{const o={...Object.keys(a).reduce(((e,t)=>(e[t]=Gi(a[t],i),e)),{})};o[e]=n,t(o)};return(0,s.createElement)(s.Fragment,null,c.map((t=>(0,s.createElement)(lp,{key:`spacing-sizes-control-${t}`,icon:zi[t],label:Fi[t],minimumCustomValue:e,onChange:u(t),onMouseOut:n,onMouseOver:o,side:t,spacingSizes:i,type:l,value:a[t],withInputField:!1}))))}function up({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:l,type:a,values:c}){return(0,s.createElement)(lp,{label:Fi[i],minimumCustomValue:e,onChange:(u=i,e=>{const n={...Object.keys(c).reduce(((e,t)=>(e[t]=Gi(c[t],l),e)),{})};n[u]=e,t(n)}),onMouseOut:n,onMouseOver:o,showSideInLabel:r,side:i,spacingSizes:l,type:a,value:c[i],withInputField:!1});var u}var dp=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));const pp=(0,s.createElement)(ui.Icon,{icon:dp,size:24});function mp({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=Wi(e,"horizontal"),o=Wi(e,"vertical");n&&o?t.axial={label:Fi.axial,icon:zi.axial}:n?t.axial={label:Fi.horizontal,icon:zi.horizontal}:o&&(t.axial={label:Fi.vertical,icon:zi.vertical});let r=0;return Oi.forEach((n=>{e.includes(n)&&(r+=1,t[n]={label:Fi[n],icon:zi[n]})})),r>1&&(t.custom={label:Fi.custom,icon:zi.custom}),t}(n),i=r[o].icon,{custom:l,...a}=r;return(0,s.createElement)(ui.DropdownMenu,{icon:i,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{isSmall:!0}},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuGroup,null,Object.entries(a).map((([n,{label:r,icon:i}])=>{const l=o===n;return(0,s.createElement)(ui.MenuItem,{key:n,icon:i,iconPosition:"left",isSelected:l,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:l?pp:void 0},r)}))),!!l&&(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(ui.MenuItem,{icon:l.icon,iconPosition:"left",isSelected:o===Vi.custom,role:"menuitemradio",onClick:()=>{t(Vi.custom),e()},suffix:o===Vi.custom?pp:void 0},l.label)))))}function hp({inputProps:e,label:t,minimumCustomValue:n=0,onChange:o,onMouseOut:r,onMouseOver:i,showSideInLabel:l=!0,sides:a=Oi,useSelect:c,values:d}){const p=function(){const e=[{name:0,slug:"0",size:0}],[t]=Cr("spacing.spacingSizes");return t&&e.push(...t),e.length>8&&e.unshift({name:(0,S.__)("Default"),slug:"default",size:void 0}),e}(),m=d||Di,h=1===a?.length,f=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[g,b]=(0,u.useState)(function(e={},t){const{top:n,right:o,bottom:r,left:i}=e,l=[n,o,r,i].filter(Boolean),s=!(n!==r||i!==o||!n&&!i),a=!l.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(Wi(t)&&(s||a))return Vi.axial;if(1===l.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||l.length?Vi.custom:t[0]}(m,a)),v={...e,minimumCustomValue:n,onChange:e=>{const t={...d,...e};o(t)},onMouseOut:r,onMouseOver:i,sides:a,spacingSizes:p,type:t,useSelect:c,values:m},k=Oi.includes(g)&&l?Fi[g]:"",_=(0,S.sprintf)(
// translators: 2. Type of spacing being modified (Padding, margin, etc). 1: The side of the block being modified (top, bottom, left etc.).
(0,S.__)("%1$s %2$s"),t,k).trim(),y=(0,S.sprintf)(
// translators: %s: The current spacing property e.g. "Padding", "Margin".
(0,S._x)("%s options","Button label to reveal side configuration options"),t);return(0,s.createElement)("fieldset",{className:"spacing-sizes-control"},(0,s.createElement)(ui.__experimentalHStack,{className:"spacing-sizes-control__header"},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label"},_),!h&&!f&&(0,s.createElement)(mp,{label:y,onChange:b,sides:a,value:g})),g===Vi.axial?(0,s.createElement)(ap,{...v}):g===Vi.custom?(0,s.createElement)(cp,{...v}):(0,s.createElement)(up,{side:g,...v,showSideInLabel:l}))}const fp={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 gp({label:e=(0,S.__)("Height"),onChange:t,value:n}){var o,r;const i=parseFloat(n),[l]=Cr("spacing.units"),a=(0,ui.__experimentalUseCustomUnits)({availableUnits:l||["%","px","em","rem","vh","vw"]}),c=(0,u.useMemo)((()=>(0,ui.__experimentalParseQuantityAndUnitFromRawValue)(n)),[n])[1]||a[0]?.value||"px";return(0,s.createElement)("fieldset",{className:"block-editor-height-control"},(0,s.createElement)(ui.BaseControl.VisualLabel,{as:"legend"},e),(0,s.createElement)(ui.Flex,null,(0,s.createElement)(ui.FlexItem,{isBlock:!0},(0,s.createElement)(ui.__experimentalUnitControl,{value:n,units:a,onChange:t,onUnitChange:e=>{const[o,r]=(0,ui.__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)(ui.FlexItem,{isBlock:!0},(0,s.createElement)(ui.__experimentalSpacer,{marginX:2,marginBottom:0},(0,s.createElement)(ui.RangeControl,{value:i,min:0,max:null!==(o=fp[c]?.max)&&void 0!==o?o:100,step:null!==(r=fp[c]?.step)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{t([e,c].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})))))}function bp(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,S.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,S.__)("Specify a fixed width."):"fixed"===e?(0,S.__)("Specify a fixed height."):(0,S.__)("Fit contents.")}function vp({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)(ui.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:kp(n),value:o||"fit",help:bp(o,n),onChange:n=>{const o="fixed"!==n?null:r;t({...e,selfStretch:n,flexSize:o})},isBlock:!0},(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"fit",value:"fit",label:(0,S.__)("Fit")}),(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"fill",value:"fill",label:(0,S.__)("Fill")}),(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:"fixed",value:"fixed",label:(0,S.__)("Fixed")})),"fixed"===o&&(0,s.createElement)(ui.__experimentalUnitControl,{size:"__unstable-large",onChange:n=>{t({...e,flexSize:n})},value:r}))}function kp(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,S.__)("Width"):(0,S.__)("Height")}const _p=["horizontal","vertical"];function yp(e){const t=wp(e),n=Ep(e),o=Sp(e),r=Cp(e),i=xp(e),l=Bp(e),s=Ip(e);return"web"===u.Platform.OS&&(t||n||o||r||i||l||s)}function wp(e){return e?.layout?.contentSize}function Ep(e){return e?.layout?.wideSize}function Sp(e){return e?.spacing?.padding}function Cp(e){return e?.spacing?.margin}function xp(e){return e?.spacing?.blockGap}function Bp(e){return e?.dimensions?.minHeight}function Ip(e){var t;const{type:n="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===o||"flex"===n)&&r;return!!e?.layout&&i}function Tp(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 Pp(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function Mp({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S.__)("Dimensions"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Ur},r)}const Rp={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,childLayout:!0};function Ap({as:e=Mp,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=Rp,onVisualize:a=(()=>{}),includeLayoutControls:c=!1}){var d,p,m,h,f,g,b,v;const{dimensions:k,spacing:_}=r,y=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=$r({settings:{dimensions:k,spacing:_}},"",e[n]),t)),{}):$r({settings:{dimensions:k,spacing:_}},"",e),w=function(e){var t,n;const{custom:o,theme:r,default:i}=e?.spacing?.spacingSizes||{};return(null!==(t=null!==(n=null!=o?o:r)&&void 0!==n?n:i)&&void 0!==t?t:[]).length>0}(r),E=(0,ui.__experimentalUseCustomUnits)({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),C=wp(r)&&c,x=y(o?.layout?.contentSize),B=e=>{n(gr(t,["layout","contentSize"],e||void 0))},I=Ep(r)&&c,T=y(o?.layout?.wideSize),P=e=>{n(gr(t,["layout","wideSize"],e||void 0))},M=Sp(r),R=Pp(y(o?.spacing?.padding)),A=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,N=A&&A.some((e=>_p.includes(e))),L=e=>{const o=Tp(e,A);n(gr(t,["spacing","padding"],o))},O=()=>a("padding"),D=Cp(r),z=Pp(y(o?.spacing?.margin)),F=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,V=F&&F.some((e=>_p.includes(e))),H=e=>{const o=Tp(e,F);n(gr(t,["spacing","margin"],o))},U=()=>a("margin"),G=xp(r),$=y(o?.spacing?.blockGap),j=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}($),W=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,K=W&&W.some((e=>_p.includes(e))),Z=e=>{n(gr(t,["spacing","blockGap"],e))},q=e=>{e||Z(null),!K&&e?.hasOwnProperty("top")?Z(e.top):Z({top:e?.top,left:e?.left})},Y=Bp(r),X=y(o?.dimensions?.minHeight),Q=e=>{n(gr(t,["dimensions","minHeight"],e))},J=Ip(r),ee=o?.layout,{orientation:te="horizontal"}=null!==(d=r?.parentLayout)&&void 0!==d?d:{},ne="horizontal"===te?(0,S.__)("Width"):(0,S.__)("Height"),oe=e=>{n({...t,layout:{...t?.layout,...e}})},re=(0,u.useCallback)((e=>({...e,layout:ri({...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,s.createElement)(e,{resetAllFilter:re,value:t,onChange:n,panelId:i},(C||I)&&(0,s.createElement)("span",{className:"span-columns"},(0,S.__)("Set the width of the main content area.")),C&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>B(void 0),isShownByDefault:null!==(p=l.contentSize)&&void 0!==p?p:Rp.contentSize,panelId:i},(0,s.createElement)(ui.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(ui.__experimentalUnitControl,{label:(0,S.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:x||"",onChange:e=>{B(e)},units:E}),(0,s.createElement)(ui.__experimentalView,null,(0,s.createElement)(kl,{icon:_l})))),I&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{className:"single-column",label:(0,S.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>P(void 0),isShownByDefault:null!==(m=l.wideSize)&&void 0!==m?m:Rp.wideSize,panelId:i},(0,s.createElement)(ui.__experimentalHStack,{alignment:"flex-end",justify:"flex-start"},(0,s.createElement)(ui.__experimentalUnitControl,{label:(0,S.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:T||"",onChange:e=>{P(e)},units:E}),(0,s.createElement)(ui.__experimentalView,null,(0,s.createElement)(kl,{icon:yl})))),M&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,S.__)("Padding"),onDeselect:()=>L(void 0),isShownByDefault:null!==(h=l.padding)&&void 0!==h?h:Rp.padding,className:oi()({"tools-panel-item-spacing":w}),panelId:i},!w&&(0,s.createElement)(ui.__experimentalBoxControl,{values:R,onChange:L,label:(0,S.__)("Padding"),sides:A,units:E,allowReset:!1,splitOnAxis:N,onMouseOver:O,onMouseOut:ie}),w&&(0,s.createElement)(hp,{values:R,onChange:L,label:(0,S.__)("Padding"),sides:A,units:E,allowReset:!1,onMouseOver:O,onMouseOut:ie})),D&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,S.__)("Margin"),onDeselect:()=>H(void 0),isShownByDefault:null!==(f=l.margin)&&void 0!==f?f:Rp.margin,className:oi()({"tools-panel-item-spacing":w}),panelId:i},!w&&(0,s.createElement)(ui.__experimentalBoxControl,{values:z,onChange:H,label:(0,S.__)("Margin"),sides:F,units:E,allowReset:!1,splitOnAxis:V,onMouseOver:U,onMouseOut:ie}),w&&(0,s.createElement)(hp,{values:z,onChange:H,label:(0,S.__)("Margin"),sides:F,units:E,allowReset:!1,onMouseOver:U,onMouseOut:ie})),G&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,S.__)("Block spacing"),onDeselect:()=>Z(void 0),isShownByDefault:null!==(g=l.blockGap)&&void 0!==g?g:Rp.blockGap,className:oi()({"tools-panel-item-spacing":w}),panelId:i},!w&&(K?(0,s.createElement)(ui.__experimentalBoxControl,{label:(0,S.__)("Block spacing"),min:0,onChange:q,units:E,sides:W,values:j,allowReset:!1,splitOnAxis:K}):(0,s.createElement)(ui.__experimentalUnitControl,{label:(0,S.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:Z,units:E,value:$})),w&&(0,s.createElement)(hp,{label:(0,S.__)("Block spacing"),min:0,onChange:q,showSideInLabel:!1,sides:K?W:["top"],values:j,allowReset:!1})),Y&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,S.__)("Minimum height"),onDeselect:()=>{Q(void 0)},isShownByDefault:null!==(b=l.minHeight)&&void 0!==b?b:Rp.minHeight,panelId:i},(0,s.createElement)(gp,{label:(0,S.__)("Minimum height"),value:X,onChange:Q})),J&&(0,s.createElement)(ui.__experimentalVStack,{as:ui.__experimentalToolsPanelItem,spacing:2,hasValue:()=>!!t?.layout,label:ne,onDeselect:()=>{oe({selfStretch:void 0,flexSize:void 0})},isShownByDefault:null!==(v=l.childLayout)&&void 0!==v?v:Rp.childLayout,panelId:i},(0,s.createElement)(vp,{value:ee,onChange:oe,parentLayout:r?.parentLayout})))}var Np=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 Lp=Number.MAX_SAFE_INTEGER;var Op=(0,u.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstableRefreshSize:o,__unstableCoverTarget:r=!1,__unstablePopoverSlot:i,__unstableContentRef:l,shift:a=!0,...c},d){const m=Hu(e),h=Hu(null!=t?t:e),f=(0,p.useMergeRefs)([d,Np(l)]),[g,b]=(0,u.useReducer)((e=>(e+1)%Lp),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)((()=>g<0||!m||h!==m?{}:{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}),[m,h,o,g]),k=(0,u.useMemo)((()=>{if(!(g<0||!m||t&&!h))return{getBoundingClientRect(){var e,t,n,o;const r=m.getBoundingClientRect(),i=h?.getBoundingClientRect(),l=Math.min(r.left,null!==(e=i?.left)&&void 0!==e?e:1/0),s=Math.min(r.top,null!==(t=i?.top)&&void 0!==t?t:1/0),a=Math.max(r.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-l,c=Math.max(r.bottom,null!==(o=i.bottom)&&void 0!==o?o:-1/0)-s;return new window.DOMRect(l,s,a,c)},contextElement:m}}),[t,h,m,g]);return!m||t&&!h?null:(0,s.createElement)(ui.Popover,{ref:f,animate:!1,focusOnMount:!1,anchor:k,__unstableSlotName:i,inline:!i,placement:"top-start",resize:!1,flip:!1,shift:a,...c,className:oi()("block-editor-block-popover",c.className),variant:"unstyled"},r&&(0,s.createElement)("div",{style:v},n),!r&&n)}));function Dp(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function zp({clientId:e,attributes:t,forceShow:n}){const o=Hu(e),[r,i]=(0,u.useState)(),l=t?.style?.spacing?.margin;(0,u.useEffect)((()=>{if(!o||null===o.ownerDocument.defaultView)return;const e=Dp(o,"margin-top"),t=Dp(o,"margin-right"),n=Dp(o,"margin-bottom"),r=Dp(o,"margin-left");i({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,l]);const[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(l),p=(0,u.useRef)();return(0,u.useEffect)((()=>(As()(l,d.current)||n||(c(!0),d.current=l,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[l,n]),a||n?(0,s.createElement)(Op,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}function Fp(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Vp({clientId:e,value:t,forceShow:n}){const o=Hu(e),[r,i]=(0,u.useState)(),l=t?.spacing?.padding;(0,u.useEffect)((()=>{o&&null!==o.ownerDocument.defaultView&&i({borderTopWidth:Fp(o,"padding-top"),borderRightWidth:Fp(o,"padding-right"),borderBottomWidth:Fp(o,"padding-bottom"),borderLeftWidth:Fp(o,"padding-left")})}),[o,l]);const[a,c]=(0,u.useState)(!1),d=(0,u.useRef)(l),p=(0,u.useRef)();return(0,u.useEffect)((()=>(As()(l,d.current)||n||(c(!0),d.current=l,p.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),p.current&&window.clearTimeout(p.current)})),[l,n]),a||n?(0,s.createElement)(Op,{clientId:e,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:r})):null}const Hp="dimensions",Up="spacing";function Gp({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)(fs,{group:"dimensions",resetAllFilter:n},e)}function $p({clientId:e,name:t,setAttributes:n,settings:o}){const r=yp(o),i=(0,d.useSelect)((t=>t(hr).getBlockAttributes(e)?.style),[e]),[l,a]=function(){const[e,t]=(0,u.useState)(!1),{hideBlockInterface:n,showBlockInterface:o}=pr((0,d.useDispatch)(hr));return(0,u.useEffect)((()=>{e?n():o()}),[e,o,n]),[e,t]}();if(!r)return null;const p={...(0,c.getBlockSupport)(t,[Hp,"__experimentalDefaultControls"]),...(0,c.getBlockSupport)(t,[Up,"__experimentalDefaultControls"])};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ap,{as:Gp,panelId:e,settings:o,value:i,onChange:e=>{n({style:ri(e)})},defaultControls:p,onVisualize:a}),!!o?.spacing?.padding&&(0,s.createElement)(Vp,{forceShow:"padding"===l,clientId:e,value:i}),!!o?.spacing?.margin&&(0,s.createElement)(zp,{forceShow:"margin"===l,clientId:e,value:i}))}function jp(){y()("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}const Wp=[...Jd,eu,$u,Hp,Va,Up],Kp=e=>Wp.some((t=>(0,c.hasBlockSupport)(e,t)));function Zp(e={}){const t={};return(0,wl.getCSSRules)(e).forEach((e=>{t[e.key]=e.value})),t}const qp={[`${eu}.__experimentalSkipSerialization`]:["border"],[`${$u}.__experimentalSkipSerialization`]:[$u],[`${Qd}.__experimentalSkipSerialization`]:[Qd],[`${Hp}.__experimentalSkipSerialization`]:[Hp],[`${Up}.__experimentalSkipSerialization`]:[Up]},Yp={...qp,[`${Va}`]:[Va]},Xp={[`${Va}`]:!0},Qp={gradients:"gradient"};function Jp(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;Jp(o[t],[n],!0)}else 1===e.length&&delete o[e[0]]})),o}function em(e,t,n,o=Yp){if(!Kp(t))return e;let{style:r}=n;return Object.entries(o).forEach((([e,n])=>{const o=Xp[e]||(0,c.getBlockSupport)(t,e);!0===o&&(r=Jp(r,n)),Array.isArray(o)&&o.forEach((e=>{const t=Qp[e]||e;r=Jp(r,[[...n,t]])}))})),e.style={...Zp(r),...e.style},e}var tm={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:o}){const r={clientId:e,name:t,setAttributes:n,settings:ai(t,o)};return"default"!==Wl()?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ed,{...r}),(0,s.createElement)(qa,{...r}),(0,s.createElement)(op,{...r}),(0,s.createElement)(su,{...r}),(0,s.createElement)($p,{...r}))},hasSupport:Kp,addSaveProps:em,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const o=`wp-elements-${(0,p.useInstanceId)(e)}`,r=`.editor-styles-wrapper .${o}`,i=n?.elements,l=(0,u.useMemo)((()=>{if(!i)return;const e=[];return nm.forEach((({elementType:n,pseudo:o,elements:l})=>{if(li(t,$u,n))return;const s=i?.[n];if(s){const t=jr(r,c.__EXPERIMENTAL_ELEMENTS[n]);e.push((0,wl.compileCSS)(s,{selector:t})),o&&o.forEach((t=>{s[t]&&e.push((0,wl.compileCSS)(s[t],{selector:jr(r,`${c.__EXPERIMENTAL_ELEMENTS[n]}${t}`)}))}))}l&&l.forEach((t=>{i[t]&&e.push((0,wl.compileCSS)(i[t],{selector:jr(r,c.__EXPERIMENTAL_ELEMENTS[t])}))}))})),e.length>0?e.join(""):void 0}),[r,i,t]);return si({css:l}),em({className:o},t,{style:n},qp)}};const nm=[{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 Kp(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}));var om=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),rm=function e({id:t,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:l,onChange:a}){let c;c="unset"===l?(0,s.createElement)(ui.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):l?(0,s.createElement)(ui.DuotoneSwatch,{values:l}):(0,s.createElement)(kl,{icon:om});const u=(0,S.__)("Apply duotone filter"),d=`${(0,p.useInstanceId)(e,"duotone-control",t)}__description`;return(0,s.createElement)(ui.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,S.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(ui.ToolbarButton,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==xs.DOWN||(n.preventDefault(),t())},label:u,icon:c}),renderContent:()=>(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Duotone")},(0,s.createElement)("p",null,(0,S.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(ui.DuotonePicker,{"aria-label":u,"aria-describedby":d,colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:i,value:l,onChange:a}))})};function im(e){return`${e}{filter:none}`}function lm(e,t){return`${e}{filter:url(#${t})}`}function sm(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=yc(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 am(e,t="root",n={}){if(!t)return null;const{fallback:o=!1}=n,{name:r,selectors:i,supports:l}=e,s=i&&Object.keys(i).length>0,a=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&i.root?i?.root:l?.__experimentalSelector?l.__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 br(i,`${a}.root`,null)||br(i,a,null)||e;const t=br(l,`${a}.__experimentalSelector`,null);return t?jr(c,t):e}let d;return s&&(d=br(i,a,null)),d||(o?am(e,u[0],n):null)}const cm=[];function um(e,{presetSetting:t,defaultSetting:n}){const o=!e?.color?.[n],r=e?.color?.[t]?.custom||cm,i=e?.color?.[t]?.theme||cm,l=e?.color?.[t]?.default||cm;return(0,u.useMemo)((()=>[...r,...i,...o?cm:l]),[o,r,i,l])}function dm(e){return pm(e)}function pm(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function mm({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Ur},r)}const hm={duotone:!0},fm={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,S.__)("Duotone")},gm=({indicator:e,label:t})=>(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ui.__experimentalZStack,{isLayered:!1,offset:-8},(0,s.createElement)(ui.Flex,{expanded:!1},"unset"!==e&&e?(0,s.createElement)(ui.DuotoneSwatch,{values:e}):(0,s.createElement)(ui.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}))),(0,s.createElement)(ui.FlexItem,{title:t},t));function bm({as:e=mm,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=hm}){const a=pm(r),c=um(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=um(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),p=(m=o?.filter?.duotone,$r({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(gr(t,["filter","duotone"],r))},f=(0,u.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,s.createElement)(e,{resetAllFilter:f,value:t,onChange:n,panelId:i},a&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:l.duotone,panelId:i},(0,s.createElement)(ui.Dropdown,{popoverProps:fm,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:oi()({"is-open":t}),"aria-expanded":t};return(0,s.createElement)(ui.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(ui.Button,{...n},(0,s.createElement)(gm,{indicator:p,label:(0,S.__)("Duotone")})))},renderContent:()=>(0,s.createElement)(ui.__experimentalDropdownContentWrapper,{paddingSize:"small"},(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Duotone")},(0,s.createElement)("p",null,(0,S.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(ui.DuotonePicker,{colorPalette:d,duotonePalette:c,disableCustomColors:!0,disableCustomDuotone:!0,value:p,onChange:h})))})))}const vm=[],km=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function _m({presetSetting:e,defaultSetting:t}){const[n,o,r,i]=Cr(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,u.useMemo)((()=>[...o||vm,...r||vm,...n&&i||vm]),[n,o,r,i])}function ym(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}Ec([Sc]);var wm={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const o=e?.color?.duotone,r=ai(n),i=Wl(),l=_m({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=_m({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=Cr("color.custom","color.customDuotone"),d=!c,p=!u||0===a?.length&&d;if(0===l?.length&&p)return null;if("default"!==i)return null;const m=Array.isArray(o)?o:ym(o,l);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fs,{group:"filter"},(0,s.createElement)(bm,{value:{filter:{duotone:m}},onChange:n=>{const o={...e,color:{...n?.filter}};t({style:o})},settings:r})),(0,s.createElement)(bi,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(rm,{duotonePalette:l,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,l),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=am(e);return"string"==typeof t?jr(n,t):n}return am(e,"filter.duotone",{fallback:!0})}}),[t]),i=n?.color?.duotone,l=`wp-duotone-${o}`,s=r&&i;return function({clientId:e,id:t,selector:n,attribute:o}){const r=_m({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(o),l=i?void 0:ym(o,r),s="string"==typeof o&&l;let a=null;s?a=l:("string"==typeof o&&!s||i)&&(a=o);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),d=Array.isArray(a)||"unset"===a;si(d?{css:"unset"!==a?lm(c,t):im(c),__unstableType:"presets"}:void 0),si(d?{assets:"unset"!==a?sm(t,a):"",__unstableType:"svgs"}:void 0);const p=Hu(e);(0,u.useEffect)((()=>{if(d&&p&&km){const e=p.style.display;p.style.display="inline-block",p.offsetHeight,p.style.display=e}}),[d,p])}({clientId:o,id:l,selector:r,attribute:i}),{className:s?l:""}},attributeKeys:["style"],hasSupport(e){return(0,c.hasBlockSupport)(e,"filter.duotone")}};function Em(e){return(0,d.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t(hr),{getBlockType:i,getActiveBlockVariation:l}=t(c.store),s=n(e),a=i(s);if(!a)return null;const u=o(e),d=l(s,u),p=(0,c.isReusableBlock)(a),m=(p?r(u.ref):void 0)||a.title,h=p||(0,c.isTemplatePart)(a),f=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,S.__)("Sticky"):"fixed"===t?(0,S.__)("Fixed"):null}(u),g={isSynced:h,title:m,icon:a.icon,description:a.description,anchor:u?.anchor,positionLabel:f,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:f,positionType:u?.style?.position?.type,name:u?.metadata?.name}:g}),[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:Sm}=pr(ui.privateApis),Cm="position",xm="block-editor-hooks__position-selection__select-control__option",Bm={key:"default",value:"",name:(0,S.__)("Default"),className:xm},Im={key:"sticky",value:"sticky",name:(0,S._x)("Sticky","Name for the value of the CSS position property"),className:xm,__experimentalHint:(0,S.__)("The block will stick to the top of the window instead of scrolling.")},Tm={key:"fixed",value:"fixed",name:(0,S._x)("Fixed","Name for the value of the CSS position property"),className:xm,__experimentalHint:(0,S.__)("The block will not move when the page is scrolled.")},Pm=["top","right","bottom","left"],Mm=["sticky","fixed"];function Rm(e){const t=e.style?.position?.type;return"sticky"===t||"fixed"===t}function Am({name:e}={}){const[t,n]=Cr("position.fixed","position.sticky"),o=!t&&!n;return r=e,!(0,c.getBlockSupport)(r,Cm)||o;var r}function Nm({style:e={},clientId:t,name:n,setAttributes:o}){const r=function(e){const t=(0,c.getBlockSupport)(e,Cm);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=(0,c.getBlockSupport)(e,Cm);return!(!0!==t&&!t?.sticky)}(n),l=e?.position?.type,{firstParentClientId:a}=(0,d.useSelect)((e=>{const{getBlockParents:n}=e(hr),o=n(t);return{firstParentClientId:o[o.length-1]}}),[t]),p=Em(a),m=i&&l===Im.value&&p?(0,S.sprintf)(/* translators: %s: the name of the parent block. */
(0,S.__)("The block will stick to the scrollable area of the parent %s block."),p.title):null,h=(0,u.useMemo)((()=>{const e=[Bm];return(i||l===Im.value)&&e.push(Im),(r||l===Tm.value)&&e.push(Tm),e}),[r,i,l]),f=l&&h.find((e=>e.value===l))||Bm;return u.Platform.select({web:h.length>1?(0,s.createElement)(fs,{group:"position"},(0,s.createElement)(ui.BaseControl,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:m},(0,s.createElement)(Sm,{__nextUnconstrainedWidth:!0,__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,S.__)("Position"),hideLabelFromVision:!0,describedBy:(0,S.sprintf)(
// translators: %s: Currently selected position.
(0,S.__)("Currently selected position: %s"),f.name),options:h,value:f,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};o({style:ri(n)})})(t.value)},size:"__unstable-large"}))):null,native:null})}var Lm={edit:function(e){return Am(e)?null:(0,s.createElement)(Nm,{...e})},useBlockProps:function e({name:t,style:n}){const o=(0,c.hasBlockSupport)(t,Cm),r=Am({name:t}),i=o&&!r,l=(0,p.useInstanceId)(e);let s;i&&(s=function({selector:e,style:t}){let n="";const{type:o}=t?.position||{};return Mm.includes(o)?(n+=`${e} {`,n+=`position: ${o};`,Pm.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-${l}.wp-container-${l}`,style:n})||"");const a=oi()({[`wp-container-${l}`]:i&&!!s,[`is-position-${n?.position?.type}`]:i&&!!s&&!!n?.position?.type});return si({css:s}),{className:a}},attributeKeys:["style"],hasSupport(e){return(0,c.hasBlockSupport)(e,Cm)}};const Om="layout";function Dm(e){return(0,c.hasBlockSupport)(e,"layout")||(0,c.hasBlockSupport)(e,"__experimentalLayout")}function zm(e={},t=""){const{kebabCase:n}=pr(ui.privateApis),o=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return t().__experimentalFeatures?.useRootPaddingAwareAlignments}),[]),{layout:r}=e,{default:i}=(0,c.getBlockSupport)(t,Om)||{},l=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||i||{},s=[];if(Ci[l?.type||"default"]?.className){const e=Ci[l?.type||"default"]?.className,n=t.split("/"),o=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;s.push(e,o)}return(l?.inherit||l?.contentSize||"constrained"===l?.type)&&o&&s.push("has-global-padding"),l?.orientation&&s.push(`is-${n(l.orientation)}`),l?.justifyContent&&s.push(`is-content-justification-${n(l.justifyContent)}`),l?.flexWrap&&"nowrap"===l.flexWrap&&s.push("is-nowrap"),s}var Fm={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n}){const o=ai(n),{layout:r}=o,[i]=Cr("layout"),{themeSupportsLayout:l}=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==Wl())return null;const a=(0,c.getBlockSupport)(n,Om,{}),u={...r,...a},{allowSwitching:p,allowEditing:m=!0,allowInheriting:h=!0,default:f}=u;if(!m)return null;const g=!(!h||!i||e?.type&&"default"!==e?.type&&"constrained"!==e?.type&&!e?.inherit),b=e||f||{},{inherit:v=!1,type:k="default",contentSize:_=null}=b;if(("default"===k||"constrained"===k)&&!l)return null;const y=Tl(k),w=Tl("constrained"),E=!b.type&&(_||v),C=!!v||!!_,x=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fs,null,(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Layout")},g&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,S.__)("Inner blocks use content width"),checked:"constrained"===y?.name||C,onChange:()=>t({layout:{type:"constrained"===y?.name||C?"default":"constrained"}}),help:"constrained"===y?.name||C?(0,S.__)("Nested blocks use content width with options for full and wide widths."):(0,S.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!v&&p&&(0,s.createElement)(Vm,{type:k,onChange:e=>t({layout:{type:e}})}),y&&"default"!==y.name&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:x,layoutBlockSupport:u}),w&&E&&(0,s.createElement)(w.inspectorControls,{layout:b,onChange:x,layoutBlockSupport:u}))),!v&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:x,layoutBlockSupport:a}))},attributeKeys:["layout"],hasSupport(e){return Dm(e)}};function Vm({type:e,onChange:t}){return(0,s.createElement)(ui.ButtonGroup,null,Il.map((({name:n,label:o})=>(0,s.createElement)(ui.Button,{key:n,isPressed:e===n,onClick:()=>t(n)},o))))}function Hm({block:e,props:t}){const{name:n,attributes:o}=t,r=(0,p.useInstanceId)(e),{layout:i}=o,{default:l}=(0,c.getBlockSupport)(n,Om)||{},a=i?.inherit||i?.contentSize||i?.wideSize?{...i,type:"constrained"}:i||l||{},u=zm(o,n),{kebabCase:d}=pr(ui.privateApis),m=`wp-container-${d(n)}-is-layout-`,h=`.${m}${r}.${m}${r}`,[f]=Cr("spacing.blockGap"),g=null!==f,b=Tl(a?.type||"default"),v=b?.getLayoutStyle?.({blockName:n,selector:h,layout:a,style:o?.style,hasBlockGapSupport:g}),k=oi()({[`${m}${r}`]:!!v},u);return si({css:v}),(0,s.createElement)(e,{...t,__unstableLayoutClassNames:k})}const Um=(0,p.createHigherOrderComponent)((e=>t=>{const n=Dm(t.name);return(0,d.useSelect)((e=>!!n&&!e(hr).getSettings().disableLayoutStyles),[n])?(0,s.createElement)(Hm,{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:{})||Dm(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,m.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Um);var Gm={useBlockProps:function e({style:t}){var n;const o=(0,d.useSelect)((e=>!e(hr).getSettings().disableLayoutStyles)),r=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:i,flexSize:l}=r,s=(0,p.useInstanceId)(e),a=`.wp-container-content-${s}`;let c="";if(o&&("fixed"===i&&l?c=`${a} {\n\t\t\t\tflex-basis: ${l};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i&&(c=`${a} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`)),si({css:c}),c)return{className:`wp-container-content-${s}`}},attributeKeys:["style"],hasSupport(){return!0}};function $m(e){return(0,d.useSelect)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:o,isUngroupable:r,isGroupable:i}=t(hr),{getGroupingBlockName:l,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:i(a),isUngroupable:p,blocksSelection:u,groupingBlockName:l(),onUngroup:p&&s(d.name)?.transforms?.ungroup}}),[e])}function jm({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:o,blocksSelection:r,groupingBlockName:i,onClose:l=(()=>{})}){const{replaceBlocks:a}=(0,d.useDispatch)(hr);return t||n?(0,s.createElement)(s.Fragment,null,t&&(0,s.createElement)(ui.MenuItem,{onClick:()=>{(()=>{const t=(0,c.switchToBlockType)(r,i);t&&a(e,t)})(),l()}},(0,S._x)("Group","verb")),n&&(0,s.createElement)(ui.MenuItem,{onClick:()=>{(()=>{let t=r[0].innerBlocks;t.length&&(o&&(t=o(r[0].attributes,r[0].innerBlocks)),a(e,t))})(),l()}},(0,S._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor "))):null}function Wm(e){return(0,d.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:i,getBlockName:l,getBlockRootClientId:s,getTemplateLock:a}=t(hr),c=s(e),u=n(e),d=o(e,c),p=r(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(l(e)),isContentLocked:"contentOnly"===a(e),isLocked:!u||!d||!p}}),[e])}var Km=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),Zm=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),qm=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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 Ym=["core/block","core/navigation"];function Xm(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Qm({clientId:e,onClose:t}){const[n,o]=(0,u.useState)({move:!1,remove:!1}),{canEdit:r,canMove:i,canRemove:l}=Wm(e),{allowsEditLocking:a,templateLock:m,hasTemplateLock:h}=(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(hr),r=n(e),i=(0,c.getBlockType)(r);return{allowsEditLocking:Ym.includes(r),templateLock:o(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[f,g]=(0,u.useState)(!!m),{updateBlockAttributes:b}=(0,d.useDispatch)(hr),v=Em(e),k=(0,p.useInstanceId)(Qm,"block-editor-block-lock-modal__options-title");(0,u.useEffect)((()=>{o({move:!i,remove:!l,...a?{edit:!r}:{}})}),[r,i,l,a]);const _=Object.values(n).every(Boolean),y=Object.values(n).some(Boolean)&&!_;return(0,s.createElement)(ui.Modal,{title:(0,S.sprintf)(/* translators: %s: Name of the block. */
(0,S.__)("Lock %s"),v.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t},(0,s.createElement)("p",null,(0,S.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:o=>{o.preventDefault(),b([e],{lock:n,templateLock:f?Xm(n):void 0}),t()}},(0,s.createElement)("div",{role:"group","aria-labelledby":k,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(ui.CheckboxControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:k},(0,S.__)("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)(ui.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Restrict editing"),checked:!!n.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,s.createElement)(ui.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?qm:Km})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(ui.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Disable movement"),checked:n.move,onChange:e=>o((t=>({...t,move:e})))}),(0,s.createElement)(ui.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?qm:Km})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(ui.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Prevent removal"),checked:n.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,s.createElement)(ui.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?qm:Km}))),h&&(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,S.__)("Apply to all blocks inside"),checked:f,disabled:n.move&&!n.remove,onChange:()=>g(!f)})),(0,s.createElement)(ui.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:t},(0,S.__)("Cancel"))),(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(ui.Button,{variant:"primary",type:"submit"},(0,S.__)("Apply"))))))}function Jm({clientId:e}){const{canLock:t,isLocked:n}=Wm(e),[o,r]=(0,u.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,S.__)("Unlock"):(0,S.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuItem,{icon:n?Km:Zm,onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"},i),o&&(0,s.createElement)(Qm,{clientId:e,onClose:r}))}const eh=()=>{};var th=(0,p.compose)([(0,d.withSelect)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:o,getSettings:r}=e(hr),i=n(t),l=r().codeEditingEnabled;return{mode:o(t),blockType:i?(0,c.getBlockType)(i.name):null,isCodeEditingEnabled:l}})),(0,d.withDispatch)(((e,{onToggle:t=eh,clientId:n})=>({onToggleMode(){e(hr).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 i="visual"===t?(0,S.__)("Edit as HTML"):(0,S.__)("Edit visually");return(0,s.createElement)(ui.MenuItem,{onClick:n},!o&&i)}));function nh(e){return 0===e?.trim()?.length}function oh({blockName:e,originalBlockName:t,onClose:n,onSave:o}){const[r,i]=(0,u.useState)(e),l=r!==e,a=r===t,c=nh(r),d=l||a,m=(0,p.useInstanceId)(oh,"block-editor-rename-modal__description");return(0,s.createElement)(ui.Modal,{title:(0,S.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",aria:{describedby:m},focusOnMount:"firstContentElement"},(0,s.createElement)("p",{id:m},(0,S.__)("Enter a custom name for this block.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=a||c?(0,S.sprintf)(/* translators: %s: new name/label for the block */
(0,S.__)('Block name reset to: "%s".'),r):(0,S.sprintf)(/* translators: %s: new name/label for the block */
(0,S.__)('Block name changed to: "%s".'),r);(0,Zn.speak)(e,"assertive"),o(r),n()})()}},(0,s.createElement)(ui.__experimentalVStack,{spacing:"3"},(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:r,label:(0,S.__)("Block name"),hideLabelFromVision:!0,placeholder:t,onChange:i,onFocus:e=>e.target.select()}),(0,s.createElement)(ui.__experimentalHStack,{justify:"right"},(0,s.createElement)(ui.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n},(0,S.__)("Cancel")),(0,s.createElement)(ui.Button,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit"},(0,S.__)("Save"))))))}function rh({clientId:e}){const[t,n]=(0,u.useState)(!1),{metadata:o}=(0,d.useSelect)((t=>{const{getBlockAttributes:n}=t(hr),o=n(e)?.metadata;return{metadata:o}}),[e]),{updateBlockAttributes:r}=(0,d.useDispatch)(hr),i=o?.name,l=Em(e);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog"},(0,S.__)("Rename")),t&&(0,s.createElement)(oh,{blockName:i||"",originalBlockName:l?.title,onClose:()=>n(!1),onSave:t=>{(t===l?.title||nh(t))&&(t=void 0),function(t){r([e],{metadata:{...o&&o,name:t}})}(t)}}))}const{Fill:ih,Slot:lh}=(0,ui.createSlotFill)("BlockSettingsMenuControls");function sh({...e}){return(0,s.createElement)(ui.__experimentalStyleProvider,{document:document},(0,s.createElement)(ih,{...e}))}sh.Slot=({fillProps:e,clientIds:t=null,__unstableDisplayLocation:n})=>{const{selectedBlocks:o,selectedClientIds:r}=(0,d.useSelect)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:o}=e(hr),r=null!==t?t:o();return{selectedBlocks:n(r),selectedClientIds:r}}),[t]),{canLock:i}=Wm(r[0]),{canRename:l}=(a=o[0],{canRename:(0,c.getBlockSupport)(a,"renaming",!0)});var a;const u=1===r.length&&i,m=1===r.length&&l,h=$m(r),{isGroupable:f,isUngroupable:g}=h,b=f||g;return(0,s.createElement)(lh,{fillProps:{...e,__unstableDisplayLocation:n,selectedBlocks:o,selectedClientIds:r}},(t=>!t?.length>0&&!b&&!u?null:(0,s.createElement)(ui.MenuGroup,null,b&&(0,s.createElement)(jm,{...h,onClose:e?.onClose}),u&&(0,s.createElement)(Jm,{clientId:r[0]}),m&&(0,s.createElement)(rh,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&(0,s.createElement)(ui.MenuItem,{onClick:(0,p.pipe)(e?.onClose,e?.onMoveTo)},(0,S.__)("Move to")),1===e?.count&&(0,s.createElement)(th,{clientId:e?.firstBlockClientId,onToggle:e?.onClose}))))};var ah=sh;function ch({clientId:e,stopEditingAsBlock:t}){const n=(0,d.useSelect)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:o}=t(hr);return n(e)||o(e,!0)}),[e]);return(0,u.useEffect)((()=>{n||t()}),[n,t]),null}var uh={edit:function({clientId:e,isSelected:t}){const{getBlockListSettings:n,getSettings:o}=(0,d.useSelect)(hr),r=(0,u.useRef)(),{templateLock:i,isLockedByParent:l,isEditingAsBlocks:a}=(0,d.useSelect)((t=>{const{__unstableGetContentLockingParent:n,getTemplateLock:o,__unstableGetTemporarilyEditingAsBlocks:r}=t(hr);return{templateLock:o(e),isLockedByParent:!!n(e),isEditingAsBlocks:r()===e}}),[e]),{updateSettings:c,updateBlockListSettings:p,__unstableSetTemporarilyEditingAsBlocks:m}=(0,d.useDispatch)(hr),h=!l&&"contentOnly"===i,{__unstableMarkNextChangeAsNotPersistent:f,updateBlockAttributes:g}=(0,d.useDispatch)(hr),b=(0,u.useCallback)((()=>{f(),g(e,{templateLock:"contentOnly"}),p(e,{...n(e),templateLock:"contentOnly"}),c({focusMode:r.current}),m()}),[e,c,p,n,f,g,m]);if(!h&&!a)return null;const v=a&&!h,k=!a&&h&&t;return(0,s.createElement)(s.Fragment,null,v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ch,{clientId:e,stopEditingAsBlock:b}),(0,s.createElement)(bi,{group:"other"},(0,s.createElement)(ui.ToolbarButton,{onClick:()=>{b()}},(0,S.__)("Done")))),k&&(0,s.createElement)(ah,null,(({onClose:t})=>(0,s.createElement)(ui.MenuItem,{onClick:()=>{f(),g(e,{templateLock:void 0}),p(e,{...n(e),templateLock:!1}),r.current=o().focusMode,c({focusMode:!0}),m(e),t()}},(0,S.__)("Modify")))))},hasSupport(){return!0}};const dh="metadata";(0,m.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[dh]?.type||(e.attributes={...e.attributes,[dh]:{type:"object"}}),e}));var ph={edit:function({name:e,connections:t,setAttributes:n}){if("default"!==Wl())return null;let o;return"core/paragraph"===e&&(o="content"),"core/image"===e&&(o="url"),(0,s.createElement)(fs,null,(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Connections"),initialOpen:!0},(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,S.__)("Custom field meta_key"),value:t?.attributes?.[o]?.value||"",onChange:e=>{n(""===e?{connections:void 0,[o]:void 0,placeholder:void 0}:{connections:{attributes:{[o]:{source:"meta_fields",value:e}}},[o]:void 0,placeholder:(0,S.sprintf)('This content will be replaced on the frontend by the value of "%s" custom field.',e)})}})))},attributeKeys:["connections"],hasSupport(e){return(0,c.hasBlockSupport)(e,"__experimentalConnections",!1)&&["core/paragraph","core/image"].includes(e)}};(window.__experimentalConnections||window.__experimentalPatternPartialSyncing)&&(0,m.addFilter)("blocks.registerBlockType","core/editor/connections/attribute",(function(e){return(0,c.hasBlockSupport)(e,"__experimentalConnections",!0)&&(e.attributes={...e.attributes,connections:{type:"object"}}),e}));var mh=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),hh=(0,u.memo)((function({icon:e,showColors:t=!1,className:n,context:o}){"block-default"===e?.src&&(e={src:mh});const r=(0,s.createElement)(ui.Icon,{icon:e&&e.src?e.src:e,context:o}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,s.createElement)("span",{style:i,className:oi()("block-editor-block-icon",n,{"has-colors":t})},r)}));const fh={};var gh,bh={edit:function({name:e,clientId:t}){const n=(0,d.useSelect)((e=>e(c.store).getBlockTypes()),[]),o=(0,u.useMemo)((()=>n?.filter((({blockHooks:t})=>t&&e in t))),[n,e]),{blockIndex:r,rootClientId:i,innerBlocksLength:l}=(0,d.useSelect)((e=>{const{getBlock:n,getBlockIndex:o,getBlockRootClientId:r}=e(hr);return{blockIndex:o(t),innerBlocksLength:n(t)?.innerBlocks?.length,rootClientId:r(t)}}),[t]),a=(0,d.useSelect)((n=>{const{getBlock:r,getGlobalBlockCount:l}=n(hr),s=o.reduce(((n,o)=>{if(0===l(o.name))return n;const s=o?.blockHooks?.[e];let a;switch(s){case"before":case"after":a=r(i)?.innerBlocks;break;case"first_child":case"last_child":a=r(t).innerBlocks}const c=a?.find((t=>e===t.name));return c?{...n,[o.name]:c.clientId}:{...n,[o.name]:!1}}),{});return Object.values(s).length>0?s:fh}),[o,e,t,i]),{insertBlock:p,removeBlock:m}=(0,d.useDispatch)(hr),h=o?.filter((e=>!1!==a?.[e.name]));if(!h.length)return null;const f=o.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,s.createElement)(fs,null,(0,s.createElement)(ui.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,S.__)("Plugins"),initialOpen:!0},Object.keys(f).map((n=>(0,s.createElement)(u.Fragment,{key:n},(0,s.createElement)("h3",null,n),f[n].map((n=>{const o=n.name in a;return(0,s.createElement)(ui.ToggleControl,{checked:o,key:n.title,label:(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(hh,{icon:n.icon}),(0,s.createElement)("span",null,n.title)),onChange:()=>{if(o)m(a[n.name],!1);else{const o=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":p(e,"after"===n?r+1:r,i,!1);break;case"first_child":case"last_child":p(e,"first_child"===n?0:l,t,!1)}})((0,c.createBlock)(n.name),o)}}})})))))))},hasSupport(){return!0}},vh={edit:function({metadata:e,setAttributes:t}){return(0,s.createElement)(fs,{group:"advanced"},(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,S.__)("Block name"),value:e?.name||"",onChange:n=>{t({metadata:{...e,name:n}})}}))},attributeKeys:["metadata"],hasSupport(e){return(0,c.hasBlockSupport)(e,"renaming",!0)}};function kh(e){const t=e.style?.border||{};return{className:uu(e)||void 0,style:Zp({border:t})}}function _h(e){const{colors:t}=Mc(),n=kh(e),{borderColor:o}=e;if(o){const e=nu({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function yh(e){const{backgroundColor:t,textColor:n,gradient:o,style:r}=e,i=Pc("background-color",t),l=Pc("color",n),s=pu(o),a=s||r?.color?.gradient;return{className:oi()(l,s,{[i]:!a&&!!i,"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:Zp({color:r?.color||{}})}}function wh(e){const{backgroundColor:t,textColor:n,gradient:o}=e,[r,i,l,s,a,c]=Cr("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,u.useMemo)((()=>[...r||[],...i||[],...l||[]]),[r,i,l]),p=(0,u.useMemo)((()=>[...s||[],...a||[],...c||[]]),[s,a,c]),m=yh(e);if(t){const e=Ic(d,t);m.style.backgroundColor=e.color}if(o&&(m.style.background=mu(p,o)),n){const e=Ic(d,n);m.style.color=e.color}return m}function Eh(e){const{style:t}=e;return{style:Zp({spacing:t?.spacing||{}})}}function Sh(e,t){const{kebabCase:n}=pr(ui.privateApis);let o=e?.style?.typography||{};const r=zr(t);o={...o,fontSize:Or({size:e?.style?.typography?.fontSize},r)};const i=Zp({typography:o}),l=e?.fontFamily?`has-${n(e.fontFamily)}-font-family`:"";return{className:oi()(l,Wd(e?.fontSize)),style:i}}function Ch(e){const[t,n]=(0,u.useState)(e);return(0,u.useEffect)((()=>{e&&n(e)}),[e]),t}(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})),function(e){e=e.map((e=>({...e,Edit:(0,p.pure)(e.edit)})));const t=(0,p.createHigherOrderComponent)((t=>n=>{const o=k();return[...e.map(((e,t)=>{const{Edit:r,hasSupport:i,attributeKeys:l=[],shareWithChildBlocks:a}=e;if(!(o[h]||o[f]&&a)||!i(n.name))return null;const c={};for(const e of l)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)}([Yl,vs,ys,tm,wm,Lm,Fm,uh,window.__experimentalConnections?ph:null,bh,vh].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:i=[],useBlockProps:l}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return Object.keys(a).length&&o(n.name)?(0,s.createElement)(ci,{key:t,index:t,useBlockProps:l,setAllWrapperProps:r,name:n.name,...a}):null})),(0,s.createElement)(t,{key:"edit",...n,wrapperProps:o.filter(Boolean).reduce(((e,t)=>({...e,...t,className:oi()(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})})]}),"withBlockListBlockHooks");(0,m.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([Yl,tm,td,wm,Gd,qd,du,Lm,Gm]),gh=[Yl,vs,_s,ys,du,td,tm,Gd,qd],(0,m.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return gh.reduce(((e,o)=>{const{hasSupport:r,attributeKeys:i=[],addSaveProps:l}=o,s={};for(const e of i)n[e]&&(s[e]=n[e]);return Object.keys(s).length&&r(t)?l(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 xh=([e,...t])=>e.toUpperCase()+t.join(""),Bh=e=>(0,p.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,{...n,colors:e})),"withCustomColorPalette"),Ih=()=>(0,p.createHigherOrderComponent)((e=>t=>{const[n,o,r]=Cr("color.palette.custom","color.palette.theme","color.palette.default"),i=(0,u.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,{...t,colors:i})}),"withEditorColorPalette");function Th(e,t){const{kebabCase:n}=pr(ui.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=yc(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=xh(t),o=`custom${n}`;return e[`set${n}`]=this.createSetColor(t,o),e}),{})}createSetColor(e,t){return n=>{const o=Tc(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,i])=>{const l=Ic(t,e[r],e[`custom${xh(r)}`]),s=n[r],a=s?.color;return a===l.color&&s?o[r]=s:o[r]={...l,class:Pc(i,l.slug)},o}),{})}render(){return(0,s.createElement)(e,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function Ph(e){return(...t)=>{const n=Bh(e);return(0,p.createHigherOrderComponent)(Th(t,n),"withCustomColors")}}function Mh(...e){const t=Ih();return(0,p.createHigherOrderComponent)(Th(e,t),"withColors")}var Rh=function(e){const[t,n]=Cr("typography.fontSizes","typography.customFontSize");return(0,s.createElement)(ui.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!n})};const Ah=[],Nh=([e,...t])=>e.toUpperCase()+t.join("");var Lh=(...e)=>{const t=e.reduce(((e,t)=>(e[t]=`custom${Nh(t)}`,e)),{});return(0,p.createHigherOrderComponent)((0,p.compose)([(0,p.createHigherOrderComponent)((e=>t=>{const[n]=Cr("typography.fontSizes");return(0,s.createElement)(e,{...t,fontSizes:n||Ah})}),"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${Nh(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 i=Object.entries(t).filter((([e,t])=>r(t,e))).reduce(((t,[o,r])=>{const i=e[o],l=$d(n,i,e[r]);return t[o]={...l,class:Wd(i)},t}),{});return{...o,...i}}render(){return(0,s.createElement)(e,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")},Oh=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})),Dh=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})),zh=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"}));const Fh=[{icon:Oh,title:(0,S.__)("Align text left"),align:"left"},{icon:Dh,title:(0,S.__)("Align text center"),align:"center"},{icon:zh,title:(0,S.__)("Align text right"),align:"right"}],Vh={placement:"bottom-start"};var Hh=function({value:e,onChange:t,alignmentControls:n=Fh,label:o=(0,S.__)("Align text"),describedBy:r=(0,S.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:l}){function a(n){return()=>t(e===n?void 0:n)}const c=n.find((t=>t.align===e)),u=l?ui.ToolbarGroup:ui.ToolbarDropdownMenu,d=l?{isCollapsed:i}:{toggleProps:{describedBy:r},popoverProps:Vh};return(0,s.createElement)(u,{icon:c?c.icon:(0,S.isRTL)()?zh:Oh,label:o,controls:n.map((t=>{const{align:n}=t,o=e===n;return{...t,isActive:o,role:i?"menuitemradio":void 0,onClick:a(n)}})),...d})};const Uh=e=>(0,s.createElement)(Hh,{...e,isToolbar:!1}),Gh=e=>(0,s.createElement)(Hh,{...e,isToolbar:!0});var $h=n(4793),jh=n.n($h);function Wh(e){return e.toLowerCase()}var Kh=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zh=/[^A-Z0-9]+/gi;function qh(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}const Yh=e=>e.name||"",Xh=e=>e.title,Qh=e=>e.description||"",Jh=e=>e.keywords||[],ef=e=>e.category,tf=()=>null;function nf(e=""){return function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Kh:n,r=t.stripRegexp,i=void 0===r?Zh:r,l=t.transform,s=void 0===l?Wh:l,a=t.delimiter,c=void 0===a?" ":a,u=qh(qh(e,o,"$1\0$2"),i,"\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 of(e=""){return(e=(e=jh()(e)).replace(/^\//,"")).toLowerCase()}const rf=(e="")=>nf(of(e)),lf=(e,t,n,o)=>0===rf(o).length?e:sf(e,o,{getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title}),sf=(e=[],t="",n={})=>{if(0===rf(t).length)return e;const o=e.map((e=>[e,af(e,t,n)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))};function af(e,t,n={}){const{getName:o=Yh,getTitle:r=Xh,getDescription:i=Qh,getKeywords:l=Jh,getCategory:s=ef,getCollection:a=tf}=n,c=o(e),u=r(e),d=i(e),p=l(e),m=s(e),h=a(e),f=of(t),g=of(u);let b=0;if(f===g)b+=30;else if(g.startsWith(f))b+=20;else{const e=[c,u,d,...p,m,h].join(" ");0===(v=nf(f),k=e,v.filter((e=>!rf(k).some((t=>t.includes(e)))))).length&&(b+=10)}var v,k;return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}var cf=(e,t)=>{const[n]=(0,d.useSelect)((t=>[t(hr).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:i},l)=>{const s="unsynced"===r?(0,c.parse)(i,{__unstableSkipMigrationLogs:!0}):(0,c.createBlock)(e,n,(0,c.createBlocksFromInnerBlocksTemplate)(o));t(s,void 0,l)}),[t])]};const uf=(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,df=()=>{};var pf={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(hr),i=t(),l=r(i);return{selectedBlockName:i?n(i):null,rootClientId:l,prioritizedBlocks:o(l)?.prioritizedInserterBlocks}}),[]),[r,i,l]=cf(t,df),a=(0,u.useMemo)((()=>(e.trim()?lf(r,i,l,e):uf(re(r,"frecency","desc"),o)).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,i,l,o]),c=(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)(hh,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[a]);return[c]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o,syncStatus:r,content:i}=e;return{action:"replace",value:"unsynced"===r?(0,c.parse)(i,{__unstableSkipMigrationLogs:!0}):(0,c.createBlock)(t,n,(0,c.createBlocksFromInnerBlocksTemplate)(o))}}},mf=window.wp.apiFetch,hf=n.n(mf),ff=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),gf={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await hf()({path:(0,Cs.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,s.createElement)(s.Fragment,null,(0,s.createElement)(kl,{key:"icon",icon:"page"===e.subtype?Ks:ff}),e.title)},getOptionCompletion(e){return(0,s.createElement)("a",{href:e.url},e.title)}};const bf=[];function vf({completers:e=bf}){const{name:t}=k();return(0,u.useMemo)((()=>{let n=[...e,gf];return(t===(0,c.getDefaultBlockName)()||(0,c.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(n=[...n,pf]),(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])}var kf=function(e){return(0,s.createElement)(ui.Autocomplete,{...e,completers:vf(e)})},_f=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),yf=function({isActive:e,label:t=(0,S.__)("Toggle full height"),onToggle:n,isDisabled:o}){return(0,s.createElement)(ui.ToolbarButton,{isActive:e,icon:_f,label:t,onClick:()=>n(!e),disabled:o})};const wf=()=>{};var Ef=function(e){const{label:t=(0,S.__)("Change matrix alignment"),onChange:n=wf,value:o="center",isDisabled:r}=e,i=(0,s.createElement)(ui.__experimentalAlignmentMatrixControl.Icon,{value:o});return(0,s.createElement)(ui.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e,isOpen:n})=>(0,s.createElement)(ui.ToolbarButton,{onClick:e,"aria-haspopup":"true","aria-expanded":n,onKeyDown:t=>{n||t.keyCode!==xs.DOWN||(t.preventDefault(),e())},label:t,icon:i,showTooltip:!0,disabled:r}),renderContent:()=>(0,s.createElement)(ui.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})};function Sf({clientId:e,maximumLength:t,context:n}){const{attributes:o,name:r,reusableBlockTitle:i}=(0,d.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:r}=t(hr),i=n(e);if(!i)return{};const l=(0,c.isReusableBlock)((0,c.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:l&&r(o(e).ref)}}),[e]),l=Em(e);if(!r||!l)return null;const s=(0,c.getBlockType)(r),a=s?(0,c.__experimentalGetBlockLabel)(s,o,n):null,u=i||a,p=u&&u!==s.title?u:l.title;if(t&&t>0&&p.length>t){const e="...";return p.slice(0,t-e.length)+e}return p}function Cf({clientId:e,maximumLength:t,context:n}){return Sf({clientId:e,maximumLength:t,context:n})}var xf=function({rootLabelText:e}){const{selectBlock:t,clearSelectedBlock:n}=(0,d.useDispatch)(hr),{clientId:o,parents:r,hasSelection:i}=(0,d.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getEnabledBlockParents:o}=pr(e(hr)),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),l=e||(0,S.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,S.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(ui.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:n},l),!i&&l,!!o&&(0,s.createElement)(kl,{icon:Ds,className:"block-editor-block-breadcrumb__separator"})),r.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(ui.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>t(e)},(0,s.createElement)(Cf,{clientId:e,maximumLength:35})),(0,s.createElement)(kl,{icon:Ds,className:"block-editor-block-breadcrumb__separator"})))),!!o&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Cf,{clientId:o,maximumLength:35})))};function Bf(e){return(0,d.useSelect)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(hr);return n(e)}),[e])}const If=(0,u.createContext)({});function Tf({value:e,children:t}){const n=(0,u.useContext)(If),o=(0,u.useMemo)((()=>({...n,...e})),[n,e]);return(0,s.createElement)(If.Provider,{value:o,children:t})}var Pf=If;const Mf={},Rf=(0,ui.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})}));var Af=e=>{const{attributes:t={},name:n}=e,o=(0,c.getBlockType)(n),r=(0,u.useContext)(Pf),i=(0,u.useMemo)((()=>o&&o.usesContext?Object.fromEntries(Object.entries(r).filter((([e])=>o.usesContext.includes(e)))):Mf),[o,r]);if(!o)return null;if(o.apiVersion>1)return(0,s.createElement)(Rf,{...e,context:i});const l=(0,c.hasBlockSupport)(o,"className",!0)?(0,c.getBlockDefaultClassName)(n):null,a=oi()(l,t.className,e.className);return(0,s.createElement)(Rf,{...e,context:i,className:a})};function Nf({mayDisplayControls:e,mayDisplayParentControls:t,...n}){const{name:o,isSelected:r,clientId:i,attributes:l={},__unstableLayoutClassNames:a}=n,{layout:d=null}=l,p=(0,c.hasBlockSupport)(o,"layout",!1)||(0,c.hasBlockSupport)(o,"__experimentalLayout",!1);return(0,s.createElement)(v,{value:(0,u.useMemo)((()=>({name:o,isSelected:r,clientId:i,layout:p?d:null,__unstableLayoutClassNames:a,[h]:e,[f]:t})),[o,r,i,p,d,a,e,t])},(0,s.createElement)(Af,{...n}))}var Lf=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Of=function({className:e,actions:t,children:n,secondaryActions:o}){return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:oi()(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)(ui.DropdownMenu,{className:"block-editor-warning__secondary",icon:Lf,label:(0,S.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(ui.MenuGroup,null,o.map(((e,t)=>(0,s.createElement)(ui.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))},Df=n(1973);function zf({title:e,rawContent:t,renderedContent:n,action:o,actionText:r,className:i}){return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},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,Es.safeHTML)(n)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(ui.Button,{variant:"secondary",tabIndex:"0",onClick:o},r)))}var Ff=function({block:e,onKeep:t,onConvert:n,convertor:o,convertButtonText:r}){const i=(l=o(e),(Array.isArray(l)?l:[l]).map((e=>(0,c.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var l;const a=(u=e.originalContent,d=i,(0,Df.Kx)(u,d).map(((e,t)=>{const n=oi()({"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)(zf,{title:(0,S.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,S.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,s.createElement)(zf,{title:(0,S.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:i}))};const Vf=e=>(0,c.rawHandler)({HTML:e.originalContent});function Hf({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:o}=(0,d.useSelect)((t=>{const{canInsertBlockType:n,getBlock:o,getBlockRootClientId:r}=t(hr),i=r(e);return{block:o(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:r}=(0,d.useDispatch)(hr),[i,l]=(0,u.useState)(!1),a=(0,u.useCallback)((()=>l(!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=Vf(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)((()=>[{
// translators: Button to fix block content
title:(0,S._x)("Resolve","imperative verb"),onClick:()=>l(!0)},n&&{title:(0,S.__)("Convert to HTML"),onClick:p.toHTML},o&&{title:(0,S.__)("Convert to Classic Block"),onClick:p.toClassic}].filter(Boolean)),[n,o,p]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Of,{actions:[(0,s.createElement)(ui.Button,{key:"recover",onClick:p.toRecoveredBlock,variant:"primary"},(0,S.__)("Attempt Block Recovery"))],secondaryActions:m},(0,S.__)("This block contains unexpected or invalid content.")),i&&(0,s.createElement)(ui.Modal,{title:
// translators: Dialog title to fix block content
(0,S.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare"},(0,s.createElement)(Ff,{block:t,onKeep:p.toHTML,onConvert:p.toBlocks,convertor:Vf,convertButtonText:(0,S.__)("Convert to Blocks")})))}const Uf=(0,s.createElement)(Of,{className:"block-editor-block-list__block-crash-warning"},(0,S.__)("This block has encountered an error and cannot be previewed."));var Gf=()=>Uf;class $f extends u.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var jf=$f,Wf=n(773),Kf=function({clientId:e}){const[t,n]=(0,u.useState)(""),o=(0,d.useSelect)((t=>t(hr).getBlock(e)),[e]),{updateBlock:r}=(0,d.useDispatch)(hr);return(0,u.useEffect)((()=>{n((0,c.getBlockContent)(o))}),[o]),(0,s.createElement)(Wf.Z,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=(0,c.getBlockType)(o.name);if(!i)return;const l=(0,c.getBlockAttributes)(i,t,o.attributes),s=t||(0,c.getSaveContent)(i,l),[a]=t?(0,c.validateBlock)({...o,attributes:l,originalContent:s}):[!0];r(e,{attributes:l,originalContent:s,isValid:a}),t||n(s)},onChange:e=>n(e.target.value)})};let Zf=ug();const qf=e=>lg(e,Zf);let Yf=ug();qf.write=e=>lg(e,Yf);let Xf=ug();qf.onStart=e=>lg(e,Xf);let Qf=ug();qf.onFrame=e=>lg(e,Qf);let Jf=ug();qf.onFinish=e=>lg(e,Jf);let eg=[];qf.setTimeout=(e,t)=>{let n=qf.now()+t,o=()=>{let e=eg.findIndex((e=>e.cancel==o));~e&&eg.splice(e,1),rg-=~e?1:0},r={time:n,handler:e,cancel:o};return eg.splice(tg(n),0,r),rg+=1,sg(),r};let tg=e=>~(~eg.findIndex((t=>t.time>e))||~eg.length);qf.cancel=e=>{Xf.delete(e),Qf.delete(e),Jf.delete(e),Zf.delete(e),Yf.delete(e)},qf.sync=e=>{ig=!0,qf.batchedUpdates(e),ig=!1},qf.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,qf.onStart(n)}return o.handler=e,o.cancel=()=>{Xf.delete(n),t=null},o};let ng="undefined"!=typeof window?window.requestAnimationFrame:()=>{};qf.use=e=>ng=e,qf.now="undefined"!=typeof performance?()=>performance.now():Date.now,qf.batchedUpdates=e=>e(),qf.catch=console.error,qf.frameLoop="always",qf.advance=()=>{"demand"!==qf.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):cg()};let og=-1,rg=0,ig=!1;function lg(e,t){ig?(t.delete(e),e(0)):(t.add(e),sg())}function sg(){og<0&&(og=0,"demand"!==qf.frameLoop&&ng(ag))}function ag(){~og&&(ng(ag),qf.batchedUpdates(cg))}function cg(){let e=og;og=qf.now();let t=tg(og);t&&(dg(eg.splice(0,t),(e=>e.handler())),rg-=t),rg?(Xf.flush(),Zf.flush(e?Math.min(64,og-e):16.667),Qf.flush(),Yf.flush(),Jf.flush()):og=-1}function ug(){let e=new Set,t=e;return{add(n){rg+=t!=e||e.has(n)?0:1,e.add(n)},delete(n){return rg-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,rg-=t.size,dg(t,(t=>t(n)&&e.add(t))),rg+=e.size,t=e)}}}function dg(e,t){e.forEach((e=>{try{t(e)}catch(e){qf.catch(e)}}))}function pg(){}const mg={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 hg(e,t){if(mg.arr(e)){if(!mg.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const fg=(e,t)=>e.forEach(t);function gg(e,t,n){if(mg.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const bg=e=>mg.und(e)?[]:mg.arr(e)?e:[e];function vg(e,t){if(e.size){const n=Array.from(e);e.clear(),fg(n,t)}}const kg=(e,...t)=>vg(e,(e=>e(...t))),_g=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let yg,wg,Eg=null,Sg=!1,Cg=pg;var xg=Object.freeze({__proto__:null,get createStringInterpolator(){return yg},get to(){return wg},get colors(){return Eg},get skipAnimation(){return Sg},get willAdvance(){return Cg},assign:e=>{e.to&&(wg=e.to),e.now&&(qf.now=e.now),void 0!==e.colors&&(Eg=e.colors),null!=e.skipAnimation&&(Sg=e.skipAnimation),e.createStringInterpolator&&(yg=e.createStringInterpolator),e.requestAnimationFrame&&qf.use(e.requestAnimationFrame),e.batchedUpdates&&(qf.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Cg=e.willAdvance),e.frameLoop&&(qf.frameLoop=e.frameLoop)}});const Bg=new Set;let Ig=[],Tg=[],Pg=0;const Mg={get idle(){return!Bg.size&&!Ig.length},start(e){Pg>e.priority?(Bg.add(e),qf.onStart(Rg)):(Ag(e),qf(Lg))},advance:Lg,sort(e){if(Pg)qf.onFrame((()=>Mg.sort(e)));else{const t=Ig.indexOf(e);~t&&(Ig.splice(t,1),Ng(e))}},clear(){Ig=[],Bg.clear()}};function Rg(){Bg.forEach(Ag),Bg.clear(),qf(Lg)}function Ag(e){Ig.includes(e)||Ng(e)}function Ng(e){Ig.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ig),0,e)}function Lg(e){const t=Tg;for(let n=0;n<Ig.length;n++){const o=Ig[n];Pg=o.priority,o.idle||(Cg(o),o.advance(e),o.idle||t.push(o))}return Pg=0,Tg=Ig,Tg.length=0,Ig=t,Ig.length>0}const Og="[-+]?\\d*\\.?\\d+",Dg=Og+"%";function zg(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Fg=new RegExp("rgb"+zg(Og,Og,Og)),Vg=new RegExp("rgba"+zg(Og,Og,Og,Og)),Hg=new RegExp("hsl"+zg(Og,Dg,Dg)),Ug=new RegExp("hsla"+zg(Og,Dg,Dg,Og)),Gg=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,$g=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,jg=/^#([0-9a-fA-F]{6})$/,Wg=/^#([0-9a-fA-F]{8})$/;function Kg(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 Zg(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,i=Kg(r,o,e+1/3),l=Kg(r,o,e),s=Kg(r,o,e-1/3);return Math.round(255*i)<<24|Math.round(255*l)<<16|Math.round(255*s)<<8}function qg(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Yg(e){return(parseFloat(e)%360+360)%360/360}function Xg(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Qg(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Jg(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=jg.exec(e))?parseInt(t[1]+"ff",16)>>>0:Eg&&void 0!==Eg[e]?Eg[e]:(t=Fg.exec(e))?(qg(t[1])<<24|qg(t[2])<<16|qg(t[3])<<8|255)>>>0:(t=Vg.exec(e))?(qg(t[1])<<24|qg(t[2])<<16|qg(t[3])<<8|Xg(t[4]))>>>0:(t=Gg.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Wg.exec(e))?parseInt(t[1],16)>>>0:(t=$g.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Hg.exec(e))?(255|Zg(Yg(t[1]),Qg(t[2]),Qg(t[3])))>>>0:(t=Ug.exec(e))?(Zg(Yg(t[1]),Qg(t[2]),Qg(t[3]))|Xg(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const eb=(e,t,n)=>{if(mg.fun(e))return e;if(mg.arr(e))return eb({range:e,output:t,extrapolate:n});if(mg.str(e.output[0]))return yg(e);const o=e,r=o.output,i=o.range||[0,1],l=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,o,r,i,l,s,a){let c=a?a(e):e;if(c<t){if("identity"===l)return c;"clamp"===l&&(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=i(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,i[t],i[t+1],r[t],r[t+1],a,l,s,o.map)}};function tb(){return tb=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},tb.apply(this,arguments)}const nb=Symbol.for("FluidValue.get"),ob=Symbol.for("FluidValue.observers"),rb=e=>Boolean(e&&e[nb]),ib=e=>e&&e[nb]?e[nb]():e,lb=e=>e[ob]||null;function sb(e,t){let n=e[ob];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class ab{constructor(e){if(this[nb]=void 0,this[ob]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");cb(this,e)}}const cb=(e,t)=>pb(e,nb,t);function ub(e,t){if(e[nb]){let n=e[ob];n||pb(e,ob,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function db(e,t){let n=e[ob];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[ob]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const pb=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),mb=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hb=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fb=new RegExp(`(${mb.source})(%|[a-z]+)`,"i"),gb=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bb=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,vb=e=>{const[t,n]=kb(e);if(!t||_g())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&bb.test(n)?vb(n):n||e},kb=e=>{const t=bb.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let _b;const yb=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,wb=e=>{_b||(_b=Eg?new RegExp(`(${Object.keys(Eg).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>ib(e).replace(bb,vb).replace(hb,Jg).replace(_b,Jg))),n=t.map((e=>e.match(mb).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))),r=o.map((t=>eb(tb({},e,{output:t}))));return e=>{var n;const o=!fb.test(t[0])&&(null==(n=t.find((e=>fb.test(e))))?void 0:n.replace(mb,""));let i=0;return t[0].replace(mb,(()=>`${r[i++](e)}${o||""}`)).replace(gb,yb)}},Eb="react-spring: ",Sb=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Eb}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Cb=Sb(console.warn);function xb(e){return mg.str(e)&&("#"==e[0]||/\d/.test(e)||!_g()&&bb.test(e)||e in(Eg||{}))}Sb(console.warn);const Bb=_g()?s.useEffect:s.useLayoutEffect;const Ib=[],Tb=Symbol.for("Animated:node"),Pb=e=>e&&e[Tb],Mb=(e,t)=>{return n=e,o=Tb,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Rb=e=>e&&e[Tb]&&e[Tb].getPayload();class Ab{constructor(){this.payload=void 0,Mb(this,this)}getPayload(){return this.payload||[]}}class Nb extends Ab{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,mg.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Nb(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return mg.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,mg.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Lb extends Nb{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=eb({output:[e,e]})}static create(e){return new Lb(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(mg.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=eb({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Ob={dependencies:null};class Db extends Ab{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return gg(this.source,((n,o)=>{var r;(r=n)&&r[Tb]===r?t[o]=n.getValue(e):rb(n)?t[o]=ib(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&fg(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return gg(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ob.dependencies&&rb(e)&&Ob.dependencies.add(e);const t=Rb(e);t&&fg(t,(e=>this.add(e)))}}class zb extends Db{constructor(e){super(e)}static create(e){return new zb(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Fb)),!0)}}function Fb(e){return(xb(e)?Lb:Nb).create(e)}function Vb(e){const t=Pb(e);return t?t.constructor:mg.arr(e)?zb:xb(e)?Lb:Nb}function Hb(){return Hb=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},Hb.apply(this,arguments)}const Ub=(e,t)=>{const n=!mg.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,s.forwardRef)(((o,r)=>{const i=(0,s.useRef)(null),l=n&&(0,s.useCallback)((e=>{i.current=function(e,t){return e&&(mg.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[a,c]=function(e,t){const n=new Set;return Ob.dependencies=n,e.style&&(e=Hb({},e,{style:t.createAnimatedStyle(e.style)})),e=new Db(e),Ob.dependencies=null,[e,n]}(o,t),u=function(){const e=(0,s.useState)()[1],t=(()=>{const e=(0,s.useRef)(!1);return Bb((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}(),d=()=>{const e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&u()},p=new Gb(d,c),m=(0,s.useRef)();var h;Bb((()=>(m.current=p,fg(c,(e=>ub(e,p))),()=>{m.current&&(fg(m.current.deps,(e=>db(e,m.current))),qf.cancel(m.current.update))}))),(0,s.useEffect)(d,[]),h=()=>()=>{const e=m.current;fg(e.deps,(t=>db(t,e)))},(0,s.useEffect)(h,Ib);const f=t.getComponentProps(a.getValue());return s.createElement(e,Hb({},f,{ref:l}))}))};class Gb{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&qf.write(this.update)}}const $b=Symbol.for("AnimatedComponent"),jb=e=>mg.str(e)?e:e&&mg.str(e.displayName)?e.displayName:mg.fun(e)&&e.name||null;function Wb(){return Wb=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},Wb.apply(this,arguments)}function Kb(e,...t){return mg.fun(e)?e(...t):e}const Zb=(e,t)=>!0===e||!!(t&&e&&(mg.fun(e)?e(t):bg(e).includes(t))),qb=(e,t)=>mg.obj(e)?t&&e[t]:e,Yb=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Xb=e=>e,Qb=(e,t=Xb)=>{let n=Jb;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);mg.und(n)||(o[r]=n)}return o},Jb=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ev={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 tv(e){const t=function(e){const t={};let n=0;if(gg(e,((e,o)=>{ev[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return gg(e,((e,o)=>o in t||(n[o]=e))),n}return Wb({},e)}function nv(e){return e=ib(e),mg.arr(e)?e.map(nv):xb(e)?xg.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function ov(e){return mg.fun(e)||mg.arr(e)&&mg.obj(e[0])}const rv=1.70158,iv=1.525*rv,lv=rv+1,sv=2*Math.PI/3,av=2*Math.PI/4.5,cv=e=>{const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},uv={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=>lv*e*e*e-rv*e*e,easeOutBack:e=>1+lv*Math.pow(e-1,3)+rv*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-iv)/2:(Math.pow(2*e-2,2)*((iv+1)*(2*e-2)+iv)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*sv),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*sv)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*av)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*av)/2+1,easeInBounce:e=>1-cv(1-e),easeOutBounce:cv,easeInOutBounce:e=>e<.5?(1-cv(1-2*e))/2:(1+cv(2*e-1))/2},dv=Wb({},{tension:170,friction:26},{mass:1,damping:1,easing:uv.linear,clamp:!1});class pv{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,dv)}}function mv(e,t){if(mg.und(t.decay)){const n=!mg.und(t.tension)||!mg.und(t.friction);!n&&mg.und(t.frequency)&&mg.und(t.damping)&&mg.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const hv=[];class fv{constructor(){this.changed=!1,this.values=hv,this.toValues=null,this.fromValues=hv,this.to=void 0,this.from=void 0,this.config=new pv,this.immediate=!1}}function gv(e,{key:t,props:n,defaultProps:o,state:r,actions:i}){return new Promise(((l,s)=>{var a;let c,u,d=Zb(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)h();else{mg.und(n.pause)||(r.paused=Zb(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Zb(e,t)),c=Kb(n.delay||0,t),e?(r.resumeQueue.add(m),i.pause()):(i.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-qf.now()}function m(){c>0&&!xg.skipAnimation?(r.delayed=!0,u=qf.setTimeout(h,c),r.pauseQueue.add(p),r.timeouts.add(u)):h()}function h(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{i.start(Wb({},n,{callId:e,cancel:d}),l)}catch(e){s(e)}}}))}const bv=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?_v(e.get()):t.every((e=>e.noop))?vv(e.get()):kv(e.get(),t.every((e=>e.finished))),vv=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),kv=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),_v=e=>({value:e,cancelled:!0,finished:!1});function yv(e,t,n,o){const{callId:r,parentId:i,onRest:l}=t,{asyncTo:s,promise:a}=n;return i||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=Qb(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&_v(o)||r!==n.asyncId&&kv(o,!1);if(t)throw e.result=t,d(e),e},h=(e,t)=>{const i=new Ev,l=new Sv;return(async()=>{if(xg.skipAnimation)throw wv(n),l.result=kv(o,!1),d(l),l;m(i);const s=mg.obj(e)?Wb({},e):Wb({},t,{to:e});s.parentId=r,gg(c,((e,t)=>{mg.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let f;if(xg.skipAnimation)return wv(n),kv(o,!1);try{let t;t=mg.arr(e)?(async e=>{for(const t of e)await h(t)})(e):Promise.resolve(e(h,o.stop.bind(o))),await Promise.all([t.then(u),p]),f=kv(o.get(),!0,!1)}catch(e){if(e instanceof Ev)f=e.result;else{if(!(e instanceof Sv))throw e;f=e.result}}finally{r==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?a:void 0)}return mg.fun(l)&&qf.batchedUpdates((()=>{l(f,o,o.item)})),f})():a}function wv(e,t){vg(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ev extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Sv extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Cv=e=>e instanceof Bv;let xv=1;class Bv extends ab{constructor(...e){super(...e),this.id=xv++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Pb(this);return e&&e.getValue()}to(...e){return xg.to(this,e)}interpolate(...e){return Cb(`${Eb}The "interpolate" function is deprecated in v9 (use "to" instead)`),xg.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){sb(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Mg.sort(this),sb(this,{type:"priority",parent:this,priority:e})}}const Iv=Symbol.for("SpringPhase"),Tv=e=>(1&e[Iv])>0,Pv=e=>(2&e[Iv])>0,Mv=e=>(4&e[Iv])>0,Rv=(e,t)=>t?e[Iv]|=3:e[Iv]&=-3,Av=(e,t)=>t?e[Iv]|=4:e[Iv]&=-5;class Nv extends Bv{constructor(e,t){if(super(),this.key=void 0,this.animation=new fv,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!mg.und(e)||!mg.und(t)){const n=mg.obj(e)?Wb({},e):Wb({},t,{from:e});mg.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Pv(this)||this._state.asyncTo)||Mv(this)}get goal(){return ib(this.animation.to)}get velocity(){const e=Pb(this);return e instanceof Nb?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Tv(this)}get isAnimating(){return Pv(this)}get isPaused(){return Mv(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:i}=o;const l=Rb(o.to);!l&&rb(o.to)&&(i=bg(ib(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Lb?1:l?l[a].lastPosition:i[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],i=null!=s.v0?s.v0:s.v0=mg.arr(r.velocity)?r.velocity[a]:r.velocity;let l;const p=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n)));if(mg.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<=p,l=i*o}else{l=null==s.lastVelocity?i:s.lastVelocity;const t=r.restVelocity||p/10,o=r.clamp?0:r.bounce,a=!mg.und(o),m=n==c?s.v0>0:n<c;let h,f=!1;const g=1,b=Math.ceil(e/g);for(let e=0;e<b&&(h=Math.abs(l)>t,h||(u=Math.abs(c-d)<=p,!u));++e)a&&(f=d==c||d>c==m,f&&(l=-l*o,d=c)),l+=(1e-6*-r.tension*(d-c)+.001*-r.friction*l)/r.mass*g,d+=l*g}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),l=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=l,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}l&&!l[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=Pb(this),a=s.getValue();if(t){const e=ib(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 qf.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Pv(this)){const{to:e,config:t}=this.animation;qf.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 mg.und(e)?(n=this.queue||[],this.queue=[]):n=[mg.obj(e)?e:Wb({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>bv(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),wv(this._state,e&&this._lastCallId),qf.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=mg.obj(n)?n[t]:n,(null==n||ov(n))&&(n=void 0),o=mg.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Tv(this)||(e.reverse&&([n,o]=[o,n]),o=ib(o),mg.und(o)?Pb(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Wb({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Qb(n,((e,t)=>/^on/.test(t)?qb(e,o):e))),Vv(this,n,"onProps"),Hv(this,"onProps",n,this);const i=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const l=this._state;return gv(++this._lastCallId,{key:o,props:n,defaultProps:r,state:l,actions:{pause:()=>{Mv(this)||(Av(this,!0),kg(l.pauseQueue),Hv(this,"onPause",kv(this,Lv(this,this.animation.to)),this))},resume:()=>{Mv(this)&&(Av(this,!1),Pv(this)&&this._resume(),kg(l.resumeQueue),Hv(this,"onResume",kv(this,Lv(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Ov(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(_v(this));const o=!mg.und(e.to),r=!mg.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(_v(this));this._lastToId=t.callId}const{key:i,defaultProps:l,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!mg.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!hg(d,c);p&&(s.from=d),d=ib(d);const m=!hg(u,a);m&&this._focus(u);const h=ov(t.to),{config:f}=s,{decay:g,velocity:b}=f;(o||r)&&(f.velocity=0),t.config&&!h&&function(e,t,n){n&&(mv(n=Wb({},n),t),t=Wb({},n,t)),mv(e,t),Object.assign(e,t);for(const t in dv)null==e[t]&&(e[t]=dv[t]);let{mass:o,frequency:r,damping:i}=e;mg.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*i*o/r)}(f,Kb(t.config,i),t.config!==l.config?Kb(l.config,i):void 0);let v=Pb(this);if(!v||mg.und(u))return n(kv(this,!0));const k=mg.und(t.reset)?r&&!t.default:!mg.und(d)&&Zb(t.reset,i),_=k?d:this.get(),y=nv(u),w=mg.num(y)||mg.arr(y)||xb(y),E=!h&&(!w||Zb(l.immediate||t.immediate,i));if(m){const e=Vb(u);if(e!==v.constructor){if(!E)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(y)}}const S=v.constructor;let C=rb(u),x=!1;if(!C){const e=k||!Tv(this)&&p;(m||e)&&(x=hg(nv(_),y),C=!x),(hg(s.immediate,E)||E)&&hg(f.decay,g)&&hg(f.velocity,b)||(C=!0)}if(x&&Pv(this)&&(s.changed&&!k?C=!0:C||this._stop(a)),!h&&((C||rb(a))&&(s.values=v.getPayload(),s.toValues=rb(u)?null:S==Lb?[1]:bg(y)),s.immediate!=E&&(s.immediate=E,E||k||this._set(a)),C)){const{onRest:e}=s;fg(Fv,(e=>Vv(this,t,e)));const o=kv(this,Lv(this,a));kg(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&qf.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Kb(l.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),h?n(yv(t.to,t,this._state,this)):C?this._start():Pv(this)&&!m?this._pendingCalls.add(n):n(vv(_))}_focus(e){const t=this.animation;e!==t.to&&(lb(this)&&this._detach(),t.to=e,lb(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;rb(t)&&(ub(t,this),Cv(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;rb(e)&&db(e,this)}_set(e,t=!0){const n=ib(e);if(!mg.und(n)){const e=Pb(this);if(!e||!hg(n,e.getValue())){const o=Vb(n);e&&e.constructor==o?e.setValue(n):Mb(this,o.create(n)),e&&qf.batchedUpdates((()=>{this._onChange(n,t)}))}}return Pb(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Hv(this,"onStart",kv(this,Lv(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Kb(this.animation.onChange,e,this)),Kb(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Pb(this).reset(ib(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Pv(this)||(Rv(this,!0),Mv(this)||this._resume())}_resume(){xg.skipAnimation?this.finish():Mg.start(this)}_stop(e,t){if(Pv(this)){Rv(this,!1);const n=this.animation;fg(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),sb(this,{type:"idle",parent:this});const o=t?_v(this.get()):kv(this.get(),Lv(this,null!=e?e:n.to));kg(this._pendingCalls,o),n.changed&&(n.changed=!1,Hv(this,"onRest",o,this))}}}function Lv(e,t){const n=nv(t);return hg(nv(e.get()),n)}function Ov(e,t=e.loop,n=e.to){let o=Kb(t);if(o){const r=!0!==o&&tv(o),i=(r||e).reverse,l=!r||r.reset;return Dv(Wb({},e,{loop:t,default:!1,pause:void 0,to:!i||ov(n)?n:void 0,from:l?e.from:void 0,reset:l},r))}}function Dv(e){const{to:t,from:n}=e=tv(e),o=new Set;return mg.obj(t)&&zv(t,o),mg.obj(n)&&zv(n,o),e.keys=o.size?Array.from(o):null,e}function zv(e,t){gg(e,((e,n)=>null!=e&&t.add(n)))}const Fv=["onStart","onRest","onChange","onPause","onResume"];function Vv(e,t,n){e.animation[n]=t[n]!==Yb(t,n)?qb(t[n],e.key):void 0}function Hv(e,t,...n){var o,r,i,l;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(i=(l=e.defaultProps)[t])||i.call(l,...n)}const Uv=["onStart","onChange","onRest"];let Gv=1;class $v{constructor(e,t){this.id=Gv++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Wb({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];mg.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Dv(e)),this}start(e){let{queue:t}=this;return e?t=bg(e).map(Dv):this.queue=[],this._flush?this._flush(this,t):(Wv(this,t),function(e,t){return Promise.all(t.map((t=>jv(e,t)))).then((t=>bv(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;fg(bg(t),(t=>n[t].stop(!!e)))}else wv(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(mg.und(e))this.start({pause:!0});else{const t=this.springs;fg(bg(e),(e=>t[e].pause()))}return this}resume(e){if(mg.und(e))this.start({pause:!1});else{const t=this.springs;fg(bg(e),(e=>t[e].resume()))}return this}each(e){gg(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,vg(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const i=!o&&this._started,l=r||i&&n.size?this.get():null;r&&t.size&&vg(t,(([e,t])=>{t.value=l,e(t,this,this._item)})),i&&(this._started=!1,vg(n,(([e,t])=>{t.value=l,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)}qf.onFrame(this._onFrame)}}async function jv(e,t,n){const{keys:o,to:r,from:i,loop:l,onRest:s,onResolve:a}=t,c=mg.obj(t.default)&&t.default;l&&(t.loop=!1),!1===r&&(t.to=null),!1===i&&(t.from=null);const u=mg.arr(r)||mg.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):fg(Uv,(n=>{const o=t[n];if(mg.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,kg(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Yb(t,"cancel");(u||m&&d.asyncId)&&p.push(gv(++e._lastAsyncId,{props:t,state:d,actions:{pause:pg,resume:pg,start(t,n){m?(wv(d,e._lastAsyncId),n(_v(e))):(t.onRest=s,n(yv(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const h=bv(e,await Promise.all(p));if(l&&h.finished&&(!n||!h.noop)){const n=Ov(t,l,r);if(n)return Wv(e,[n]),jv(e,n,!0)}return a&&qf.batchedUpdates((()=>a(h,e,e.item))),h}function Wv(e,t){fg(t,(t=>{!function(e,t,n){t.keys&&fg(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){const n=new Nv;return n.key=e,t&&ub(n,t),n}(t,e)))}))}const Kv=["children"],Zv=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Kv);const o=(0,s.useContext)(qv),r=n.pause||!!o.pause,i=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,s.useState)((()=>({inputs:t,result:e()}))),o=(0,s.useRef)(),r=o.current;let i=r;if(i){const n=Boolean(t&&i.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,i.inputs));n||(i={inputs:t,result:e()})}else i=n;return(0,s.useEffect)((()=>{o.current=i,r==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:i})),[r,i]);const{Provider:l}=qv;return s.createElement(l,{value:n},t)},qv=(Yv=Zv,Xv={},Object.assign(Yv,s.createContext(Xv)),Yv.Provider._context=Yv,Yv.Consumer._context=Yv,Yv);var Yv,Xv;let Qv;Zv.Provider=qv.Provider,Zv.Consumer=qv.Consumer,function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Qv||(Qv={}));class Jv extends Bv{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=eb(...t);const n=this._get(),o=Vb(n);Mb(this,o.create(n))}advance(e){const t=this._get();hg(t,this.get())||(Pb(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&tk(this._active)&&nk(this)}_get(){const e=mg.arr(this.source)?this.source.map(ib):bg(ib(this.source));return this.calc(...e)}_start(){this.idle&&!tk(this._active)&&(this.idle=!1,fg(Rb(this),(e=>{e.done=!1})),xg.skipAnimation?(qf.batchedUpdates((()=>this.advance())),nk(this)):Mg.start(this))}_attach(){let e=1;fg(bg(this.source),(t=>{rb(t)&&ub(t,this),Cv(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){fg(bg(this.source),(e=>{rb(e)&&db(e,this)})),this._active.clear(),nk(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=bg(this.source).reduce(((e,t)=>Math.max(e,(Cv(t)?t.priority:0)+1)),0))}}function ek(e){return!1!==e.idle}function tk(e){return!e.size||Array.from(e).every(ek)}function nk(e){e.idle||(e.idle=!0,fg(Rb(e),(e=>{e.done=!0})),sb(e,{type:"idle",parent:e}))}xg.assign({createStringInterpolator:wb,to:(e,t)=>new Jv(e,t)}),Mg.advance;var ok=window.ReactDOM;function rk(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const ik=["style","children","scrollTop","scrollLeft"],lk=/^--/;function sk(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||lk.test(e)||ck.hasOwnProperty(e)&&ck[e]?(""+t).trim():t+"px"}const ak={};let ck={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const uk=["Webkit","Ms","Moz","O"];ck=Object.keys(ck).reduce(((e,t)=>(uk.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),ck);const dk=["x","y","z"],pk=/^(matrix|translate|scale|rotate|skew)/,mk=/^(translate)/,hk=/^(rotate|skew)/,fk=(e,t)=>mg.num(e)&&0!==e?e+t:e,gk=(e,t)=>mg.arr(e)?e.every((e=>gk(e,t))):mg.num(e)?e===t:parseFloat(e)===t;class bk extends Db{constructor(e){let{x:t,y:n,z:o}=e,r=rk(e,dk);const i=[],l=[];(t||n||o)&&(i.push([t||0,n||0,o||0]),l.push((e=>[`translate3d(${e.map((e=>fk(e,"px"))).join(",")})`,gk(e,0)]))),gg(r,((e,t)=>{if("transform"===t)i.push([e||""]),l.push((e=>[e,""===e]));else if(pk.test(t)){if(delete r[t],mg.und(e))return;const n=mk.test(t)?"px":hk.test(t)?"deg":"";i.push(bg(e)),l.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${fk(r,n)})`,gk(r,0)]:e=>[`${t}(${e.map((e=>fk(e,n))).join(",")})`,gk(e,t.startsWith("scale")?1:0)])}})),i.length&&(r.transform=new vk(i,l)),super(r)}}class vk extends ab{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return fg(this.inputs,((n,o)=>{const r=ib(n[0]),[i,l]=this.transforms[o](mg.arr(r)?r:n.map(ib));e+=" "+i,t=t&&l})),t?"none":e}observerAdded(e){1==e&&fg(this.inputs,(e=>fg(e,(e=>rb(e)&&ub(e,this)))))}observerRemoved(e){0==e&&fg(this.inputs,(e=>fg(e,(e=>rb(e)&&db(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),sb(this,e)}}const kk=["scrollTop","scrollLeft"];xg.assign({batchedUpdates:ok.unstable_batchedUpdates,createStringInterpolator:wb,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const _k=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Db(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},i=e=>{const t=jb(e)||"Anonymous";return(e=mg.str(e)?i[e]||(i[e]=Ub(e,r)):e[$b]||(e[$b]=Ub(e,r))).displayName=`Animated(${t})`,e};return gg(e,((t,n)=>{mg.arr(e)&&(n=jb(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:i,scrollTop:l,scrollLeft:s}=o,a=rk(o,ik),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ak[t]||(ak[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==i&&(e.textContent=i);for(let t in r)if(r.hasOwnProperty(t)){const n=sk(t,r[t]);lk.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!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new bk(e),getComponentProps:e=>rk(e,kk)}),yk=_k.animated;function wk(e){return{top:e.offsetTop,left:e.offsetLeft}}var Ek=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,u.useRef)(),{isTyping:o,getGlobalBlockCount:r,isBlockSelected:i,isFirstMultiSelectedBlock:l,isBlockMultiSelected:s,isAncestorMultiSelected:a}=(0,d.useSelect)(hr),{previous:c,prevRect:p}=(0,u.useMemo)((()=>({previous:n.current&&wk(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,u.useLayoutEffect)((()=>{if(!c||!n.current)return;const e=(0,Es.getScrollContainer)(n.current),u=i(t),d=u||l(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":"",f=new $v({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 g=wk(n.current),b=Math.round(c.left-g.left),v=Math.round(c.top-g.top);return f.start({x:0,y:0,from:{x:b,y:v}}),()=>{f.stop()}}),[c,p,t,o,r,i,l,s,a]),n};const Sk=(0,u.createContext)(null),Ck=".block-editor-block-list__block",xk=".block-list-appender",Bk=".block-editor-button-block-appender";function Ik(e,t){return e.closest(Ck)===t.closest(Ck)}function Tk(e,t){return t.closest([Ck,xk,Bk].join(","))===e}function Pk(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Ck);return t?t.id.slice(6):void 0}function Mk({clientId:e,initialPosition:t}){const n=(0,u.useRef)(),{isBlockSelected:o,isMultiSelecting:r}=(0,d.useSelect)(hr);return(0,u.useEffect)((()=>{if(!o(e)||r())return;if(null==t)return;if(!n.current)return;const{ownerDocument:i}=n.current;if(Tk(n.current,i.activeElement))return;const l=Es.focus.tabbable.find(n.current).filter((e=>(0,Es.isTextField)(e))),s=-1===t,a=l[s?l.length-1:0]||n.current;if(Tk(n.current,a)){if(!n.current.getAttribute("contenteditable")){const e=Es.focus.tabbable.findNext(n.current);if(e&&Tk(n.current,e)&&(0,Es.isFormElement)(e))return void e.focus()}(0,Es.placeCaretAtHorizontalEdge)(a,s)}else n.current.focus()}),[t,e]),n}function Rk(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Ak({isEnabled:e}){return(0,p.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Rk),t.addEventListener("mouseover",Rk),()=>{t.removeEventListener("mouseout",Rk),t.removeEventListener("mouseover",Rk),t.classList.remove("is-hovered")}}),[e])}function Nk(e){const{isBlockSelected:t}=(0,d.useSelect)(hr),{selectBlock:n,selectionChange:o}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((r=>{function i(i){r.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||o(e):Tk(r,i.target)&&n(e))}return r.addEventListener("focusin",i),()=>{r.removeEventListener("focusin",i)}}),[t,n])}function Lk({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:o}=(0,d.useSelect)(hr),{insertDefaultBlock:r,removeBlock:i}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((l=>{if(t)return l.addEventListener("keydown",s),l.addEventListener("dragstart",a),()=>{l.removeEventListener("keydown",s),l.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==xs.ENTER&&s!==xs.BACKSPACE&&s!==xs.DELETE||a!==l||(0,Es.isTextField)(a)||(t.preventDefault(),s===xs.ENTER?r({},n(e),o(e)+1):i(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,i])}function Ok(e){const{isNavigationMode:t,isBlockSelected:n}=(0,d.useSelect)(hr),{setNavigationMode:o,selectBlock:r}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((i=>{function l(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?o(!1):r(e))}return i.addEventListener("mousedown",l),()=>{i.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Dk(){const e=(0,u.useContext)(eE);return(0,p.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function zk(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:o,wrapperProps:r={},isAligned:i,index:l,mode:s,name:a,blockApiVersion:c,blockTitle:d,isSelected:m,isSubtreeDisabled:h,isOutlineEnabled:f,hasOverlay:g,initialPosition:b,blockEditingMode:v,isHighlighted:_,isMultiSelected:y,isPartiallySelected:w,isReusable:E,isDragging:C,hasChildSelected:x,removeOutline:B,isBlockMovingMode:I,canInsertMovingBlock:T,isEditingDisabled:P,isTemporarilyEditingAsBlocks:M,defaultClassName:R}=(0,u.useContext)(Sk),A=(0,S.sprintf)((0,S.__)("Block: %s"),d),N="html"!==s||t?"":"-visual",L=(0,p.useMergeRefs)([e.ref,Mk({clientId:n,initialPosition:b}),Fu(n),Nk(n),Lk({clientId:n,isSelected:m}),Ok(n),Ak({isEnabled:f}),Dk(),Ek({triggerAnimationOnChange:l,clientId:n}),(0,p.useDisabled)({isDisabled:!g})]),O=k();
// translators: %s: Type of block (i.e. Text, Image etc)
return c<2&&O.clientId,{tabIndex:"disabled"===v?-1:0,...r,...e,ref:L,id:`block-${n}${N}`,role:"document","aria-label":A,"data-block":n,"data-type":a,"data-title":d,inert:h?"true":void 0,className:oi()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":g,"is-selected":m,"is-highlighted":_,"is-multi-selected":y,"is-partially-selected":w,"is-reusable":E,"is-dragging":C,"has-child-selected":x,"remove-outline":B,"is-block-moving-mode":I,"can-insert-moving-block":T,"is-editing-disabled":P,"is-content-locked-temporarily-editing-as-blocks":M},o,e.className,r.className,R),style:{...r.style,...e.style}}}function Fk({children:e,isHtml:t,...n}){return(0,s.createElement)("div",{...zk(n,{__unstableIsHtml:t})},e)}function Vk({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:o,clientId:r,isSelected:i,isSelectionEnabled:l,className:a,__unstableLayoutClassNames:p,name:m,isValid:h,attributes:f,wrapperProps:g,setAttributes:b,onReplace:v,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}){var w;const{mayDisplayControls:E,mayDisplayParentControls:S,themeSupportsLayout:C,...x}=(0,u.useContext)(Sk),{removeBlock:B}=(0,d.useDispatch)(hr),I=(0,u.useCallback)((()=>B(r)),[r]),T=Al()||{};let P=(0,s.createElement)(Nf,{name:m,isSelected:i,attributes:f,setAttributes:b,insertBlocksAfter:n?void 0:k,onReplace:o?v:void 0,onRemove:o?I:void 0,mergeBlocks:o?_:void 0,clientId:r,isSelectionEnabled:l,toggleSelection:y,__unstableLayoutClassNames:p,__unstableParentLayout:Object.keys(T).length?T:void 0,mayDisplayControls:E,mayDisplayParentControls:S});const M=(0,c.getBlockType)(m);M?.getEditWrapperProps&&(g=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=oi()(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(g,M.getEditWrapperProps(f)));const R=g&&!!g["data-align"]&&!C,A=a?.includes("is-position-sticky");let N;if(R&&(P=(0,s.createElement)("div",{className:oi()("wp-block",A&&a),"data-align":g["data-align"]},P)),h)N="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},P),(0,s.createElement)(Fk,{isHtml:!0},(0,s.createElement)(Kf,{clientId:r}))):M?.apiVersion>1?P:(0,s.createElement)(Fk,null,P);else{const t=e?(0,c.serializeRawBlock)(e):(0,c.getSaveContent)(M,f);N=(0,s.createElement)(Fk,{className:"has-warning"},(0,s.createElement)(Hf,{clientId:r}),(0,s.createElement)(u.RawHTML,null,(0,Es.safeHTML)(t)))}const{"data-align":L,...O}=null!==(w=g)&&void 0!==w?w:{};return O.className=oi()(O.className,L&&C&&`align${L}`,!(L&&A)&&a),(0,s.createElement)(Sk.Provider,{value:{wrapperProps:O,isAligned:R,...x}},(0,s.createElement)(jf,{fallback:(0,s.createElement)(Fk,{className:"has-warning"},(0,s.createElement)(Gf,null))},N))}zk.save=c.__unstableGetBlockProps;const Hk=(0,d.withDispatch)(((e,t,n)=>{const{updateBlockAttributes:o,insertBlocks:r,mergeBlocks:i,replaceBlocks:l,toggleSelection:s,__unstableMarkLastChangeAsPersistent:a,moveBlocksToPosition:u,removeBlock:d}=e(hr);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(hr),i=r(),{clientId:l}=t,s=i.length?i:[l];o(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;r(e,n,o)},onInsertBlocksAfter(e){const{clientId:o,rootClientId:i}=t,{getBlockIndex:l}=n.select(hr),s=l(o);r(e,s+1,i)},onMerge(e){const{clientId:o,rootClientId:l}=t,{getPreviousBlockClientId:s,getNextBlockClientId:a,getBlock:p,getBlockAttributes:m,getBlockName:h,getBlockOrder:f,getBlockIndex:g,getBlockRootClientId:b,canInsertBlockType:v}=n.select(hr);function k(e,t=!0){const o=b(e),i=f(e),[l]=i;1===i.length&&(0,c.isUnmodifiedBlock)(p(l))?d(e):n.batch((()=>{if(v(h(l),o))u([l],e,o,g(e));else{const n=(0,c.switchToBlockType)(p(l),(0,c.getDefaultBlockName)());n&&n.length&&(r(n,g(e),o,t),d(l,!1))}!f(e).length&&(0,c.isUnmodifiedBlock)(p(e))&&d(e,!1)}))}if(e){if(l){const e=a(l);if(e){if(h(l)!==h(e))return void i(l,e);{const t=m(l),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(e),e,l),d(e,!1)}))}}}const e=a(o);if(!e)return;f(e).length?k(e,!1):i(o,e)}else{const e=s(o);if(e)i(e,o);else if(l){const e=s(l);if(e&&h(l)===h(e)){const t=m(l),o=m(e);if(Object.keys(t).every((e=>t[e]===o[e])))return void n.batch((()=>{u(f(l),l,e),d(l,!1)}))}k(l)}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;l([t.clientId],r,n,o)},toggleSelection(e){s(e)}}}));Vk=(0,p.compose)(Hk,(0,ui.withFilters)("editor.BlockListBlock"))(Vk);var Uk=(0,p.pure)((function(e){const{clientId:t,rootClientId:n}=e,o=(0,d.useSelect)((e=>{const{isBlockSelected:o,getBlockMode:r,isSelectionEnabled:i,getTemplateLock:l,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:a,canMoveBlock:u,getSettings:d,__unstableGetTemporarilyEditingAsBlocks:p,getBlockEditingMode:m,getBlockName:h,isFirstMultiSelectedBlock:f,getMultiSelectedBlockClientIds:g,hasSelectedInnerBlock:b,getBlockIndex:v,isTyping:k,isBlockMultiSelected:_,isBlockSubtreeDisabled:y,isBlockHighlighted:w,__unstableIsFullySelected:E,__unstableSelectionHasUnmergeableBlock:S,isBlockBeingDragged:C,hasBlockMovingClientId:x,canInsertBlockType:B,getBlockRootClientId:I,__unstableHasActiveBlockOverlayActive:T,__unstableGetEditorMode:P,getSelectedBlocksInitialCaretPosition:M}=pr(e(hr)),R=s(t);if(!R)return;const{hasBlockSupport:A,getActiveBlockVariation:N}=e(c.store),L=o(t),O=l(n),D=a(t,n),z=u(t,n),{name:F,attributes:V,isValid:H}=R,U=(0,c.getBlockType)(F),G=N(F,V),{outlineMode:$,supportsLayout:j}=d(),W=_(t),K=b(t,!0),Z=k(),q=U?.apiVersion>1,Y=x();return{mode:r(t),isSelectionEnabled:i(),isLocked:!!O,canRemove:D,canMove:z,block:R,name:F,attributes:V,isValid:H,isSelected:L,themeSupportsLayout:j,isTemporarilyEditingAsBlocks:p()===t,blockEditingMode:m(t),mayDisplayControls:L||f(t)&&g().every((e=>h(e)===F)),mayDisplayParentControls:A(h(t),"__experimentalExposeControlsToChildren",!1)&&b(t),index:v(t),blockApiVersion:U?.apiVersion||1,blockTitle:G?.title||U?.title,isSubtreeDisabled:y(t),isOutlineEnabled:$,hasOverlay:T(t),initialPosition:L&&"edit"===P()?M():void 0,isHighlighted:w(t),isMultiSelected:W,isPartiallySelected:W&&!E()&&!S(),isReusable:(0,c.isReusableBlock)(U),isDragging:C(t),hasChildSelected:K,removeOutline:L&&$&&Z,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&B(h(Y),I(t)),isEditingDisabled:"disabled"===m(t),className:q?V.className:void 0,defaultClassName:q?(0,c.getBlockDefaultClassName)(F):void 0}}),[t,n]),{mode:r,isSelectionEnabled:i,isLocked:l,canRemove:a,canMove:u,block:p,name:m,attributes:h,isValid:f,isSelected:g,themeSupportsLayout:b,isTemporarilyEditingAsBlocks:v,blockEditingMode:k,mayDisplayControls:_,mayDisplayParentControls:y,index:w,blockApiVersion:E,blockTitle:S,isSubtreeDisabled:C,isOutlineEnabled:x,hasOverlay:B,initialPosition:I,isHighlighted:T,isMultiSelected:P,isPartiallySelected:M,isReusable:R,isDragging:A,hasChildSelected:N,removeOutline:L,isBlockMovingMode:O,canInsertMovingBlock:D,isEditingDisabled:z,className:F,defaultClassName:V}=o;if(!o)return null;const H={clientId:t,className:F,index:w,mode:r,name:m,blockApiVersion:E,blockTitle:S,isSelected:g,isSubtreeDisabled:C,isOutlineEnabled:x,hasOverlay:B,initialPosition:I,blockEditingMode:k,isHighlighted:T,isMultiSelected:P,isPartiallySelected:M,isReusable:R,isDragging:A,hasChildSelected:N,removeOutline:L,isBlockMovingMode:O,canInsertMovingBlock:D,isEditingDisabled:z,isTemporarilyEditingAsBlocks:v,defaultClassName:V,mayDisplayControls:_,mayDisplayParentControls:y,themeSupportsLayout:b};return(0,s.createElement)(Sk.Provider,{value:H},(0,s.createElement)(Vk,{...e,mode:r,isSelectionEnabled:i,isLocked:l,canRemove:a,canMove:u,block:p,name:m,attributes:h,isValid:f,isSelected:g}))})),Gk=window.wp.htmlEntities;const $k=[(0,u.createInterpolateElement)((0,S.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,S.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,u.createInterpolateElement)((0,S.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,S.__)("Drag files into the editor to automatically insert media blocks."),(0,S.__)("Change a block's type by pressing the block icon on the toolbar.")];var jk=function(){const[e]=(0,u.useState)(Math.floor(Math.random()*$k.length));return(0,s.createElement)(ui.Tip,null,$k[e])},Wk=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Kk=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Zk=function({title:e,icon:t,description:n,blockType:o,className:r}){o&&(y()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=o));const{parentNavBlockClientId:i}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(hr);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:l}=(0,d.useDispatch)(hr);return(0,s.createElement)("div",{className:oi()("block-editor-block-card",r)},i&&(0,s.createElement)(ui.Button,{onClick:()=>l(i),label:(0,S.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,S.isRTL)()?Wk:Kk,size:"small"}),(0,s.createElement)(hh,{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)))},qk=(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,i]=(0,u.useState)(null);return(0,u.useEffect)((()=>{const e=(0,d.createRegistry)({},n);e.registerStore(cr,mr),i(e)}),[n]),r?(0,s.createElement)(d.RegistryProvider,{value:r},(0,s.createElement)(e,{registry:r,...o})):null}))),"withRegistryProvider");const Yk=()=>{};function Xk({clientId:e=null,value:t,selection:n,onChange:o=Yk,onInput:r=Yk}){const i=(0,d.useRegistry)(),{resetBlocks:l,resetSelection:s,replaceInnerBlocks:a,setHasControlledInnerBlocks:p,__unstableMarkNextChangeAsNotPersistent:m}=i.dispatch(hr),{getBlockName:h,getBlocks:f,getSelectionStart:g,getSelectionEnd:b}=i.select(hr),v=(0,d.useSelect)((t=>!e||t(hr).areInnerBlocksControlled(e)),[e]),k=(0,u.useRef)({incoming:null,outgoing:[]}),_=(0,u.useRef)(!1),y=()=>{t&&(m(),e?i.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),l(t)))},w=(0,u.useRef)(r),E=(0,u.useRef)(o);(0,u.useEffect)((()=>{w.current=r,E.current=o}),[r,o]),(0,u.useEffect)((()=>{k.current.outgoing.includes(t)?k.current.outgoing[k.current.outgoing.length-1]===t&&(k.current.outgoing=[]):f(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}=i.select(hr);let l=f(e),s=n(),a=!1;_.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===h(e))return;if(e&&!r(e))return;const i=n(),c=f(e),u=c!==l;if(l=c,u&&(k.current.incoming||o()))return k.current.incoming=null,void(s=i);if(u||a&&!u&&i&&!s){s=i,k.current.outgoing.push(l);const e=s?E.current:w.current,n=yn.has(l);n&&yn.delete(l),e(l,{selection:{selectionStart:g(),selectionEnd:b(),initialPosition:t()},undoIgnore:n})}a=u}),hr);return()=>{_.current=!1,c()}}),[i,e]),(0,u.useEffect)((()=>()=>{m(),e?(p(e,!1),m(),a(e,[])):l([])}),[])}var Qk=window.wp.keyboardShortcuts;function Jk(){return null}Jk.Register=function(){const{registerShortcut:e}=(0,d.useDispatch)(Qk.store);return(0,u.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,S.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,S.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,S.__)("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,S.__)("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,S.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,S.__)("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,S.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,S.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,S.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,S.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,S.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var e_=Jk;const t_=qk((e=>{const{children:t,settings:n,stripExperimentalSettings:o=!1}=e,{__experimentalUpdateSettings:r}=pr((0,d.useDispatch)(hr));return(0,u.useEffect)((()=>{r({...n,__internalIsInitialized:!0},{stripExperimentalSettings:o,reset:!0})}),[n,o,r]),Xk(e),(0,s.createElement)(ui.SlotFillProvider,{passthrough:!0},(0,s.createElement)(e_.Register,null),(0,s.createElement)(zu,null,t))}));var n_=e=>(0,s.createElement)(t_,{...e,stripExperimentalSettings:!0},e.children);function o_(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,d.useSelect)(hr),{clearSelectedBlock:o}=(0,d.useDispatch)(hr),{clearBlockSelection:r}=e();return(0,p.useRefEffect)((e=>{if(r)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(r){(t()||n())&&r.target===e&&o()}}),[t,n,o,r])}function r_(e){return(0,s.createElement)("div",{ref:o_(),...e})}function i_(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:l}=e(hr);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:i(),isFullSelection:l()}}function l_(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:i}=(0,d.useSelect)(i_,[]);return(0,p.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:s}=l;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||i&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,i])}function s_(e,t,n,o){let r,i=Es.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&Ik(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!Es.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 a_(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,d.useSelect)(hr),{selectBlock:i}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((l=>{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,f=c===xs.UP,g=c===xs.DOWN,b=c===xs.LEFT,v=c===xs.RIGHT,k=f||b,_=b||v,y=f||g,w=_||y,E=d||p||m||h,S=y?Es.isVerticalEdge:Es.isHorizontalEdge,{ownerDocument:C}=l,{defaultView:x}=C;if(!w)return;if(o()){if(d)return;if(!r())return;return a.preventDefault(),void(k?i(e()):i(t(),-1))}if(!function(e,t,n){const o=t===xs.UP||t===xs.DOWN,{tagName:r}=e,i=e.getAttribute("type");return o&&!n?"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(i):"INPUT"===r?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==r}(u,c,E))return;y?s||(s=(0,Es.computeCaretRect)(x)):s=null;const B=(0,Es.isRTL)(u)?!k:k,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=s_(e,t,l);return n&&Pk(n)})(u,k)&&S(u,k)&&(l.contentEditable=!0,l.focus());else if(!y||!(0,Es.isVerticalEdge)(u,k)||m&&!(0,Es.isHorizontalEdge)(u,B)||I){if(_&&x.getSelection().isCollapsed&&(0,Es.isHorizontalEdge)(u,B)&&!I){const e=s_(u,B,l);(0,Es.placeCaretAtHorizontalEdge)(e,k),a.preventDefault()}}else{const e=s_(u,k,l,!0);e&&((0,Es.placeCaretAtVerticalEdge)(e,m?!k:k,m?void 0:s),a.preventDefault())}}return l.addEventListener("mousedown",a),l.addEventListener("keydown",c),()=>{l.removeEventListener("mousedown",a),l.removeEventListener("keydown",c)}}),[])}function c_(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,d.useSelect)(hr),{multiSelect:o,selectBlock:r}=(0,d.useDispatch)(hr),i=(0,Qk.__unstableUseShortcutEventMatch)();return(0,p.useRefEffect)((l=>{function s(s){if(!i("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Es.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&&(l.ownerDocument.defaultView.getSelection().removeAllRanges(),r(u))}return l.addEventListener("keydown",s),()=>{l.removeEventListener("keydown",s)}}),[])}function u_(e,t){e.contentEditable=t,t&&e.focus()}function d_(){const{startMultiSelect:e,stopMultiSelect:t}=(0,d.useDispatch)(hr),{isSelectionEnabled:n,hasSelectedBlock:o,isDraggingBlocks:r,isMultiSelecting:i}=(0,d.useSelect)(hr);return(0,p.useRefEffect)((l=>{const{ownerDocument:s}=l,{defaultView:a}=s;let c,u;function d(){t(),a.removeEventListener("mouseup",d),u=a.requestAnimationFrame((()=>{if(!o())return;u_(l,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);c.contains(t)&&c.focus()}}))}function p({buttons:t,target:o}){r()||1===t&&(i()||l!==o&&"true"===o.getAttribute("contenteditable")&&n()&&(c=o,e(),a.addEventListener("mouseup",d),u_(l,!0)))}return l.addEventListener("mouseout",p),()=>{l.removeEventListener("mouseout",p),a.removeEventListener("mouseup",d),a.cancelAnimationFrame(u)}}),[e,t,n,o])}function p_(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function m_(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function h_(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,d.useDispatch)(hr),{getBlockParents:o,getBlockSelectionStart:r,isMultiSelecting:i}=(0,d.useSelect)(hr);return(0,p.useRefEffect)((l=>{const{ownerDocument:s}=l,{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(!l.contains(u)||!l.contains(d))return;const p=s.shiftKey&&"mouseup"===s.type;if(c.isCollapsed&&!p){if("true"===l.contentEditable&&!i()){p_(l,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let m=Pk(u),h=Pk(d);if(p){const e=r(),t=Pk(s.target),n=t!==h;(m===h&&c.isCollapsed||!h||n)&&(h=t),m!==e&&(m=e)}if(void 0!==m||void 0!==h)if(m===h)i()?e(m,m):t(m);else{const t=[...o(m),m],r=[...o(h),h],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[i]!==m||r[i]!==h)return void e(t[i],r[i]);const l=m_(u),s=m_(d);if(l&&s){var f,g;const e=c.getRangeAt(0),t=(0,Z.create)({element:l,range:e,__unstableIsEditableTree:!0}),o=(0,Z.create)({element:s,range:e,__unstableIsEditableTree:!0}),r=null!==(f=t.start)&&void 0!==f?f:t.end,i=null!==(g=o.start)&&void 0!==g?g:o.end;n({start:{clientId:m,attributeKey:l.dataset.wpBlockAttributeKey,offset:r},end:{clientId:h,attributeKey:s.dataset.wpBlockAttributeKey,offset:i}})}else e(m,h)}else p_(l,!1)}return s.addEventListener("selectionchange",c),a.addEventListener("mouseup",c),()=>{s.removeEventListener("selectionchange",c),a.removeEventListener("mouseup",c)}}),[e,t,n,o])}function f_(){const{selectBlock:e}=(0,d.useDispatch)(hr),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,d.useSelect)(hr);return(0,p.useRefEffect)((r=>{function i(i){if(!t()||0!==i.button)return;const l=n(),s=Pk(i.target);i.shiftKey?l!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",i),()=>{r.removeEventListener("mousedown",i)}}),[e,t,n,o])}function g_(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,d.useSelect)(hr),{replaceBlocks:r,__unstableSplitSelection:i,removeBlocks:l,__unstableDeleteSelection:s,__unstableExpandSelection:a}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((u=>{function d(e){"true"===u.contentEditable&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===xs.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?r(t(),(0,c.createBlock)((0,c.getDefaultBlockName)())):i()):d.keyCode===xs.BACKSPACE||d.keyCode===xs.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?l(t()):n()?s(d.keyCode===xs.DELETE):a()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?s(d.keyCode===xs.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 b_({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=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("<meta charset='utf-8'>")?e.slice(22):e}(n);const o=(0,Es.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:[]}}function v_(){const{getBlockName:e}=(0,d.useSelect)(hr),{getBlockType:t}=(0,d.useSelect)(c.store),{createSuccessNotice:n}=(0,d.useDispatch)(Ss.store);return(0,u.useCallback)(((o,r)=>{let i="";if(1===r.length){const n=r[0],l=t(e(n))?.title;i="copy"===o?(0,S.sprintf)(
// Translators: Name of the block being copied, e.g. "Paragraph".
(0,S.__)('Copied "%s" to clipboard.'),l):(0,S.sprintf)(
// Translators: Name of the block being cut, e.g. "Paragraph".
(0,S.__)('Moved "%s" to clipboard.'),l)}else i="copy"===o?(0,S.sprintf)(
// Translators: %d: Number of blocks being copied.
(0,S._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,S.sprintf)(
// Translators: %d: Number of blocks being cut.
(0,S._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(i,{type:"snackbar"})}),[])}function k_(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:r,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:s,canInsertBlockType:a}=(0,d.useSelect)(hr),{flashBlock:u,removeBlocks:m,replaceBlocks:h,__unstableDeleteSelection:f,__unstableExpandSelection:g,insertBlocks:b}=(0,d.useDispatch)(hr),v=v_();return(0,p.useRefEffect)((d=>{function p(p){if(p.defaultPrevented)return;const k=t();if(0===k.length)return;if(!n()){const{target:e}=p,{ownerDocument:t}=e;if("copy"===p.type||"cut"===p.type?(0,Es.documentHasUncollapsedSelection)(t):(0,Es.documentHasSelection)(t))return}if(!d.contains(p.target.ownerDocument.activeElement))return;p.preventDefault();const _=l(),y=i()||r(),w=!y&&!_;if("copy"===p.type||"cut"===p.type)if(1===k.length&&u(k[0]),w)g();else{let t;if(v(p.type,k),y)t=e(k);else{const[n,o]=s();t=[n,...e(k.slice(1,k.length-1)),o]}const n=p.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,c.createBlock)(n,JSON.parse(p.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,c.serialize)(t);p.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,Es.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),p.clipboardData.setData("text/html",o)}var E;if("cut"===p.type)y&&!w?m(k):(p.target.ownerDocument.activeElement.contentEditable=!1,f());else if("paste"===p.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n,files:r}=b_(p);let i=[];if(r.length){const e=(0,c.getBlockTransforms)("from");i=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 i=(0,c.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});if(1===k.length){const[e]=k;if(i.every((t=>a(t.name,e))))return void b(i,void 0,e)}h(k,i,i.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 y_(){const[e,t,n]=function(){const e=(0,u.useRef)(),t=(0,u.useRef)(),n=(0,u.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:r,getBlockCount:i}=(0,d.useSelect)(hr),{setNavigationMode:l,setLastFocus:a}=pr((0,d.useDispatch)(hr)),c=(0,d.useSelect)((e=>e(hr).isNavigationMode()),[]),{getLastFocus:m}=pr((0,d.useSelect)(hr)),h=c?void 0:"0",f=(0,u.useRef)();function g(t){if(f.current)f.current=null;else if(o())e.current.focus();else if(r())m()?.current.focus();else{l(!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=Es.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:g}),v=(0,s.createElement)("div",{ref:n,tabIndex:h,onFocus:g}),k=(0,p.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===xs.ESCAPE&&!o())return e.preventDefault(),void l(!0);if(e.keyCode!==xs.TAB)return;const i=e.shiftKey,a=i?"findPrevious":"findNext";if(!o()&&!r())return void(e.target===s&&l(!0));const c=Es.focus.tabbable[a](e.target),u=e.target.closest("[data-block]"),d=u&&c&&(Ik(u,c)||Tk(u,c));if((0,Es.isFormElement)(c)&&d)return;const p=i?t:n;f.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!==i()||s.focus()}function d(o){if(o.keyCode!==xs.TAB)return;if("region"===o.target?.getAttribute("role"))return;if(e.current===o.target)return;const r=o.shiftKey?"findPrevious":"findNext",i=Es.focus.tabbable[r](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.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(hr).hasMultiSelection()),[]);return[e,(0,p.useMergeRefs)([t,k_(),g_(),d_(),h_(),f_(),l_(),c_(),a_(),(0,p.useRefEffect)((e=>{if(e.tabIndex=0,o)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,S.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[o])]),n]}var w_=(0,u.forwardRef)((function({children:e,...t},n){const[o,r,i]=y_();return(0,s.createElement)(s.Fragment,null,o,(0,s.createElement)("div",{...t,ref:(0,p.useMergeRefs)([r,n]),className:oi()(t.className,"block-editor-writing-flow")},e),i)}));function E_(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 S_(e){return(0,p.useRefEffect)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,o=e.documentElement,r=["dragover","mousemove"],i={};for(const e of r)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;E_(e,window[t],n)},o.addEventListener(e,i[e]);return()=>{for(const e of r)o.removeEventListener(e,i[e])}}))}function C_({contentRef:e,children:t,tabIndex:n=0,scale:o=1,frameSize:r=0,expand:i=!1,readonly:l,forwardedRef:a,...c}){const{resolvedAssets:m,isPreviewMode:h}=(0,d.useSelect)((e=>{const t=e(hr).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.__unstableIsPreviewMode}}),[]),{styles:f="",scripts:g=""}=m,[b,v]=(0,u.useState)(),[k,_]=(0,u.useState)([]),y=(0,u.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:o}=t;if(null===n)return e;if(!o)return e;if("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}),[])),[]),w=o_(),[E,C,x]=y_(),[B,{height:I}]=(0,p.useResizeObserver)(),T=(0,p.useRefEffect)((e=>{let t;function n(e){e.preventDefault()}function o(){const{contentDocument:o,ownerDocument:r}=e,{documentElement:i}=o;t=o,w(i),_(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 y)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)}}),[]),P=(0,p.useDisabled)({isDisabled:!l}),M=(0,p.useMergeRefs)([S_(b),e,w,C,P]),R=`<!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${f}\n\t\t${g}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[A,N]=(0,u.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([R],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[R]);(0,u.useEffect)((()=>N),[N]);const L=I*(1-o)/2;return(0,s.createElement)(s.Fragment,null,n>=0&&E,(0,s.createElement)("iframe",{...c,style:{border:0,...c.style,height:i?I: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,T]),tabIndex:n,src:A,title:(0,S.__)("Editor canvas"),onKeyDown:e=>{e.currentTarget.ownerDocument!==e.target.ownerDocument&&(e.stopPropagation(),E_(e,window.KeyboardEvent,e.currentTarget))}},b&&(0,u.createPortal)((0,s.createElement)("body",{ref:M,className:oi()("block-editor-iframe__body","editor-styles-wrapper",...k)},B,(0,s.createElement)(ui.__experimentalStyleProvider,{document:b},t)),b.documentElement)),n>=0&&x)}var x_=(0,u.forwardRef)((function(e,t){return(0,d.useSelect)((e=>e(hr).getSettings().__internalIsInitialized),[])?(0,s.createElement)(C_,{...e,forwardedRef:t}):null})),B_=n(2438),I_=B_;B_.stringify,B_.fromJSON,B_.plugin,B_.parse,B_.list,B_.document,B_.comment,B_.atRule,B_.rule,B_.decl,B_.root;const T_=B_.CssSyntaxError;B_.Declaration,B_.Container,B_.Processor,B_.Document,B_.Comment,B_.Warning,B_.AtRule,B_.Result,B_.Input,B_.Rule,B_.Root,B_.Node;var P_=n(5959),M_=n.n(P_),R_=n(7036),A_=n.n(R_),N_=(e,t="")=>e.map((({css:e,ignoredSelectors:n=[],baseURL:o})=>{if(!t&&!o)return e;try{return I_([t&&M_()(t,{ignoredSelectors:[...n,t]}),o&&A_()({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(e){return e instanceof T_?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}}));function L_(e,t){return(0,u.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:o,body:r}=n,i=t?n.querySelector(t):r;let l;if(i)l=o?.getComputedStyle(i,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),l=o?.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const s=yc(l);s.luminance()>.5||0===s.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e,t])}function O_({styles:e,scope:t}){const n=(0,d.useSelect)((e=>pr(e(hr)).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[N_(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:L_(o,t)}),o.map(((e,t)=>(0,s.createElement)("style",{key:t},e))),(0,s.createElement)(ui.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 D_;Ec([Sc,Bc]);const z_=2e3;function F_({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:o=[]}){e||(e=t);const[r,{height:i}]=(0,p.useResizeObserver)(),{styles:l}=(0,d.useSelect)((e=>({styles:e(hr).getSettings().styles})),[]),a=(0,u.useMemo)((()=>l?[...l,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:l),[l,o]);D_=D_||(0,p.pure)(oE);const c=t/e,m=i?t/(i*c):0;return(0,s.createElement)(ui.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${c})`,aspectRatio:m,maxHeight:i>z_?z_*c:void 0,minHeight:n}},(0,s.createElement)(x_,{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:i,pointerEvents:"none",maxHeight:z_,minHeight:0!==c&&c<1&&n?n/c:n}},(0,s.createElement)(O_,{styles:a}),r,(0,s.createElement)(D_,{renderAppender:!1})))}function V_(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)(F_,{...e,containerWidth:n})))}var H_=(0,u.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:o=[],__experimentalMinHeight:r,__experimentalPadding:i}){r&&(n=r,y()("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(o=[...o,{css:`body { padding: ${i}px; }`}],y()("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const l=(0,d.useSelect)((e=>e(hr).getSettings()),[]),a=(0,u.useMemo)((()=>({...l,__unstableIsPreviewMode:!0})),[l]),c=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,s.createElement)(t_,{value:c,settings:a},(0,s.createElement)(V_,{viewportWidth:t,minHeight:n,additionalStyles:o})):null}));function U_({blocks:e,props:t={},layout:n}){const o=(0,d.useSelect)((e=>e(hr).getSettings()),[]),r=(0,u.useMemo)((()=>({...o,styles:void 0,__unstableIsPreviewMode:!0})),[o]),i=(0,p.useDisabled)(),l=(0,p.useMergeRefs)([t.ref,i]),a=(0,u.useMemo)((()=>Array.isArray(e)?e:[e]),[e]),c=(0,s.createElement)(t_,{value:a,settings:r},(0,s.createElement)(O_,null),(0,s.createElement)(iE,{renderAppender:!1,layout:n}));return{...t,ref:l,className:oi()(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?c:null}}var G_=function({item:e}){var t;const{name:n,title:o,icon:r,description:i,initialAttributes:l,example:a}=e,d=(0,c.isReusableBlock)(e),p=(0,u.useMemo)((()=>a?(0,c.getBlockFromExample)(n,{attributes:{...a.attributes,...l},innerBlocks:a.innerBlocks}):(0,c.createBlock)(n,l)),[n,a,l]);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)(H_,{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,S.__)("No preview available."))),!d&&(0,s.createElement)(Zk,{title:o,icon:r,description:i}))};const{CompositeItemV2:$_}=pr(ui.privateApis);var j_=(0,u.forwardRef)((function({isFirst:e,as:t,children:n,...o},r){return(0,s.createElement)($_,{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)(ui.Button,{...r},n)}})})),W_=(0,s.createElement)(W.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function K_({count:e,icon:t,isPattern:n,fadeWhenDisabled:o}){const r=n&&(0,S.__)("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)(ui.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(ui.FlexItem,null,t?(0,s.createElement)(hh,{icon:t}):r||(0,S.sprintf)(/* translators: %d: Number of blocks. */
(0,S._n)("%d block","%d blocks",e),e)),(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(hh,{icon:W_})),o&&(0,s.createElement)(ui.FlexItem,{className:"block-editor-block-draggable-chip__disabled"},(0,s.createElement)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})))))}var Z_=({isEnabled:e,blocks:t,icon:n,children:o,pattern:r})=>{const i={type:"inserter",blocks:t},l=(0,d.useSelect)((e=>{const{getBlockType:n}=e(c.store);return 1===t.length&&n(t[0].name)?.icon}),[t]);return(0,s.createElement)(ui.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:i,onDragStart:e=>{const n=r?.type===q.user&&"unsynced"!==r?.syncStatus?[(0,c.createBlock)("core/block",{ref:r.id})]:t;e.dataTransfer.setData("text/html",(0,c.serialize)(n))},__experimentalDragComponent:(0,s.createElement)(K_,{count:t.length,icon:n||!r&&l,isPattern:!!r})},(({onDraggableStart:t,onDraggableEnd:n})=>o({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})))},q_=(0,u.memo)((function({className:e,isFirst:t,item:n,onSelect:o,onHover:r,isDraggable:i,...l}){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)(Z_,{isEnabled:i&&!n.isDisabled,blocks:p,icon:n.icon},(({draggable:i,onDragStart:c,onDragEnd:u})=>(0,s.createElement)("div",{className:oi()("block-editor-block-types-list__list-item",{"is-synced":m}),draggable:i,onDragStart:e=>{a.current=!0,c&&(r(null),c(e))},onDragEnd:e=>{a.current=!1,u&&u(e)}},(0,s.createElement)(j_,{isFirst:t,className:oi()("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),o(n,(0,xs.isAppleOS)()?e.metaKey:e.ctrlKey),r(null)},onKeyDown:e=>{const{keyCode:t}=e;t===xs.ENTER&&(e.preventDefault(),o(n,(0,xs.isAppleOS)()?e.metaKey:e.ctrlKey),r(null))},onMouseEnter:()=>{a.current||r(n)},onMouseLeave:()=>r(null),...l},(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:d},(0,s.createElement)(hh,{icon:n.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(ui.__experimentalTruncate,{numberOfLines:3},n.title))))))})),Y_=(0,u.forwardRef)((function(e,t){const[n,o]=(0,u.useState)(!1);return(0,u.useEffect)((()=>{n&&(0,Zn.speak)((0,S.__)("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})}));const{CompositeGroupV2:X_}=pr(ui.privateApis);var Q_=(0,u.forwardRef)((function(e,t){return(0,s.createElement)(X_,{role:"presentation",ref:t,...e})})),J_=function e({items:t=[],onSelect:n,onHover:o=(()=>{}),children:r,label:i,isDraggable:l=!0}){const a="block-editor-block-types-list",u=(0,p.useInstanceId)(e,a);return(0,s.createElement)(Y_,{className:a,"aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(Q_,{key:t},e.map(((e,r)=>(0,s.createElement)(q_,{key:e.id,item:e,className:(0,c.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:l&&!e.isDisabled,isFirst:0===t&&0===r,rowId:`${u}-${t}`})))))),r)},ey=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)(ui.Icon,{icon:t})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},n))};const{CompositeV2:ty,useCompositeStoreV2:ny}=pr(ui.privateApis);var oy=function({children:e}){const t=ny({focusShift:!0,focusWrap:"horizontal"});return(0,s.createElement)(ty,{store:t,render:(0,s.createElement)(s.Fragment,null)},e)};const ry=[];var iy=function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:o}){const[r,i,l,a]=cf(e,t),c=(0,u.useMemo)((()=>re(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={...l};return Object.keys(l).forEach((t=>{e[t]=r.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[r,l]);(0,u.useEffect)((()=>()=>n(null)),[]);const f=(0,p.useAsyncList)(i),g=i.length===f.length,b=(0,u.useMemo)((()=>Object.entries(l)),[l]),v=(0,p.useAsyncList)(g?b:ry);return(0,s.createElement)(oy,null,(0,s.createElement)("div",null,o&&!!c.length&&(0,s.createElement)(ey,{title:(0,S._x)("Most used","blocks")},(0,s.createElement)(J_,{items:c,onSelect:a,onHover:n,label:(0,S._x)("Most used","blocks")})),f.map((e=>{const t=m[e.slug];return t&&t.length?(0,s.createElement)(ey,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(J_,{items:t,onSelect:a,onHover:n,label:e.title})):null})),g&&d.length>0&&(0,s.createElement)(ey,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,S.__)("Uncategorized")},(0,s.createElement)(J_,{items:d,onSelect:a,onHover:n,label:(0,S.__)("Uncategorized")})),v.map((([e,t])=>{const o=h[e];return o&&o.length?(0,s.createElement)(ey,{key:e,title:t.title,icon:t.icon},(0,s.createElement)(J_,{items:o,onSelect:a,onHover:n,label:t.title})):null}))))};function ly({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)(ui.Button,{key:t,label:r,className:`${o}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)}},r))))}function sy({searchValue:e,setSearchValue:t}){return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(ui.SearchControl,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,S.__)("Search for patterns"),placeholder:(0,S.__)("Search")}))}var ay=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)(sy,{searchValue:o,setSearchValue:r}),!o&&(0,s.createElement)(ly,{selectedCategory:e,patternCategories:t,onClickCategory:n}))};function cy({currentPage:e,numPages:t,changePage:n,totalItems:o}){return(0,s.createElement)(ui.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper"},(0,s.createElement)(ui.__experimentalText,{variant:"muted"},
// translators: %s: Total number of patterns.
(0,S.sprintf)(
// translators: %s: Total number of patterns.
(0,S._n)("%s item","%s items",o),o)),t>1&&(0,s.createElement)(ui.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination"},(0,s.createElement)(ui.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous"},(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,S.__)("First page")},(0,s.createElement)("span",null,"«")),(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,S.__)("Previous page")},(0,s.createElement)("span",null,"‹"))),(0,s.createElement)(ui.__experimentalText,{variant:"muted"},(0,S.sprintf)(
// translators: %1$s: Current page number, %2$s: Total number of pages.
(0,S._x)("%1$s of %2$s","paging"),e,t)),(0,s.createElement)(ui.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next"},(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,S.__)("Next page")},(0,s.createElement)("span",null,"›")),(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,S.__)("Last page"),size:"default"},(0,s.createElement)("span",null,"»")))))}const{CompositeV2:uy,CompositeItemV2:dy,useCompositeStoreV2:py}=pr(ui.privateApis),my=({showTooltip:e,title:t,children:n})=>e?(0,s.createElement)(ui.Tooltip,{text:t},n):(0,s.createElement)(s.Fragment,null,n);function hy({id:e,isDraggable:t,pattern:n,onClick:o,onHover:r,showTooltip:i}){const[l,a]=(0,u.useState)(!1),{blocks:c,viewportWidth:d}=n,m=`block-editor-block-patterns-list__item-description-${(0,p.useInstanceId)(hy)}`;return(0,s.createElement)(Z_,{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)(my,{showTooltip:i&&!n.type!==q.user,title:n.title},(0,s.createElement)(dy,{render:(0,s.createElement)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?m:void 0,className:oi()("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===q.user&&!n.syncStatus})}),id:e,onClick:()=>{o(n,c),r?.(null)},onMouseEnter:()=>{l||r?.(n)},onMouseLeave:()=>r?.(null)},(0,s.createElement)(H_,{blocks:c,viewportWidth:d}),(0,s.createElement)(ui.__experimentalHStack,{className:"block-editor-patterns__pattern-details"},n.type===q.user&&!n.syncStatus&&(0,s.createElement)("div",{className:"block-editor-patterns__pattern-icon-wrapper"},(0,s.createElement)(kl,{className:"block-editor-patterns__pattern-icon",icon:K})),(!i||n.type===q.user)&&(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title)),!!n.description&&(0,s.createElement)(ui.VisuallyHidden,{id:m},n.description))))))}function fy(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var gy=(0,u.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:o,onClickPattern:r,orientation:i,label:l=(0,S.__)("Block patterns"),showTitlesAsTooltip:a,pagingProps:c},d){const p=py({orientation:i}),{setActiveId:m}=p;return(0,u.useEffect)((()=>{m(void 0)}),[m,n,t]),(0,s.createElement)(uy,{store:p,role:"listbox",className:"block-editor-block-patterns-list","aria-label":l,ref:d},t.map((t=>n.includes(t)?(0,s.createElement)(hy,{key:t.name,id:t.name,pattern:t,onClick:r,onHover:o,isDraggable:e,showTooltip:a}):(0,s.createElement)(fy,{key:t.name}))),c&&(0,s.createElement)(cy,{...c}))})),by=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:o,onSelect:r,shouldFocusBlock:i=!0,selectBlockOnInsert:l=!0}){const{getSelectedBlock:s}=(0,d.useSelect)(hr),{destinationRootClientId:a,destinationIndex:p}=(0,d.useSelect)((r=>{const{getSelectedBlockClientId:i,getBlockRootClientId:l,getBlockIndex:s,getBlockOrder:a}=r(hr),c=i();let u,d=e;return void 0!==t?u=t:n?u=s(n):!o&&c?(d=l(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,o]),{replaceBlocks:m,insertBlocks:h,showInsertionPoint:f,hideInsertionPoint:g}=(0,d.useDispatch)(hr),b=(0,u.useCallback)(((e,t,n=!1)=>{const u=s();!o&&u&&(0,c.isUnmodifiedDefaultBlock)(u)?m(u.clientId,e,null,i||n?0:null,t):h(e,p,a,l,i||n?0:null,t);const d=Array.isArray(e)?e.length:1,f=(0,S.sprintf)(
// translators: %d: the name of the block that has been added
(0,S._n)("%d block added.","%d blocks added.",d),d);(0,Zn.speak)(f),r&&r(e)}),[o,s,m,h,a,p,r,i,l]),v=(0,u.useCallback)((e=>{e?f(a,p):g()}),[f,g,a,p]);return[a,b,v]},vy=(e,t)=>{const{patternCategories:n,patterns:o,userPatternCategories:r}=(0,d.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(hr),{__experimentalUserPatternCategories:r,__experimentalBlockPatternCategories:i}=o();return{patterns:n(t),userPatternCategories:r,patternCategories:i}}),[t]),i=(0,u.useMemo)((()=>{const e=[...n];return r?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[n,r]),{createSuccessNotice:l}=(0,d.useDispatch)(Ss.store),s=(0,u.useCallback)(((t,n)=>{const o=t.type===q.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),l((0,S.sprintf)(/* translators: %s: block pattern title. */
(0,S.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[l,e]);return[o,i,s]};const ky=20,_y=5;function yy(e,t,n,o=""){const[r,i]=(0,u.useState)(1),l=(0,p.usePrevious)(t),s=(0,p.usePrevious)(o);l===t&&s===o||1===r||i(1);const a=e.length,c=r-1,d=(0,u.useMemo)((()=>e.slice(c*ky,c*ky+ky)),[c,e]),m=(0,p.useAsyncList)(d,{step:_y}),h=Math.ceil(e.length/ky);return(0,u.useEffect)((function(){const e=(0,Es.getScrollContainer)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:a,categoryPatterns:d,categoryPatternsAsyncList:m,numPages:h,changePage:e=>{const t=(0,Es.getScrollContainer)(n?.current);t?.scrollTo(0,0),i(e)},currentPage:r}}function wy({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,s.createElement)(ui.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,S.sprintf)(/* translators: %d: number of patterns. */
(0,S._n)("%d pattern found","%d patterns found",t),t)):null}var Ey=function({searchValue:e,selectedCategory:t,patternCategories:n}){const o=(0,u.useRef)(),r=(0,p.useDebounce)(Zn.speak,500),[i,l]=by({shouldFocusBlock:!0}),[a,,c]=vy(l,i),d=(0,u.useMemo)((()=>n.map((e=>e.name))),[n]),m=(0,u.useMemo)((()=>{const n=a.filter((e=>{if(t===X.name)return!0;if(t===Q.name&&e.type===q.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?sf(n,e):n}),[e,a,t,d]);(0,u.useEffect)((()=>{if(!e)return;const t=m.length,n=(0,S.sprintf)(/* translators: %d: number of results. */
(0,S._n)("%d result found.","%d results found.",t),t);r(n)}),[e,r,m.length]);const h=yy(m,t,o),[f,g]=(0,u.useState)(e);e!==f&&(g(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)(wy,{filterValue:e,filteredBlockPatternsLength:m.length}),(0,s.createElement)(oy,null,b&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(gy,{shownPatterns:h.categoryPatternsAsyncList,blockPatterns:h.categoryPatterns,onClickPattern:c,isDraggable:!1}),(0,s.createElement)(cy,{...h}))))};function Sy(e,t="all"){const[n,o]=vy(void 0,e),r=(0,u.useMemo)((()=>"all"===t?n:n.filter((e=>!J(e,t)))),[t,n]),i=(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,S._x)("Uncategorized")}),r.some((e=>e.type===q.user))&&e.unshift(Q),r.length>0&&e.unshift({name:X.name,label:X.label}),(0,Zn.speak)((0,S.sprintf)(/* translators: %d: number of categories . */
(0,S._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[o,r]);return i}function Cy({initialCategory:e,rootClientId:t}){const[n,o]=(0,u.useState)(""),[r,i]=(0,u.useState)("all"),[l,a]=(0,u.useState)(e?.name),c=Sy(t,r);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(ay,{selectedCategory:l,patternCategories:c,onClickCategory:a,searchValue:n,setSearchValue:o,patternSourceFilter:r,setPatternSourceFilter:i}),(0,s.createElement)(Ey,{searchValue:n,selectedCategory:l,patternCategories:c,patternSourceFilter:r}))}var xy=function({onModalClose:e,...t}){return(0,s.createElement)(ui.Modal,{title:(0,S.__)("Patterns"),onRequestClose:e,isFullScreen:!0},(0,s.createElement)(Cy,{...t}))};function By({title:e}){return(0,s.createElement)(ui.__experimentalVStack,{spacing:0},(0,s.createElement)(ui.__experimentalView,null,(0,s.createElement)(ui.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3},(0,s.createElement)(ui.__experimentalHStack,{spacing:2},(0,s.createElement)(ui.__experimentalNavigatorBackButton,{style:{minWidth:24,padding:0},icon:(0,S.isRTL)()?Wk:Kk,isSmall:!0,"aria-label":(0,S.__)("Navigate to the previous view")}),(0,s.createElement)(ui.__experimentalSpacer,null,(0,s.createElement)(ui.__experimentalHeading,{level:5},e))))))}function Iy({categories:e,children:t}){return(0,s.createElement)(ui.__experimentalNavigatorProvider,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,s.createElement)(ui.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(ui.__experimentalItemGroup,null,e.map((e=>(0,s.createElement)(ui.__experimentalNavigatorButton,{key:e.name,path:`/category/${e.name}`,as:ui.__experimentalItem,isAction:!0},(0,s.createElement)(ui.__experimentalHStack,null,(0,s.createElement)(ui.FlexBlock,null,e.label),(0,s.createElement)(kl,{icon:(0,S.isRTL)()?Kk:Wk}))))))),e.map((e=>(0,s.createElement)(ui.__experimentalNavigatorScreen,{key:e.name,path:`/category/${e.name}`},(0,s.createElement)(By,{title:(0,S.__)("Back")}),t(e)))))}const Ty=e=>"all"!==e,Py=e=>e.name===Q.name;function My({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:o,scrollContainerRef:r,category:i}){const l=i.name===Q.name?q.user:o,a=Ty(l),c=Py(i),d=(0,u.useMemo)((()=>[{value:"all",label:(0,S._x)("All","Option that shows all patterns")},{value:Y.full,label:(0,S._x)("Synced","Option that shows all synchronized patterns"),disabled:a},{value:Y.unsynced,label:(0,S._x)("Not synced","Option that shows all patterns that are not synchronized"),disabled:a}]),[a]),p=(0,u.useMemo)((()=>[{value:"all",label:(0,S.__)("All"),disabled:c},{value:q.directory,label:(0,S.__)("Pattern Directory"),disabled:c},{value:q.theme,label:(0,S.__)("Theme & Plugins"),disabled:c},{value:q.user,label:(0,S.__)("User")}]),[c]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.DropdownMenu,{popoverProps:{placement:"right-end"},label:"Filter patterns",icon:(0,s.createElement)(kl,{icon:(0,s.createElement)(ui.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(ui.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"#1E1E1E"}))})},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Source")},(0,s.createElement)(ui.MenuItemsChoice,{choices:p,onSelect:n=>{var o;t(o=n),Ty(o)&&e("all"),r.current?.scrollTo(0,0)},value:l})),(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Type")},(0,s.createElement)(ui.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,S.__)("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)(ui.ExternalLink,{href:(0,S.__)("https://wordpress.org/patterns/")})}))))))}const Ry=()=>{};function Ay({rootClientId:e,onInsert:t,onHover:n=Ry,category:o,showTitlesAsTooltip:r}){const[i,,l]=vy(t,e),[a,c]=(0,u.useState)("all"),[d,p]=(0,u.useState)("all"),m=Sy(e,d),h=(0,u.useRef)(),f=(0,u.useMemo)((()=>i.filter((e=>!J(e,d,a)&&(o.name===X.name||o.name===Q.name&&e.type===q.user||("uncategorized"===o.name?!e.categories||!e.categories.some((e=>m.some((t=>t.name===e)))):e.categories?.includes(o.name)))))),[i,m,o.name,d,a]),g=yy(f,o,h),{changePage:b}=g;(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)(ui.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header"},(0,s.createElement)(ui.__experimentalHStack,null,(0,s.createElement)(ui.FlexBlock,null,(0,s.createElement)(ui.__experimentalHeading,{level:4,as:"div"},o.label)),(0,s.createElement)(My,{patternSyncFilter:a,patternSourceFilter:d,setPatternSyncFilter:v,setPatternSourceFilter:k,scrollContainerRef:h,category:o})),!f.length&&(0,s.createElement)(ui.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results"},(0,S.__)("No results found"))),f.length>0&&(0,s.createElement)(gy,{ref:h,shownPatterns:g.categoryPatternsAsyncList,blockPatterns:g.categoryPatterns,onClickPattern:l,onHover:n,label:o.label,orientation:"vertical",category:o.name,isDraggable:!0,showTitlesAsTooltip:r,patternFilter:d,pagingProps:g}))}var Ny=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:o}){const[r,i]=(0,u.useState)(!1),l=Sy(o),a=t||l[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,S.__)("Block pattern categories"),className:"block-editor-inserter__block-patterns-tabs"},(0,s.createElement)(ui.__experimentalItemGroup,{role:"list"},l.map((n=>(0,s.createElement)(ui.__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)(ui.__experimentalHStack,null,(0,s.createElement)(ui.FlexBlock,null,n.label),(0,s.createElement)(kl,{icon:(0,S.isRTL)()?Kk:Wk}))))),(0,s.createElement)("div",{role:"listitem"},(0,s.createElement)(ui.Button,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>i(!0),variant:"secondary"},(0,S.__)("Explore all patterns")))))),c&&(0,s.createElement)(Iy,{categories:l},(e=>(0,s.createElement)(Ay,{key:e.name,onInsert:n,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),r&&(0,s.createElement)(xy,{initialCategory:a,patternCategories:l,onModalClose:()=>i(!1),rootClientId:o}))};function Ly({rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:i}){const l=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Es.focus.tabbable.find(l.current);e?.focus()}));return()=>clearTimeout(e)}),[o]),(0,s.createElement)("div",{ref:l,className:"block-editor-inserter__patterns-category-dialog"},(0,s.createElement)(Ay,{key:o.name,rootClientId:e,onInsert:t,onHover:n,category:o,showTitlesAsTooltip:r,patternFilter:i}))}function Oy(e){const[t,n]=(0,u.useState)([]),o=(0,d.useSelect)((e=>pr(e(hr)).getInserterMediaCategories()),[]),{canInsertImage:r,canInsertVideo:i,canInsertAudio:l}=(0,d.useSelect)((t=>{const{canInsertBlockType:n}=t(hr);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:i,audio:l};o.forEach((n=>{s[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,i,l,o]),t}var Dy=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"}));const zy={image:"img",video:"video",audio:"audio"};function Fy(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 i=zy[t],l=(0,s.createElement)(i,{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),l]}const Vy=["image"],Hy={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"},{CompositeItemV2:Uy}=pr(ui.privateApis);function Gy({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,s.createElement)(ui.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,S.__)("Options"),popoverProps:Hy,icon:Lf},(()=>(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(ui.MenuItem,{onClick:()=>window.open(n,"_blank").focus(),icon:Dy},(0,S.sprintf)(/* translators: %s: The media type to report e.g: "image", "video", "audio" */
(0,S.__)("Report %s"),e.mediaType)))))}function $y({onClose:e,onSubmit:t}){return(0,s.createElement)(ui.Modal,{title:(0,S.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,s.createElement)(ui.__experimentalVStack,{spacing:3},(0,s.createElement)("p",null,(0,S.__)("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,S.__)("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)(ui.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:e},(0,S.__)("Cancel"))),(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(ui.Button,{variant:"primary",onClick:t},(0,S.__)("Insert")))))}function jy({media:e,onClick:t,category:n}){const[o,r]=(0,u.useState)(!1),[i,l]=(0,u.useState)(!1),[a,p]=(0,u.useState)(!1),[m,h]=(0,u.useMemo)((()=>Fy(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:f,createSuccessNotice:g}=(0,d.useDispatch)(Ss.store),b=(0,d.useSelect)((e=>e(hr).getSettings().mediaUpload),[]),v=(0,u.useCallback)((e=>{if(a)return;const n=(0,c.cloneBlock)(e),{id:o,url:i,caption:l}=n.attributes;o?t(n):(p(!0),window.fetch(i).then((e=>e.blob())).then((e=>{b({filesList:[e],additionalData:{caption:l},onFileChange([e]){(0,ws.isBlobURL)(e.url)||(t({...n,attributes:{...n.attributes,id:e.id,url:e.url}}),g((0,S.__)("Image uploaded and inserted."),{type:"snackbar"}),p(!1))},allowedTypes:Vy,onError(e){f(e,{type:"snackbar"}),p(!1)}})})).catch((()=>{r(!0),p(!1)})))}),[a,t,b,f,g]),k=e.title?.rendered||e.title;let _;if(k.length>25){const e="...";_=k.slice(0,25-e.length)+e}const y=(0,u.useCallback)((()=>l(!0)),[]),w=(0,u.useCallback)((()=>l(!1)),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Z_,{isEnabled:!0,blocks:[m]},(({draggable:t,onDragStart:o,onDragEnd:r})=>(0,s.createElement)("div",{className:oi()("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:o,onDragEnd:r},(0,s.createElement)("div",{onMouseEnter:y,onMouseLeave:w},(0,s.createElement)(ui.Tooltip,{text:_||k},(0,s.createElement)(Uy,{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)(ui.Spinner,null))))),!a&&(0,s.createElement)(Gy,{category:n,media:e}))))),o&&(0,s.createElement)($y,{onClose:()=>r(!1),onSubmit:()=>{t((0,c.cloneBlock)(m)),g((0,S.__)("Image inserted."),{type:"snackbar"}),r(!1)}}))}const{CompositeV2:Wy,useCompositeStoreV2:Ky}=pr(ui.privateApis);var Zy=function({mediaList:e,category:t,onClick:n,label:o=(0,S.__)("Media List")}){const r=Ky();return(0,s.createElement)(Wy,{store:r,role:"listbox",className:"block-editor-inserter__media-list","aria-label":o},e.map(((e,o)=>(0,s.createElement)(jy,{key:e.id||e.sourceId||o,media:e,category:t,onClick:n}))))},qy=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(kl,{className:"block-editor-inserter__no-results-icon",icon:mh}),(0,s.createElement)("p",null,(0,S.__)("No results found.")))};const Yy=10;function Xy({rootClientId:e,onInsert:t,category:n}){const o=(0,u.useRef)();return(0,u.useEffect)((()=>{const e=setTimeout((()=>{const[e]=Es.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)(Qy,{rootClientId:e,onInsert:t,category:n}))}function Qy({rootClientId:e,onInsert:t,category:n}){const[o,r,i]=(0,p.useDebouncedInput)(),{mediaList:l,isLoading:a}=function(e,t={}){const[n,o]=(0,u.useState)(),[r,i]=(0,u.useState)(!1),l=(0,u.useRef)();return(0,u.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});l.current=n,i(!0),o([]);const r=await(e.fetch?.(t));n===l.current&&(o(r),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:r}}(n,{per_page:i?20:Yy,search:i}),c="block-editor-inserter__media-panel",d=n.labels.search_items||(0,S.__)("Search");return(0,s.createElement)("div",{className:c},(0,s.createElement)(ui.SearchControl,{className:`${c}-search`,onChange:r,value:o,label:d,placeholder:d}),a&&(0,s.createElement)("div",{className:`${c}-spinner`},(0,s.createElement)(ui.Spinner,null)),!a&&!l?.length&&(0,s.createElement)(qy,null),!a&&!!l?.length&&(0,s.createElement)(Zy,{rootClientId:e,onClick:t,mediaList:l,category:n}))}const Jy=["image","video","audio"];var ew=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:o}){const r=Oy(e),i=(0,p.useViewportMatch)("medium","<"),l="block-editor-inserter__media-tabs",a=(0,u.useCallback)((e=>{if(!e?.url)return;const[t]=Fy(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,!i&&(0,s.createElement)("div",{className:`${l}-container`},(0,s.createElement)("nav",{"aria-label":(0,S.__)("Media categories")},(0,s.createElement)(ui.__experimentalItemGroup,{role:"list",className:l},r.map((e=>(0,s.createElement)(ui.__experimentalItem,{role:"listitem",key:e.name,onClick:()=>n(e),className:oi()(`${l}__media-category`,{"is-selected":t===e}),"aria-label":e.labels.name,"aria-current":e===t?"true":void 0},(0,s.createElement)(ui.__experimentalHStack,null,(0,s.createElement)(ui.FlexBlock,null,e.labels.name),(0,s.createElement)(kl,{icon:(0,S.isRTL)()?Kk:Wk}))))),(0,s.createElement)("div",{role:"listitem"},(0,s.createElement)(Ms,null,(0,s.createElement)(Ps,{multiple:!1,onSelect:a,allowedTypes:Jy,render:({open:e})=>(0,s.createElement)(ui.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,S.__)("Open Media Library"))})))))),i&&(0,s.createElement)(Iy,{categories:c},(t=>(0,s.createElement)(Qy,{onInsert:o,rootClientId:e,category:t}))))};const{Fill:tw,Slot:nw}=(0,ui.createSlotFill)("__unstableInserterMenuExtension");tw.Slot=nw;var ow=tw;const rw=[];var iw=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:o,rootClientId:r,clientId:i,isAppender:l,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:h=!1,isDraggable:f=!0,shouldFocusBlock:g=!0,prioritizePatterns:b,selectBlockOnInsert:v}){const k=(0,p.useDebounce)(Zn.speak,500),{prioritizedBlocks:_}=(0,d.useSelect)((e=>{const t=e(hr).getBlockListSettings(r);return{prioritizedBlocks:t?.prioritizedInserterBlocks||rw}}),[r]),[y,w]=by({onSelect:t,rootClientId:r,clientId:i,isAppender:l,insertionIndex:a,shouldFocusBlock:g,selectBlockOnInsert:v}),[E,C,x,B]=cf(y,w),[I,,T]=vy(w,y),P=(0,u.useMemo)((()=>{if(0===c)return[];const t=sf(I,e);return void 0!==c?t.slice(0,c):t}),[e,I,c]);let M=m;b&&P.length>2&&(M=0);const R=(0,u.useMemo)((()=>{if(0===M)return[];let t=re(E.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&_.length&&(t=uf(t,_));const n=lf(t,C,x,e);return void 0!==M?n.slice(0,M):n}),[e,E,C,x,M,_]);(0,u.useEffect)((()=>{if(!e)return;const t=R.length+P.length,n=(0,S.sprintf)(/* translators: %d: number of results. */
(0,S._n)("%d result found.","%d results found.",t),t);k(n)}),[e,k,R,P]);const A=(0,p.useAsyncList)(R,{step:9}),N=(0,p.useAsyncList)(A.length===R.length?P:rw),L=R.length>0||P.length>0,O=!!R.length&&(0,s.createElement)(ey,{title:(0,s.createElement)(ui.VisuallyHidden,null,(0,S.__)("Blocks"))},(0,s.createElement)(J_,{items:A,onSelect:B,onHover:n,label:(0,S.__)("Blocks"),isDraggable:f})),D=!!P.length&&(0,s.createElement)(ey,{title:(0,s.createElement)(ui.VisuallyHidden,null,(0,S.__)("Block patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(gy,{shownPatterns:N,blockPatterns:P,onClickPattern:T,onHover:o,isDraggable:f})));return(0,s.createElement)(oy,null,!h&&!L&&(0,s.createElement)(qy,null),b?D:O,!!R.length&&!!P.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?O:D,h&&(0,s.createElement)(ow.Slot,{fillProps:{onSelect:B,onHover:n,filterValue:e,hasItems:L,rootClientId:y}},(e=>e.length?e:L?null:(0,s.createElement)(qy,null))))};const{Tabs:lw}=pr(ui.privateApis),sw={name:"blocks",
/* translators: Blocks tab title in the block inserter. */
title:(0,S.__)("Blocks")},aw={name:"patterns",
/* translators: Theme and Directory Patterns tab title in the block inserter. */
title:(0,S.__)("Patterns")},cw={name:"media",
/* translators: Media tab title in the block inserter. */
title:(0,S.__)("Media")};var uw=function({showPatterns:e=!1,showMedia:t=!1,onSelect:n,tabsContents:o}){const r=[sw,e&&aw,t&&cw].filter(Boolean);return(0,s.createElement)("div",{className:"block-editor-inserter__tabs"},(0,s.createElement)(lw,{onSelect:n},(0,s.createElement)(lw.TabList,null,r.map((e=>(0,s.createElement)(lw.Tab,{key:e.name,tabId:e.name},e.title)))),r.map((e=>(0,s.createElement)(lw.TabPanel,{key:e.name,tabId:e.name,focusable:!1},o[e.name])))))},dw=(0,u.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,onSelect:r,showInserterHelpPanel:i,showMostUsedBlocks:l,__experimentalFilterValue:a="",shouldFocusBlock:c=!0},m){const[h,f,g]=(0,p.useDebouncedInput)(a),[b,v]=(0,u.useState)(null),[k,_]=(0,u.useState)(null),[y,w]=(0,u.useState)("all"),[E,C]=(0,u.useState)(null),[x,B]=(0,u.useState)(null),[I,T,P]=by({rootClientId:e,clientId:t,isAppender:n,insertionIndex:o,shouldFocusBlock:c}),{showPatterns:M}=(0,d.useSelect)((e=>{const{hasAllowedPatterns:t}=pr(e(hr));return{showPatterns:t(I)}}),[I]),R=Oy(I).length>0,A=(0,u.useCallback)(((e,t,n)=>{T(e,t,n),r()}),[T,r]),N=(0,u.useCallback)(((e,t)=>{T(e,{patternName:t}),r()}),[T,r]),L=(0,u.useCallback)((e=>{P(!!e),v(e)}),[P,v]),O=(0,u.useCallback)((e=>{P(!!e)}),[P]),D=(0,u.useCallback)(((e,t)=>{_(e),w(t)}),[_]),z=(0,u.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(iy,{rootClientId:I,onInsert:A,onHover:L,showMostUsedBlocks:l})),i&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(ui.VisuallyHidden,{as:"h2"},(0,S.__)("A tip for using the block editor")),(0,s.createElement)(jk,null)))),[I,A,L,l,i]),F=(0,u.useMemo)((()=>(0,s.createElement)(Ny,{rootClientId:I,onInsert:N,onSelectCategory:D,selectedCategory:k})),[I,N,D,k]),V=(0,u.useMemo)((()=>(0,s.createElement)(ew,{rootClientId:I,selectedCategory:E,onSelectCategory:C,onInsert:A})),[I,A,E,C]),H=(0,u.useMemo)((()=>({blocks:z,patterns:F,media:V})),[z,V,F]),U=(0,u.useRef)();(0,u.useImperativeHandle)(m,(()=>({focusSearch:()=>{U.current.focus()}})));const G="patterns"===x&&!g&&k,$=!g&&(M||R),j="media"===x&&!g&&E;return(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:oi()("block-editor-inserter__main-area",{"show-as-tabs":$})},(0,s.createElement)(ui.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{b&&v(null),f(e)},value:h,label:(0,S.__)("Search for blocks and patterns"),placeholder:(0,S.__)("Search"),ref:U}),!!g&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,s.createElement)(iw,{filterValue:g,onSelect:r,onHover:L,onHoverPattern:O,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:o,showBlockDirectory:!0,shouldFocusBlock:c})),$&&(0,s.createElement)(uw,{showPatterns:M,showMedia:R,onSelect:e=>{"patterns"!==e&&_(null),B(e)},tabsContents:H}),!g&&!$&&(0,s.createElement)("div",{className:"block-editor-inserter__no-tab-container"},z)),j&&(0,s.createElement)(Xy,{rootClientId:I,onInsert:A,category:E}),i&&b&&(0,s.createElement)(ui.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1},(0,s.createElement)(G_,{item:b})),G&&(0,s.createElement)(Ly,{rootClientId:I,onInsert:N,onHover:O,category:k,patternFilter:y,showTitlesAsTooltip:!0}))}));function pw({onSelect:e,rootClientId:t,clientId:n,isAppender:o,prioritizePatterns:r,selectBlockOnInsert:i}){const[l,a]=(0,u.useState)(""),[c,p]=by({onSelect:e,rootClientId:t,clientId:n,isAppender:o,selectBlockOnInsert:i}),[m]=cf(c,p),[h]=vy(p,c),{setInserterIsOpened:f,insertionIndex:g}=(0,d.useSelect)((e=>{const{getSettings:t,getBlockIndex:o,getBlockCount:r}=e(hr),i=t(),l=o(n),s=r();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===l?s:l}}),[n]),b=h.length&&(!!l||r),v=b&&h.length>6||m.length>6;(0,u.useEffect)((()=>{f&&f(!1)}),[f]);let k=0;return b&&(k=r?4:2),(0,s.createElement)("div",{className:oi()("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":f})},v&&(0,s.createElement)(ui.SearchControl,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:l,onChange:e=>{a(e)},label:(0,S.__)("Search for blocks and patterns"),placeholder:(0,S.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(iw,{filterValue:l,onSelect:e,rootClientId:t,clientId:n,isAppender:o,maxBlockPatterns:k,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:r,selectBlockOnInsert:i})),f&&(0,s.createElement)(ui.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{f({rootClientId:t,insertionIndex:g,filterValue:l})},"aria-label":(0,S.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,S.__)("Browse all")))}const mw=({onToggle:e,disabled:t,isOpen:n,blockTitle:o,hasSingleBlockType:r,toggleProps:i={},prioritizePatterns:l})=>{const{as:a=ui.Button,label:c,onClick:u,...d}=i;let p=c;return!p&&r?p=(0,S.sprintf)(
// translators: %s: the name of the block when there is only one
(0,S._x)("Add %s","directly add the only allowed block"),o):!p&&l?p=(0,S.__)("Add pattern"):p||(p=(0,S._x)("Add block","Generic label for block inserter button")),(0,s.createElement)(a,{icon:$s,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 hw 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:i,toggleProps:l,hasItems:s,renderToggle:a=mw,prioritizePatterns:c}=this.props;return a({onToggle:e,isOpen:t,disabled:n||!s,blockTitle:o,hasSingleBlockType:r,directInsertBlock:i,toggleProps:l,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r,__experimentalIsQuick:i,prioritizePatterns:l,onSelectOrClose:a,selectBlockOnInsert:c}=this.props;return i?(0,s.createElement)(pw,{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:l,selectBlockOnInsert:c}):(0,s.createElement)(dw,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:o,showInserterHelpPanel:r})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(ui.Dropdown,{className:"block-editor-inserter",contentClassName:oi()("block-editor-inserter__popover",{"is-quick":r}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,S.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const fw=(0,p.compose)([(0,d.withSelect)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:o=!0})=>{const{getBlockRootClientId:r,hasInserterItems:i,getAllowedBlocks:l,getDirectInsertBlock:s,getSettings:a}=e(hr),{getBlockVariations:u}=e(c.store),d=l(n=n||r(t)||void 0),p=o&&s(n),m=a(),h=1===d?.length&&0===u(d[0].name,"inserter")?.length;let f=!1;return h&&(f=d[0]),{hasItems:i(n),hasSingleBlockType:h,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:n,prioritizePatterns:m.__experimentalPreferPatternsOnRoot&&!n}})),(0,d.withDispatch)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:o,clientId:r,isAppender:i,hasSingleBlockType:l,allowedBlockType:s,directInsertBlock:a,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!l&&!a)return;const{insertBlock:p}=e(hr);let m;if(a){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(hr);if(!e||!r&&!o)return{};const l={};let s={};if(r){const e=t(r),n=t(i(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)&&(l[e]=s[e])})),l}(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:l,getBlockRootClientId:s}=n(hr);if(r)return e(r);const a=t();return!i&&a&&s(a)===o?e(a)+1:l(o).length}(),o,d),u&&u({clientId:m?.clientId});const h=(0,S.sprintf)(
// translators: %s: the name of the block that has been added
(0,S.__)("%s block added"),s.title);(0,Zn.speak)(h)}}))),(0,p.ifCondition)((({hasItems:e,isAppender:t,rootClientId:n,clientId:o})=>e||!t&&!n&&!o))])(hw);var gw=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(fw,{ref:t,...e}))),bw=(0,p.compose)((0,d.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(hr),i=!n(t.rootClientId),{bodyPlaceholder:l}=o();return{showPrompt:i,isLocked:!!r(t.rootClientId),placeholder:l}})),(0,d.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(hr);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 i=(0,Gk.decodeEntities)(o)||(0,S.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":r||"",className:oi()("block-editor-default-block-appender",{"has-visible-prompt":n})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,S.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{xs.ENTER!==e.keyCode&&xs.SPACE!==e.keyCode||t()},onClick:()=>t(),onFocus:()=>{n&&t()}},n?i:"\ufeff"),(0,s.createElement)(gw,{rootClientId:r,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function vw({rootClientId:e,className:t,onFocus:n,tabIndex:o},r){return(0,s.createElement)(gw,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:i,isOpen:l,blockTitle:a,hasSingleBlockType:c})=>{let u;u=c?(0,S.sprintf)(
// translators: %s: the name of the block when there is only one
(0,S._x)("Add %s","directly add the only allowed block"),a):(0,S._x)("Add block","Generic label for block inserter button");const d=!c;let p=(0,s.createElement)(ui.Button,{ref:r,onFocus:n,tabIndex:o,className:oi()(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":d?"true":void 0,"aria-expanded":d?l:void 0,disabled:i,label:u},!c&&(0,s.createElement)(ui.VisuallyHidden,{as:"span"},u),(0,s.createElement)(kl,{icon:$s}));return(d||c)&&(p=(0,s.createElement)(ui.Tooltip,{text:u},p)),p},isAppender:!0})}const kw=(0,u.forwardRef)(((e,t)=>(y()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),vw(e,t))));var _w=(0,u.forwardRef)(vw);function yw({rootClientId:e}){return(0,d.useSelect)((t=>t(hr).canInsertBlockType((0,c.getDefaultBlockName)(),e)))?(0,s.createElement)(bw,{rootClientId:e}):(0,s.createElement)(_w,{rootClientId:e,className:"block-list-appender__toggle"})}function ww({rootClientId:e,renderAppender:t,className:n,tagName:o}){const r=function(e,t){const n=(0,d.useSelect)((n=>{const{getTemplateLock:o,getSelectedBlockClientId:r,__unstableGetEditorMode:i,getBlockEditingMode:l}=n(hr);if(!t){const t=r();if(e!==t&&(e||t))return!1}return!o(e)&&"disabled"!==l(e)&&"zoom-out"!==i()}),[e,t]);return n?t?(0,s.createElement)(t,null):(0,s.createElement)(yw,{rootClientId:e}):null}(e,t),i=(0,d.useSelect)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:o,getBlockCount:r}=t(hr),i=n();return o()&&e===i?.rootClientId&&0===r(e)}),[e]);return r?(0,s.createElement)(o,{tabIndex:-1,className:oi()("block-list-appender wp-block",n,{"is-drag-over":i}),contentEditable:!1,"data-block":!0},r):null}var Ew=function({rootClientId:e,renderAppender:t,className:n,tagName:o="div"}){return!1===t?null:(0,s.createElement)(ww,{rootClientId:e,renderAppender:t,className:n,tagName:o})};const Sw=Number.MAX_SAFE_INTEGER;(0,u.createContext)();var Cw=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:o,__unstableContentRef:r,...i}){const[l,a]=(0,u.useReducer)((e=>(e+1)%Sw),0),{orientation:c,rootClientId:p,isVisible:m}=(0,d.useSelect)((n=>{const{getBlockListSettings:o,getBlockRootClientId:r,isBlockVisible:i}=n(hr),l=r(null!=e?e:t);return{orientation:o(l)?.orientation||"vertical",rootClientId:l,isVisible:i(e)&&i(t)}}),[e,t]),h=Hu(e),f=Hu(t),g="vertical"===c,b=(0,u.useMemo)((()=>{if(!(l<0||!h&&!f)&&m)return{contextElement:h||f,getBoundingClientRect(){const e=h?h.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,o=0,r=0,i=0;return g?(o=e?e.bottom:t.top,r=e?e.width:t.width,i=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(o=e?e.top:t.top,i=e?e.height:t.height,(0,S.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,i)}}}),[h,f,l,g,m]),v=Np(r);return(0,u.useLayoutEffect)((()=>{if(!h)return;const e=new window.MutationObserver(a);return e.observe(h,{attributes:!0}),()=>{e.disconnect()}}),[h]),(0,u.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(a);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,u.useLayoutEffect)((()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",a),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",a)}}),[h]),(h||f)&&m?(0,s.createElement)(ui.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:o,inline:!o,key:t+"--"+p,...i,className:oi()("block-editor-block-popover","block-editor-block-popover__inbetween",i.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"},(0,s.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},n)):null};const xw={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var Bw=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(hr),o=n(),r=t(o.rootClientId);return r.length?{clientId:r[o.index]}:{}}),[]),o=(0,p.useReducedMotion)();return(0,s.createElement)(Op,{clientId:n,__unstableCoverTarget:!0,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone"},(0,s.createElement)(ui.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:o?xw.show:xw.hide,animate:xw.show,exit:o?xw.show:xw.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const Iw=(0,u.createContext)();function Tw({__unstablePopoverSlot:e,__unstableContentRef:t}){const{selectBlock:n,hideInsertionPoint:o}=(0,d.useDispatch)(hr),r=(0,u.useContext)(Iw),i=(0,u.useRef)(),{orientation:l,previousClientId:a,nextClientId:c,rootClientId:m,isInserterShown:h,isDistractionFree:f,isNavigationMode:g}=(0,d.useSelect)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:o,isBlockBeingDragged:r,getPreviousBlockClientId:i,getNextBlockClientId:l,getSettings:s,isNavigationMode:a}=e(hr),c=o(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],p=u[c.index];for(;r(d);)d=i(d);for(;r(p);)p=l(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}}),[]),b=(0,p.useReducedMotion)(),v={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:h?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(f&&!g)return null;const _=oi()("block-editor-block-list__insertion-point","is-"+l);return(0,s.createElement)(Cw,{previousClientId:a,nextClientId:c,__unstablePopoverSlot:e,__unstableContentRef:t},(0,s.createElement)(ui.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&c&&n(c,-1)},onFocus:function(e){e.target!==i.current&&(r.current=!0)},className:oi()(_,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==i.current||r.current||o()}},(0,s.createElement)(ui.__unstableMotion.div,{variants:v,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,s.createElement)(ui.__unstableMotion.div,{variants:k,className:oi()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(gw,{position:"bottom center",clientId:c,rootClientId:m,__experimentalIsQuick:!0,onToggle:e=>{r.current=e},onSelectOrClose:()=>{r.current=!1}}))))}function Pw(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:o}=(0,d.useSelect)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:o}=e(hr),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===o(r?.rootClientId)}}),[]);return!n||o?null:"replace"===t.operation?(0,s.createElement)(Bw,{key:`${t.rootClientId}-${t.index}`,...e}):(0,s.createElement)(Tw,{...e})}function Mw(){const e=(0,u.useContext)(Iw),t=(0,d.useSelect)((e=>e(hr).getSettings().isDistractionFree||"zoom-out"===e(hr).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:o,isMultiSelecting:r,getSelectedBlockClientIds:i,getTemplateLock:l,__unstableIsWithinBlockOverlay:s,getBlockEditingMode:a,getBlockName:c}=(0,d.useSelect)(hr),{showInsertionPoint:m,hideInsertionPoint:h}=(0,d.useDispatch)(hr);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")),l(u)||"disabled"===a(u)||"core/block"===c(u)&&window.__experimentalPatternPartialSyncing)return;const d=n(u)?.orientation||"vertical",p=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"===d&&t.top>p||e.classList.contains("wp-block")&&"horizontal"===d&&((0,S.isRTL)()?t.right<f:t.left>f)}));if(!g)return void h();if(!g.id&&(g=g.firstElementChild,!g))return void h();const b=g.id.slice(6);if(!b||s(b))return;if(i().includes(b))return;const v=g.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,i,t])}var Rw=(0,p.createHigherOrderComponent)((e=>t=>{const{clientId:n}=k();return(0,s.createElement)(e,{...t,clientId:n})}),"withClientId"),Aw=Rw((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:o,isToggle:r})=>(0,s.createElement)(_w,{className:oi()({"block-list-appender__toggle":r}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:o}))),Nw=(0,p.compose)([Rw,(0,d.withSelect)(((e,{clientId:t})=>{const{getBlockOrder:n}=e(hr),o=n(t);return{lastBlockClientId:o[o.length-1]}}))])((({clientId:e})=>(0,s.createElement)(bw,{rootClientId:e})));const Lw=new WeakMap;function Ow(e,t,n={}){const{operation:o="insert"}=n,{canInsertBlockType:r,getBlockIndex:i,getClientIdsOfDescendants:l,getBlockOrder:s,getBlocksByClientId:a,getSettings:p}=(0,d.useSelect)(hr),{insertBlocks:m,moveBlocksToPosition:h,updateBlockAttributes:f,clearSelectedBlock:g,replaceBlocks:b,removeBlocks:v}=(0,d.useDispatch)(hr),k=(0,d.useRegistry)(),_=(0,u.useCallback)(((n,r=!0,i=0)=>{if("replace"===o){const o=s(e)[t];b(o,n,void 0,i)}else m(n,t,e,r,i)}),[o,s,m,b,t,e]),y=(0,u.useCallback)(((n,r,i)=>{if("replace"===o){const o=a(n),r=s(e)[t];k.batch((()=>{v(n,!1),b(r,o,void 0,0)}))}else h(n,r,e,i)}),[o,s,a,h,k,v,b,t,e]),w=function(e,t,n,o,r,i,l){return s=>{const{srcRootClientId:a,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){l();const e=p.map((e=>(0,c.cloneBlock)(e)));i(e,!0,null)}if("block"===d){const i=n(u[0]);if(a===e&&i===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const l=a===e,s=u.length;r(u,a,l&&i<t?t-s:t)}}}(e,t,i,l,y,_,g),E=function(e,t,n,o,r){return i=>{if(!t().mediaUpload)return;const l=(0,c.findTransform)((0,c.getBlockTransforms)("from"),(t=>"files"===t.type&&o(t.blockName,e)&&t.isMatch(i)));if(l){const e=l.transform(i,n);r(e)}}}(e,p,f,r,_),S=function(e){return t=>{const n=(0,c.pasteHandler)({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(_);return e=>{const t=(0,Es.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?S(n):t.length?E(t):w(e)}}function Dw(e,t,n=["top","bottom","left","right"]){let o,r;return n.forEach((n=>{const i=function(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:i}=e,l=o?r:i,s=o?i:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=l>=a&&l<=c?l:l<c?a:c,Math.sqrt((l-d)**2+(s-u)**2)}(e,t,n);(void 0===o||i<o)&&(o=i,r=n)})),[o,r]}function zw(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Fw=30,Vw=120,Hw=120;function Uw(e,t,n,o){let r=!0;if(t){const e=t?.map((({name:e})=>e));r=n.every((t=>e?.includes(t)))}const i=n.map((t=>e(t))).every((e=>{const[t]=e?.parent||[];return!t||t===o}));return r&&i}const Gw={};function $w({children:e,clientId:t}){const n=function(e){return(0,d.useSelect)((t=>{const n=t(hr).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)(Tf,{value:n},e)}function jw(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:o,defaultBlock:r,directInsert:i,__experimentalDefaultBlock:l,__experimentalDirectInsert:a,template:p,templateLock:m,wrapperRef:h,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:g,__experimentalAppenderTagName:b,renderAppender:v,orientation:k,placeholder:_,layout:w,name:S,blockType:C,innerBlocks:x,parentLock:B}=e;(function(e,t,n,o,r,i,l,s,a,c,p,m){const{updateBlockListSettings:h}=(0,d.useDispatch)(hr),f=(0,d.useRegistry)(),g=function(e){const[t,n]=(0,u.useState)(e);return As()(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:g,prioritizedInserterBlocks:b,templateLock:v};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==p)t.orientation=p;else{const e=Tl(m?.type);t.orientation=e.getOrientation(m)}void 0!==l&&(y()("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=l),void 0!==r&&(t.defaultBlock=r),void 0!==s&&(y()("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=s),void 0!==i&&(t.directInsert=i),Lw.get(f)||Lw.set(f,[]),Lw.get(f).push([e,t]),window.queueMicrotask((()=>{Lw.get(f)?.length&&f.batch((()=>{Lw.get(f).forEach((e=>{h(...e)})),Lw.set(f,[])}))}))}),[e,g,b,v,r,i,l,s,c,p,h,m,f])})(t,B,n,o,r,i,l,a,m,g,k,w),function(e,t,n,o,r){const{getBlocks:i,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:s}=(0,d.useSelect)(hr),{replaceInnerBlocks:a,__unstableMarkNextChangeAsNotPersistent:p}=(0,d.useDispatch)(hr),m=(0,u.useRef)(null);(0,u.useLayoutEffect)((()=>{let t=!1;return window.queueMicrotask((()=>{if(t)return;const u=i(e),d=0===u.length||"all"===o||"contentOnly"===o,h=!E()(n,m.current);if(!d||!h)return;m.current=n;const f=(0,c.synchronizeBlocksWithTemplate)(u,n);E()(f,u)||(p(),a(e,f,0===u.length&&r&&0!==f.length&&s(e),l()))})),()=>{t=!0}}),[t,n,o,e])}(t,x,p,m,f);const I=(0,c.getBlockSupport)(S,"layout")||(0,c.getBlockSupport)(S,"__experimentalLayout")||Gw,{allowSizingOnChildren:T=!1}=I,[P]=Cr("layout"),M=w||I,R=(0,u.useMemo)((()=>({...P,...M,...T&&{allowSizingOnChildren:!0}})),[P,M,T]),A=(0,s.createElement)(iE,{rootClientId:t,renderAppender:v,__experimentalAppenderTagName:b,layout:R,wrapperRef:h,placeholder:_});return 0===Object.keys(C.providesContext).length?A:(0,s.createElement)($w,{clientId:t},A)}function Ww(e){return Xk(e),(0,s.createElement)(jw,{...e})}const Kw=(0,u.forwardRef)(((e,t)=>{const n=Zw({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",{...n}))}));function Zw(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:o,dropZoneElement:r}=t,{clientId:i,layout:l=null,__unstableLayoutClassNames:a=""}=k(),{__experimentalCaptureToolbars:m,hasOverlay:h,name:f,blockType:g,innerBlocks:b,parentLock:v,parentClientId:_,isDropZoneDisabled:y}=(0,d.useSelect)((e=>{if(!i)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:o,__unstableGetEditorMode:r,getBlocks:l,getTemplateLock:s,getBlockRootClientId:a,__unstableIsWithinBlockOverlay:u,__unstableHasActiveBlockOverlayActive:d,getBlockEditingMode:p}=e(hr),{hasBlockSupport:m,getBlockType:h}=e(c.store),f=t(i),g="navigation"===r(),b=p(i),v=a(i);return{__experimentalCaptureToolbars:m(f,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==f&&!n(i)&&!o(i,!0)&&g,name:f,blockType:h(f),innerBlocks:l(i),parentLock:s(v),parentClientId:v,isDropZoneDisabled:"default"!==b||d(i)||u(i)}}),[i]),w=function({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:o=!1}={}){const r=(0,d.useRegistry)(),[i,l]=(0,u.useState)({index:null,operation:"insert"}),{getBlockType:s}=(0,d.useSelect)(c.store),{getBlockListSettings:a,getBlocks:m,getBlockIndex:h,getDraggedBlockClientIds:f,getBlockNamesByClientId:g,getAllowedBlocks:b}=(0,d.useSelect)(hr),{showInsertionPoint:v,hideInsertionPoint:k}=(0,d.useDispatch)(hr),_=Ow("before"===i.operation||"after"===i.operation?n:t,i.index,{operation:i.operation}),y=(0,p.useThrottle)((0,u.useCallback)(((o,i)=>{const u=b(t),d=g([t])[0],p=g(f());if(!Uw(s,u,p,d))return;const k=m(t);if(0===k.length)return void r.batch((()=>{l({index:0,operation:"insert"}),v(t,0,{operation:"insert"})}));const _=k.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:(0,c.isUnmodifiedDefaultBlock)(e),getBoundingClientRect:()=>i.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:h(t)}})),[y,w]=function(e,t,n="vertical",o={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let i=0,l="before",s=1/0;const{dropZoneElement:a,parentBlockOrientation:c,rootBlockIndex:u=0}=o;if(a&&"horizontal"!==c){const e=a.getBoundingClientRect(),[n,o]=Dw(t,e,["top","bottom"]);if(e.height>Vw&&n<Fw){if("top"===o)return[u,"before"];if("bottom"===o)return[u+1,"after"]}}const d=(0,S.isRTL)();if(a&&"horizontal"===c){const e=a.getBoundingClientRect(),[n,o]=Dw(t,e,["left","right"]);if(e.width>Hw&&n<Fw){if(d&&"right"===o||!d&&"left"===o)return[u,"before"];if(d&&"left"===o||!d&&"right"===o)return[u+1,"after"]}}e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:n,blockIndex:o})=>{const a=n();let[c,u]=Dw(t,a,r);e&&zw(t,a)&&(c=0),c<s&&(l="bottom"===u||!d&&"right"===u||d&&"left"===u?"after":"before",s=c,i=o)}));const p=i+("after"===l?1:-1),m=!!e[i]?.isUnmodifiedDefaultBlock,h=!!e[p]?.isUnmodifiedDefaultBlock;return m||h?[m?i:p,"replace"]:["after"===l?i+1:i,"insert"]}(_,{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((()=>{l({index:y,operation:w});const e=["before","after"].includes(w)?n:t;v(e,y,{operation:w})}))}),[b,t,g,f,s,m,a,e,n,h,r,v]),200);return(0,p.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:o,onDrop:_,onDragOver(e){y(e,e.currentTarget.ownerDocument)},onDragLeave(){y.cancel(),k()},onDragEnd(){y.cancel(),k()}})}({dropZoneElement:r,rootClientId:i,parentClientId:_,isDisabled:y}),E=(0,p.useMergeRefs)([e.ref,o?null:w]),C={__experimentalCaptureToolbars:m,layout:l,name:f,blockType:g,innerBlocks:b,parentLock:v,...t},x=C.value&&C.onChange?Ww:jw;return{...e,ref:E,className:oi()(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":h}),children:i?(0,s.createElement)(x,{...C,clientId:i}):(0,s.createElement)(iE,{...t})}}Zw.save=c.__unstableGetInnerBlocksProps,Kw.DefaultBlockAppender=Nw,Kw.ButtonBlockAppender=Aw,Kw.Content=()=>Zw.save().children;var qw=Kw;const Yw=new Set([xs.UP,xs.RIGHT,xs.DOWN,xs.LEFT,xs.ENTER,xs.BACKSPACE]);function Xw(){const e=(0,d.useSelect)((e=>e(hr).isTyping()),[]),{stopTyping:t}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,i;function l(e){const{clientX:n,clientY:o}=e;r&&i&&(r!==n||i!==o)&&t(),r=n,i=o}return o.addEventListener("mousemove",l),()=>{o.removeEventListener("mousemove",l)}}),[e,t])}function Qw(){const{isTyping:e,hasInlineToolbar:t}=(0,d.useSelect)((e=>{const{isTyping:t,getSettings:n}=e(hr);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:o}=(0,d.useDispatch)(hr),r=Xw(),i=(0,p.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:l}=i,s=l.getSelection();if(e){let c;function u(e){const{target:t}=e;c=l.setTimeout((()=>{(0,Es.isTextField)(t)||o()}))}function d(e){const{keyCode:t}=e;t!==xs.ESCAPE&&t!==xs.TAB||o()}function p(){s.isCollapsed||o()}return r.addEventListener("focus",u),r.addEventListener("keydown",d),t||i.addEventListener("selectionchange",p),()=>{l.clearTimeout(c),r.removeEventListener("focus",u),r.removeEventListener("keydown",d),i.removeEventListener("selectionchange",p)}}function a(e){const{type:t,target:o}=e;(0,Es.isTextField)(o)&&r.contains(o)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Yw.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,i])}var Jw=function({children:e}){return(0,s.createElement)("div",{ref:Qw()},e)};const eE=(0,u.createContext)(),tE=new WeakMap;function nE({className:e,...t}){const n=(0,p.useViewportMatch)("medium"),{isOutlineMode:o,isFocusMode:r,editorMode:i}=(0,d.useSelect)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(hr),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,editorMode:n()}}),[]),l=(0,d.useRegistry)(),{setBlockVisibility:a}=(0,d.useDispatch)(hr),c=(0,p.useDebounce)((0,u.useCallback)((()=>{const e={};tE.get(l).forEach((([t,n])=>{e[t]=n})),a(e)}),[l]),300,{trailing:!0}),m=(0,u.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{tE.get(l)||tE.set(l,[]);for(const t of e){const e=t.target.getAttribute("data-block");tE.get(l).push([e,t.isIntersecting])}c()}))}),[]),h=Zw({ref:(0,p.useMergeRefs)([o_(),Mw(),Qw()]),className:oi()("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r&&n,"is-navigate-mode":"navigation"===i})},t);return(0,s.createElement)(eE.Provider,{value:m},(0,s.createElement)("div",{...h}))}function oE(e){return(0,s.createElement)(v,{value:g},(0,s.createElement)(nE,{...e}))}function rE({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:o,layout:r=Pl}){const{order:i,selectedBlocks:l,visibleBlocks:a}=(0,d.useSelect)((e=>{const{getBlockOrder:n,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(hr);return{order:n(t),selectedBlocks:o(),visibleBlocks:r()}}),[t]);return(0,s.createElement)(Rl,{value:r},i.map((e=>(0,s.createElement)(d.AsyncModeProvider,{key:e,value:!a.has(e)&&!l.includes(e)},(0,s.createElement)(Uk,{rootClientId:t,clientId:e})))),i.length<1&&e,(0,s.createElement)(Ew,{tagName:o,rootClientId:t,renderAppender:n}))}function iE(e){return(0,s.createElement)(d.AsyncModeProvider,{value:!1},(0,s.createElement)(rE,{...e}))}const lE={placement:"top-start"},sE={...lE,flip:!1,shift:!0},aE={...lE,flip:!0,shift:!1};function cE(e,t,n,o,r){if(!e||!t)return sE;const i=n?.scrollTop||0,l=t.getBoundingClientRect(),s=i+e.getBoundingClientRect().top,a=e.ownerDocument.documentElement.clientHeight,c=s+o,u=l.top>c,d=l.height>a-o;return r||!u&&!d?aE:sE}function uE({contentElement:e,clientId:t}){const n=Hu(t),[o,r]=(0,u.useState)(0),{blockIndex:i,isSticky:l}=(0,d.useSelect)((e=>{const{getBlockIndex:n,getBlockAttributes:o}=e(hr);return{blockIndex:n(t),isSticky:Rm(o(t))}}),[t]),s=(0,u.useMemo)((()=>{if(e)return(0,Es.getScrollContainer)(e)}),[e]),[a,c]=(0,u.useState)((()=>cE(e,n,s,o,l))),m=(0,p.useRefEffect)((e=>{r(e.offsetHeight)}),[]),h=(0,u.useCallback)((()=>c(cE(e,n,s,o,l))),[e,n,s,o]);return(0,u.useLayoutEffect)(h,[i,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 dE(e){const t=(0,d.useSelect)((t=>{const{getBlockRootClientId:n,getBlockParents:o,__experimentalGetBlockListSettingsForBlocks:r,isBlockInsertionPointVisible:i,getBlockInsertionPoint:l,getBlockOrder:s,hasMultiSelection:a,getLastMultiSelectedBlockClientId:c}=t(hr),u=o(e),d=r(u),p=u.find((e=>d[e]?.__experimentalCaptureToolbars));let m=!1;if(i()){const t=l();m=s(t.rootClientId)[t.index]===e}return{capturingClientId:p,isInsertionPointVisible:m,lastClientId:a()?c():null,rootClientId:n(e)}}),[e]);return t}function pE({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:i}=dE(e),l=uE({contentElement:t?.current,clientId:e});return(0,s.createElement)(Op,{clientId:n||e,__unstableCoverTarget:!0,bottomClientId:r,className:oi()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":o}),__unstableContentRef:t,resize:!1,shift:!1,...l},(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(gw,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})))}var mE=({children:e,clientIds:t,cloneClassname:n,onDragStart:o,onDragEnd:r,fadeWhenDisabled:i=!1})=>{const{srcRootClientId:l,isDraggable:a,icon:m,visibleInserter:h,getBlockType:f}=(0,d.useSelect)((e=>{const{canMoveBlocks:n,getBlockRootClientId:o,getBlockName:r,getBlockAttributes:i,isBlockInsertionPointVisible:l}=e(hr),{getBlockType:s,getActiveBlockVariation:a}=e(c.store),u=o(t[0]),d=r(t[0]),p=a(d,i(t[0]));return{srcRootClientId:u,isDraggable:n(t,u),icon:p?.icon||s(d)?.icon,visibleInserter:l(),getBlockType:s}}),[t]),g=(0,u.useRef)(!1),[b,v,k]=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,Es.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,i=e.current-n.current.offsetTop,l=o.clientY-n.current.offsetTop;if(o.clientY>i){const e=Math.max(r-i-50,0),n=Math.max(l-i-50,0),o=0===e||0===n?0:n/e;t.current=25*o}else if(o.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-l-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:_,getBlockNamesByClientId:y,getBlockRootClientId:w}=(0,d.useSelect)(hr),{startDraggingBlocks:E,stopDraggingBlocks:S}=(0,d.useDispatch)(hr);(0,u.useEffect)((()=>()=>{g.current&&S()}),[]);const C=Vu(t[0]),x=C.current?.closest("body");if((0,u.useEffect)((()=>{if(!x||!i)return;const e=(0,p.throttle)((e=>{if(!e.target.closest("[data-block]"))return;const n=y(t),o=e.target.closest("[data-block]").getAttribute("data-block"),r=_(o),i=y([o])[0];let l;if(0===r?.length){const e=w(o),t=y([e])[0],r=_(e);l=Uw(f,r,n,t)}else l=Uw(f,r,n,i);l||h?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")}),200);return x.addEventListener("dragover",e),()=>{x.removeEventListener("dragover",e)}}),[t,x,i,_,y,w,f,h]),!a)return e({draggable:!1});const B={type:"block",srcClientIds:t,srcRootClientId:l};return(0,s.createElement)(ui.Draggable,{cloneClassname:n,__experimentalTransferDataType:"wp-blocks",transferData:B,onDragStart:e=>{window.requestAnimationFrame((()=>{E(t),g.current=!0,b(e),o&&o()}))},onDragOver:v,onDragEnd:()=>{S(),g.current=!1,k(),r&&r()},__experimentalDragComponent:(0,s.createElement)(K_,{count:t.length,icon:m,fadeWhenDisabled:!0})},(({onDraggableStart:t,onDraggableEnd:n})=>e({draggable:!0,onDragStart:t,onDragEnd:n})))},hE=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),fE=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const gE=(e,t)=>"up"===e?"horizontal"===t?(0,S.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,S.isRTL)()?"left":"right":"down":null;const bE=(e,t)=>"up"===e?"horizontal"===t?(0,S.isRTL)()?Wk:Kk:hE:"down"===e?"horizontal"===t?(0,S.isRTL)()?Kk:Wk:fE:null,vE=(e,t)=>"up"===e?"horizontal"===t?(0,S.isRTL)()?(0,S.__)("Move right"):(0,S.__)("Move left"):(0,S.__)("Move up"):"down"===e?"horizontal"===t?(0,S.isRTL)()?(0,S.__)("Move left"):(0,S.__)("Move right"):(0,S.__)("Move down"):null,kE=(0,u.forwardRef)((({clientIds:e,direction:t,orientation:n,...o},r)=>{const i=(0,p.useInstanceId)(kE),l=Array.isArray(e)?e:[e],a=l.length,{blockType:u,isDisabled:m,rootClientId:h,isFirst:f,isLast:g,firstIndex:b,orientation:v="vertical"}=(0,d.useSelect)((e=>{const{getBlockIndex:o,getBlockRootClientId:r,getBlockOrder:i,getBlock:s,getBlockListSettings:a}=e(hr),u=l[0],d=r(u),p=o(u),m=o(l[l.length-1]),h=i(d),f=s(u),g=0===p,b=m===h.length-1,{orientation:v}=a(d)||{};return{blockType:f?(0,c.getBlockType)(f.name):null,isDisabled:"up"===t?g:b,rootClientId:d,firstIndex:p,isFirst:g,isLast:b,orientation:n||v}}),[e,t]),{moveBlocksDown:k,moveBlocksUp:_}=(0,d.useDispatch)(hr),y="up"===t?_:k,w=`block-editor-block-mover-button__description-${i}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.Button,{ref:r,className:oi()("block-editor-block-mover-button",`is-${t}-button`),icon:bE(t,v),label:vE(t,v),"aria-describedby":w,...o,onClick:m?null:t=>{y(e,h),o.onClick&&o.onClick(t)},disabled:m,__experimentalIsFocusable:!0}),(0,s.createElement)(ui.VisuallyHidden,{id:w},function(e,t,n,o,r,i,l){const s=n+1;if(e>1)return function(e,t,n,o,r,i){const l=t+1;if(n&&o)return(0,S.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=gE("down",i);if("down"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d down by one place"),e,l);if("left"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(r>0&&o){const e=gE("down",i);if("down"===e)return(0,S.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,S.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,S.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=gE("up",i);if("up"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d up by one place"),e,l);if("left"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,S.sprintf)(
// translators: 1: Number of selected blocks, 2: Position of selected blocks
(0,S.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(r<0&&n){const e=gE("up",i);if("up"===e)return(0,S.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,S.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,S.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,i,l);if(o&&r)return(0,S.sprintf)(
// translators: %s: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!r){const e=gE("down",l);if("down"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(i>0&&r){const e=gE("down",l);if("down"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!o){const e=gE("up",l);if("up"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
(0,S.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(i<0&&o){const e=gE("up",l);if("up"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,S.sprintf)(
// translators: 1: Type of block (i.e. Text, Image etc)
(0,S.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(a,u&&u.title,b,f,g,"up"===t?-1:1,v)))})),_E=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(kE,{direction:"up",ref:t,...e}))),yE=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(kE,{direction:"down",ref:t,...e})));var wE=function({clientIds:e,hideDragHandle:t}){const{canMove:n,rootClientId:o,isFirst:r,isLast:i,orientation:l}=(0,d.useSelect)((t=>{const{getBlockIndex:n,getBlockListSettings:o,canMoveBlocks:r,getBlockOrder:i,getBlockRootClientId:l}=t(hr),s=Array.isArray(e)?e:[e],a=s[0],c=l(a),u=n(a),d=n(s[s.length-1]),p=i(c);return{canMove:r(e,c),rootClientId:c,isFirst:0===u,isLast:d===p.length-1,orientation:o(c)?.orientation}}),[e]);if(!n||r&&i&&!o)return null;const a=(0,S.__)("Drag");return(0,s.createElement)(ui.ToolbarGroup,{className:oi()("block-editor-block-mover",{"is-horizontal":"horizontal"===l})},!t&&(0,s.createElement)(mE,{clientIds:e,fadeWhenDisabled:!0},(e=>(0,s.createElement)(ui.Button,{icon:W_,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)(ui.ToolbarItem,null,(t=>(0,s.createElement)(_E,{clientIds:e,...t}))),(0,s.createElement)(ui.ToolbarItem,null,(t=>(0,s.createElement)(yE,{clientIds:e,...t})))))};const{clearTimeout:EE,setTimeout:SE}=window,CE=200;function xE({ref:e,isFocused:t,highlightParent:n,debounceTimeout:o=CE}){const{getSelectedBlockClientId:r,getBlockRootClientId:i}=(0,d.useSelect)(hr),{toggleBlockHighlight:l}=(0,d.useDispatch)(hr),s=(0,u.useRef)(),a=(0,d.useSelect)((e=>e(hr).getSettings().isDistractionFree),[]),c=e=>{if(e&&a)return;const t=r(),o=n?i(t):t;l(o,e)},p=()=>{const e=s.current;e&&EE&&EE(e)};return(0,u.useEffect)((()=>()=>{c(!1),p()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),p(),c(!0)},debouncedHideGestures:n=>{n&&n.stopPropagation(),p(),s.current=SE((()=>{(()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n})()&&c(!1)}),o)}}}function BE({ref:e,highlightParent:t=!1,debounceTimeout:n=CE}){const[o,r]=(0,u.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:l}=xE({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),i())},o=()=>{a()||(r(!1),l())};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,i,l]),{onMouseMove:i,onMouseLeave:l}}function IE(){const{selectBlock:e}=(0,d.useDispatch)(hr),{firstParentClientId:t,isVisible:n}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getBlockEditingMode:r}=e(hr),{hasBlockSupport:i}=e(c.store),l=n(o()),s=l[l.length-1],a=t(s),u=(0,c.getBlockType)(a);return{firstParentClientId:s,isVisible:s&&"default"===r(s)&&i(u,"__experimentalParentSelector",!0)}}),[]),o=Em(t),r=(0,u.useRef)(),i=BE({ref:r,highlightParent:!0});return n?(0,s.createElement)("div",{className:"block-editor-block-parent-selector",key:t,ref:r,...i},(0,s.createElement)(ui.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,S.sprintf)(/* translators: %s: Name of the block's parent. */
(0,S.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,s.createElement)(hh,{icon:o?.icon})})):null}var TE=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 PE({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)(ui.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,S.__)("Preview")),(0,s.createElement)(H_,{viewportWidth:500,blocks:e})))))}const ME={};function RE({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i}=e;return(0,s.createElement)(ui.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,s.createElement)(hh,{icon:r,showColors:!0}),i)}var AE=({transformations:e,onSelect:t,blocks:n})=>{const[o,r]=(0,u.useState)();return(0,s.createElement)(s.Fragment,null,o&&(0,s.createElement)(PE,{blocks:(0,c.cloneBlock)(n[0],e.find((({name:e})=>e===o)).attributes)}),e?.map((e=>(0,s.createElement)(RE,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:r}))))};function NE({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,s.createElement)(LE,{key:e.name,item:e,onSelect:t,setHoveredTransformItemName:n})))}function LE({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:o,icon:r,title:i,isDisabled:l}=e;return(0,s.createElement)(ui.MenuItem,{className:(0,c.getBlockMenuDefaultClassName)(o),onClick:e=>{e.preventDefault(),t(o)},disabled:l,onMouseLeave:()=>n(null),onMouseEnter:()=>n(o)},(0,s.createElement)(hh,{icon:r,showColors:!0}),i)}var OE=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:o,onSelectVariation:r,blocks:i})=>{const[l,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);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),m=d.length&&p.length,h=!!p.length&&(0,s.createElement)(NE,{restTransformations:p,onSelect:o,setHoveredTransformItemName:a});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Transform to"),className:e},l&&(0,s.createElement)(PE,{blocks:(0,c.switchToBlockType)(i,l)}),!!n?.length&&(0,s.createElement)(AE,{transformations:n,blocks:i,onSelect:r}),d.map((e=>(0,s.createElement)(LE,{key:e.name,item:e,onSelect:o,setHoveredTransformItemName:a}))),!m&&h),!!m&&(0,s.createElement)(ui.MenuGroup,{className:e},h))};function DE(e,t,n){const o=new(Vd())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function zE(e){return e?.find((e=>e.isDefault))}function FE({clientId:e,onSwitch:t}){const{styles:n,block:o,blockType:r,className:i}=(0,d.useSelect)((t=>{const{getBlock:n}=t(hr),o=n(e);if(!o)return{};const r=(0,c.getBlockType)(o.name),{getBlockStyles:i}=t(c.store);return{block:o,blockType:r,styles:i(o.name),className:o.attributes.className||""}}),[e]),{updateBlockAttributes:l}=(0,d.useDispatch)(hr),s=function(e){return e&&0!==e.length?zE(e)?e:[{name:"default",label:(0,S._x)("Default","block style"),isDefault:!0},...e]:[]}(n),a=function(e,t){for(const n of new(Vd())(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 zE(e)}(s,i),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=DE(i,a,n);l(e,{className:o}),t()},stylesToRender:s,activeStyle:a,genericPreviewBlock:p,className:i}}const VE=()=>{};function HE({clientId:e,onSwitch:t=VE}){const{onSelect:n,stylesToRender:o,activeStyle:r}=FE({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)(ui.MenuItem,{key:e.name,icon:r.name===e.name?dp:null,onClick:()=>n(e)},(0,s.createElement)(ui.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function UE({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,s.createElement)(ui.MenuGroup,{label:(0,S.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(HE,{clientId:n,onSwitch:t}))}const GE=(e,t,n=new Set)=>{const{clientId:o,name:r,innerBlocks:i=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of i){const o=GE(e,t,n);if(o)return o}}},$E=(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}};const{CompositeV2:jE,CompositeItemV2:WE,useCompositeStoreV2:KE}=pr(ui.privateApis);function ZE({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)(ui.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)(qE,{patterns:e,onSelect:t})))))}function qE({patterns:e,onSelect:t}){const n=KE();return(0,s.createElement)(jE,{store:n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,S.__)("Patterns list")},e.map((e=>(0,s.createElement)(YE,{key:e.name,pattern:e,onSelect:t}))))}function YE({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",o=(0,p.useInstanceId)(YE,`${n}-list__item-description`);return(0,s.createElement)("div",{className:`${n}-list__list-item`},(0,s.createElement)(WE,{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)(H_,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,s.createElement)("div",{className:`${n}-list__item-title`},e.title)),!!e.description&&(0,s.createElement)(ui.VisuallyHidden,{id:o},e.description))}var XE=function({blocks:e,patterns:t,onSelect:n}){const[o,r]=(0,u.useState)(!1),i=((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=GE(r,t.name,o);if(n){e=!0,o.add(n.clientId),$E(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(t,e);return i.length?(0,s.createElement)(ui.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,s.createElement)(ZE,{patterns:i,onSelect:n}),(0,s.createElement)(ui.MenuItem,{onClick:e=>{e.preventDefault(),r(!o)},icon:Wk},(0,S.__)("Patterns"))):null};const QE=({clientIds:e,blocks:t})=>{const{replaceBlocks:n,multiSelect:o,updateBlockAttributes:r}=(0,d.useDispatch)(hr),i=Em(t[0].clientId),{possibleBlockTransformations:l,canRemove:a,hasBlockStyles:p,icon:m,patterns:h}=(0,d.useSelect)((n=>{const{getBlockRootClientId:o,getBlockTransformItems:r,__experimentalGetPatternTransformItems:l,canRemoveBlocks:s}=n(hr),{getBlockStyles:a,getBlockType:u}=n(c.store),d=o(Array.isArray(e)?e[0]:e),[{name:p}]=t,m=1===t.length,h=m&&a(p);let f;return f=m?i?.icon:1===new Set(t.map((({name:e})=>e))).size?u(p)?.icon:TE,{possibleBlockTransformations:r(t,d),canRemove:s(e,d),hasBlockStyles:!!h?.length,icon:f,patterns:l(t,d)}}),[e,t,i?.icon]),f=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:o}=(0,d.useSelect)((n=>{const{getBlockRootClientId:o,getBlockAttributes:r,canRemoveBlocks:i}=n(hr),{getActiveBlockVariation:l,getBlockVariations:s}=n(c.store),a=o(Array.isArray(e)?e[0]:e),u=i(e,a);if(1!==t.length||!u)return ME;const[d]=t;return{blockVariationTransformations:s(d.name,"transform"),activeBlockVariation:l(d.name,r(d.clientId))}}),[e,t]);return(0,u.useMemo)((()=>o?.filter((({name:e})=>e!==n?.name))),[o,n])}({clientIds:e,blocks:t}),g=Sf({clientId:Array.isArray(e)?e[0]:e,maximumLength:35}),b=1===t.length,v=b&&(0,c.isReusableBlock)(t[0]),k=b&&(0,c.isTemplatePart)(t[0]);function _(e){e.length>1&&o(e[0].clientId,e[e.length-1].clientId)}const y=!!l.length&&a&&!k,w=!!f?.length,E=!!h?.length&&a,C=y||w;if(!(p||C||E))return(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:g,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hh,{icon:m,showColors:!0}),(v||k)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},g))}));const x=b?g:(0,S.__)("Multiple blocks selected"),B=b?(0,S.__)("Change block type or style"):(0,S.sprintf)(/* translators: %d: number of blocks. */
(0,S._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarItem,null,(o=>(0,s.createElement)(ui.DropdownMenu,{className:"block-editor-block-switcher",label:x,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hh,{icon:m,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||k)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},g)),toggleProps:{describedBy:B,...o},menuProps:{orientation:"both"}},(({onClose:o})=>(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},E&&(0,s.createElement)(XE,{blocks:t,patterns:h,onSelect:t=>{!function(t){n(e,t),_(t)}(t),o()}}),C&&(0,s.createElement)(OE,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,possibleBlockVariationTransformations:f,blocks:t,onSelect:r=>{!function(o){const r=(0,c.switchToBlockType)(t,o);n(e,r),_(r)}(r),o()},onSelectVariation:e=>{!function(e){r(t[0].clientId,{...f.find((({name:t})=>t===e)).attributes})}(e),o()}}),p&&(0,s.createElement)(UE,{hoveredBlock:t[0],onSwitch:o})))))))};var JE=({clientIds:e})=>{const t=(0,d.useSelect)((t=>t(hr).getBlocksByClientId(e)),[e]);return!t.length||t.some((e=>!e))?null:(0,s.createElement)(QE,{clientIds:e,blocks:t})};const{Fill:eS,Slot:tS}=(0,ui.createSlotFill)("__unstableBlockToolbarLastItem");eS.Slot=tS;var nS=eS;const oS="__experimentalBorder",rS="color",iS="typography.__experimentalFontFamily",lS="typography.fontSize",sS=["typography.lineHeight",lS,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",iS,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",oS,rS,"spacing"],aS={align:e=>(0,c.hasBlockSupport)(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==u.Platform.OS)return!1;const n=(0,c.getBlockSupport)(e,oS);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,rS);return t&&!1!==t.background},textColor:e=>{const t=(0,c.getBlockSupport)(e,rS);return t&&!1!==t.text},gradient:e=>{const t=(0,c.getBlockSupport)(e,rS);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>(0,c.hasBlockSupport)(e,"customClassName",!0),fontFamily:e=>(0,c.hasBlockSupport)(e,iS),fontSize:e=>(0,c.hasBlockSupport)(e,lS),layout:e=>(0,c.hasBlockSupport)(e,"layout"),style:e=>sS.some((t=>(0,c.hasBlockSupport)(e,t)))};function cS(e,t){return Object.entries(aS).reduce(((n,[o,r])=>(r(e.name)&&r(t.name)&&(n[o]=e.attributes[o]),n)),{})}function uS(e,t,n){for(let o=0;o<Math.min(t.length,e.length);o+=1)n(e[o].clientId,cS(t[o],e[o])),uS(e[o].innerBlocks,t[o].innerBlocks,n)}function dS({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:i,canMoveBlocks:l,canRemoveBlocks:s}=(0,d.useSelect)(hr),{getDefaultBlockName:a,getGroupingBlockName:p}=(0,d.useSelect)(c.store),m=i(e),h=r(e[0]),f=m.every((e=>!!e&&((0,c.hasBlockSupport)(e.name,"color")||(0,c.hasBlockSupport)(e.name,"typography")))),g=m.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,h))),b=o(a(),h),v=l(e,h),k=s(e,h),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:w,insertAfterBlock:E,insertBeforeBlock:C,flashBlock:x,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:T}=(0,d.useDispatch)(hr),P=v_(),M=function(){const e=(0,d.useRegistry)(),{updateBlockAttributes:t}=(0,d.useDispatch)(hr),{createSuccessNotice:n,createWarningNotice:o,createErrorNotice:r}=(0,d.useDispatch)(Ss.store);return(0,u.useCallback)((async i=>{let l="";try{if(!window.navigator.clipboard)return void r((0,S.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});l=await window.navigator.clipboard.readText()}catch(e){return void r((0,S.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!l||!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}}(l))return void o((0,S.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const s=(0,c.parse)(l);if(1===s.length?e.batch((()=>{uS(i,i.map((()=>s[0])),t)})):e.batch((()=>{uS(i,s,t)})),1===i.length){const e=(0,c.getBlockType)(i[0].name)?.title;n((0,S.sprintf)(
// Translators: Name of the block being pasted, e.g. "Paragraph".
(0,S.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,S.sprintf)(
// Translators: The number of the blocks.
(0,S.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,o,r])}();return t({canCopyStyles:f,canDuplicate:g,canInsertDefaultBlock:b,canMove:v,canRemove:k,rootClientId:h,blocks:m,onDuplicate(){return w(e,n)},onRemove(){return _(e,n)},onInsertBefore(){const t=Array.isArray(e)?e[0]:t;C(t)},onInsertAfter(){const t=Array.isArray(e)?e[e.length-1]:t;E(t)},onMoveTo(){I(!0),T(e[0]),B(e[0])},onGroup(){if(!m.length)return;const t=p(),n=(0,c.switchToBlockType)(m,t);n&&y(e,n)},onUngroup(){if(!m.length)return;const t=m[0].innerBlocks;t.length&&y(e,t)},onCopy(){const e=m.map((({clientId:e})=>e));1===m.length&&x(e[0]),P("copy",e)},async onPasteStyles(){await M(m)}})}var pS=function({clientId:e}){const t=(0,d.useSelect)((t=>t(hr).getBlock(e)),[e]),{replaceBlocks:n}=(0,d.useDispatch)(hr);return t&&"core/html"===t.name?(0,s.createElement)(ui.MenuItem,{onClick:()=>n(e,(0,c.rawHandler)({HTML:(0,c.getBlockContent)(t)}))},(0,S.__)("Convert to Blocks")):null};const{Fill:mS,Slot:hS}=(0,ui.createSlotFill)("__unstableBlockSettingsMenuFirstItem");mS.Slot=hS;var fS=mS;const gS={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function bS({blocks:e,onCopy:t,label:n}){const o=(0,p.useCopyToClipboard)((()=>(0,c.serialize)(e)),t),r=e.length>1?(0,S.__)("Copy blocks"):(0,S.__)("Copy"),i=n||r;return(0,s.createElement)(ui.MenuItem,{ref:o},i)}function vS({parentClientId:e,parentBlockType:t}){const n=(0,p.useViewportMatch)("medium","<"),{selectBlock:o}=(0,d.useDispatch)(hr),r=(0,u.useRef)(),i=BE({ref:r,highlightParent:!0});return n?(0,s.createElement)(ui.MenuItem,{...i,ref:r,icon:(0,s.createElement)(hh,{icon:t.icon}),onClick:()=>o(e)},(0,S.sprintf)(/* translators: %s: Name of the block's parent. */
(0,S.__)("Select parent block (%s)"),t.title)):null}function kS({block:e,clientIds:t,__experimentalSelectBlock:n,children:o,__unstableDisplayLocation:r,...i}){const l=e?.clientId,a=Array.isArray(t)?t:[t],m=a.length,h=a[0],{firstParentClientId:f,onlyBlock:g,parentBlockType:b,previousBlockClientId:v,selectedBlockClientIds:k}=(0,d.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:o,getPreviousBlockClientId:r,getSelectedBlockClientIds:i,getBlockAttributes:l}=e(hr),{getActiveBlockVariation:s}=e(c.store),a=o(h),u=a&&n(a);return{firstParentClientId:a,onlyBlock:1===t(a),parentBlockType:a&&(s(u,l(a))||(0,c.getBlockType)(u)),previousBlockClientId:r(h),selectedBlockClientIds:i()}}),[h]),{getBlockOrder:_,getSelectedBlockClientIds:y}=(0,d.useSelect)(hr),w=(0,d.useSelect)((e=>pr(e(hr)).getOpenedBlockSettingsMenu()),[]),{setOpenedBlockSettingsMenu:E}=pr((0,d.useDispatch)(hr)),C=(0,d.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Qk.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,Qk.__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||f;e||(e=_()[0]);const t=B&&0===y().length;n(e,t)}}),[n,v,f,_,B,y]),P=1===m?(0,S.__)("Delete"):(0,S.__)("Delete blocks"),M=k?.includes(f),R=l?w===l||!1:void 0,A=(0,u.useCallback)((e=>{e&&w!==l?E(l):!e&&w&&w===l&&E(void 0)}),[l,w,E]);return(0,s.createElement)(dS,{clientIds:t,__experimentalUpdateSelection:!n},(({canCopyStyles:e,canDuplicate:n,canInsertDefaultBlock:l,canMove:a,canRemove:c,onDuplicate:d,onInsertAfter:v,onInsertBefore:k,onRemove:_,onCopy:y,onPasteStyles:w,onMoveTo:B,blocks:N})=>(0,s.createElement)(ui.DropdownMenu,{icon:Lf,label:(0,S.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:gS,open:R,onToggle:A,noIcons:!0,menuProps:{onKeyDown(e){e.defaultPrevented||(x("core/block-editor/remove",e)&&c?(e.preventDefault(),T(_())):x("core/block-editor/duplicate",e)&&n?(e.preventDefault(),I(d())):x("core/block-editor/insert-after",e)&&l?(e.preventDefault(),E(void 0),v()):x("core/block-editor/insert-before",e)&&l&&(e.preventDefault(),E(void 0),k()))}},...i},(({onClose:i})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(fS.Slot,{fillProps:{onClose:i}}),!M&&!!f&&(0,s.createElement)(vS,{parentClientId:f,parentBlockType:b}),1===m&&(0,s.createElement)(pS,{clientId:h}),(0,s.createElement)(bS,{blocks:N,onCopy:y}),n&&(0,s.createElement)(ui.MenuItem,{onClick:(0,p.pipe)(i,d,I),shortcut:C.duplicate},(0,S.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.MenuItem,{onClick:(0,p.pipe)(i,k),shortcut:C.insertBefore},(0,S.__)("Add before")),(0,s.createElement)(ui.MenuItem,{onClick:(0,p.pipe)(i,v),shortcut:C.insertAfter},(0,S.__)("Add after")))),e&&(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(bS,{blocks:N,onCopy:y,label:(0,S.__)("Copy styles")}),(0,s.createElement)(ui.MenuItem,{onClick:w},(0,S.__)("Paste styles"))),(0,s.createElement)(ah.Slot,{fillProps:{onClose:i,canMove:a,onMoveTo:B,onlyBlock:g,count:m,firstBlockClientId:h},clientIds:t,__unstableDisplayLocation:r}),"function"==typeof o?o({onClose:i}):u.Children.map((e=>(0,u.cloneElement)(e,{onClose:i}))),c&&(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(ui.MenuItem,{onClick:(0,p.pipe)(i,_,T),shortcut:C.remove},P)))))))}var _S=kS,yS=function({clientIds:e,...t}){return(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarItem,null,(n=>(0,s.createElement)(_S,{clientIds:e,toggleProps:n,...t}))))};function wS({clientId:e}){const{canLock:t,isLocked:n}=Wm(e),[o,r]=(0,u.useReducer)((e=>!e),!1),i=(0,u.useRef)(!1);return(0,u.useEffect)((()=>{n&&(i.current=!0)}),[n]),t&&(n||i.current)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(ui.ToolbarButton,{icon:n?qm:Km,label:n?(0,S.__)("Unlock"):(0,S.__)("Lock"),onClick:r,"aria-expanded":o,"aria-haspopup":"dialog"})),o&&(0,s.createElement)(Qm,{clientId:e,onClose:r})):null}var ES=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),SS=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),CS=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 xS={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var BS=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=$m(),{replaceBlocks:r}=(0,d.useDispatch)(hr),{canRemove:i,variations:l}=(0,d.useSelect)((e=>{const{canRemoveBlocks:o}=e(hr),{getBlockVariations:r}=e(c.store);return{canRemove:o(t),variations:r(n,"transform")}}),[t,n]),a=o=>{const i=(0,c.switchToBlockType)(e,n);"string"!=typeof o&&(o="group"),i&&i.length>0&&(i[0].attributes.layout=xS[o],r(t,i))};if(!o||!i)return null;const u=!!l.find((({name:e})=>"group-row"===e)),p=!!l.find((({name:e})=>"group-stack"===e));return(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarButton,{icon:ES,label:(0,S._x)("Group","verb"),onClick:a}),u&&(0,s.createElement)(ui.ToolbarButton,{icon:SS,label:(0,S._x)("Row","single horizontal line"),onClick:()=>a("row")}),p&&(0,s.createElement)(ui.ToolbarButton,{icon:CS,label:(0,S._x)("Stack","verb"),onClick:()=>a("stack")}))};function IS({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,d.useSelect)((e=>!!t&&"html"===e(hr).getBlockMode(t)),[t]),{toggleBlockMode:o}=(0,d.useDispatch)(hr);return n?(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarButton,{onClick:()=>{o(t)}},(0,S.__)("Edit visually"))):null}var TS=(0,u.createContext)("");function PS(e){return Array.from(e.querySelectorAll('[data-toolbar-item]:not([disabled]):not([aria-disabled="true"])'))}function MS({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:o=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:i,...l}){const a=(0,u.useRef)(),c=function(e){const[t,n]=(0,u.useState)(!0),o=(0,u.useCallback)((()=>{const t=!Es.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||y()("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 function({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:o,onIndexChange:r,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:l}){const[s]=(0,u.useState)(t),[a]=(0,u.useState)(o),c=(0,u.useCallback)((()=>{!function(e){const[t]=Es.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,Qk.useShortcut)("core/block-editor/focus-toolbar",(()=>{i&&c()})),(0,u.useEffect)((()=>{s&&c()}),[n,s,c]),(0,u.useEffect)((()=>{const t=e.current;let n=0;return s||(n=window.requestAnimationFrame((()=>{const e=PS(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=PS(t).findIndex((e=>0===e.tabIndex));r(e)}}),[a,s,r,e]);const{getLastFocus:p}=pr((0,d.useSelect)(hr));(0,u.useEffect)((()=>{const t=e.current;if(l){const e=e=>{const t=p();e.keyCode===xs.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[l,p,e])}({toolbarRef:a,focusOnMount:t,defaultIndex:r,onIndexChange:i,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:n}),c?(0,s.createElement)(ui.Toolbar,{label:l["aria-label"],ref:a,...l},e):(0,s.createElement)(ui.NavigableMenu,{orientation:"horizontal",role:"toolbar",ref:a,...l},e)}function RS(e="default"){const t=di[e]?.Slot,n=(0,ui.__experimentalUseSlotFills)(t?.__unstableName);return t?!!n?.length:null}function AS({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,variant:r="unstyled"}){const{blockClientId:i,blockClientIds:l,isDefaultEditingMode:a,blockType:m,shouldShowVisualToolbar:h,showParentSelector:f}=(0,d.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:o,getSelectedBlockClientIds:r,isBlockValid:i,getBlockRootClientId:l,getBlockEditingMode:s}=e(hr),a=r(),u=a[0],d=l(u),p=o(u),m=p[p.length-1],h=t(m),f=(0,c.getBlockType)(h),g="default"===s(u),b=a.every((e=>i(e))),v=a.every((e=>"visual"===n(e)));return{blockClientId:u,blockClientIds:a,isDefaultEditingMode:g,blockType:u&&(0,c.getBlockType)(t(u)),shouldShowVisualToolbar:b&&v,rootClientId:d,showParentSelector:f&&"default"===s(m)&&(0,c.hasBlockSupport)(f,"__experimentalParentSelector",!0)&&1===a.length&&g}}),[]),g=(0,u.useRef)(null),b=(0,u.useRef)(),v=BE({ref:b}),k=!(0,p.useViewportMatch)("medium","<"),_=m&&(0,c.hasBlockSupport)(m,"__experimentalToolbar",!0),y=function(){let e=!1;for(const t in di)RS(t)&&(e=!0);return e}();if(!_||!a&&!y)return null;const w=l.length>1,E=(0,c.isReusableBlock)(m)||(0,c.isTemplatePart)(m),C=oi()("block-editor-block-contextual-toolbar",{"has-parent":f}),x=oi()("block-editor-block-toolbar",{"is-synced":E});return(0,s.createElement)(MS,{focusEditorOnEscape:!0,className:C
/* translators: accessibility text for the block toolbar */,"aria-label":(0,S.__)("Block tools"),variant:"toolbar"===r?void 0:r,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:o,key:i},(0,s.createElement)("div",{ref:g,className:x},!w&&k&&a&&(0,s.createElement)(IE,null),(h||w)&&a&&(0,s.createElement)("div",{ref:b,...v},(0,s.createElement)(ui.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(JE,{clientIds:l}),!w&&(0,s.createElement)(wS,{clientId:i}),(0,s.createElement)(wE,{clientIds:l,hideDragHandle:e}))),h&&w&&(0,s.createElement)(BS,null),h&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bi.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(bi.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(bi.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(bi.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(bi.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(TS.Provider,{value:m?.name},(0,s.createElement)(nS.Slot,null))),(0,s.createElement)(IS,{clientIds:l}),a&&(0,s.createElement)(yS,{clientIds:l})))}function NS({hideDragHandle:e,variant:t}){return(0,s.createElement)(AS,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}function LS({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:o,isInsertionPointVisible:r,lastClientId:i}=dE(e),l=(0,u.useRef)();(0,u.useEffect)((()=>{l.current=void 0}),[e]);const{stopTyping:a}=(0,d.useDispatch)(hr),c=(0,u.useRef)(!1);(0,Qk.useShortcut)("core/block-editor/focus-toolbar",(()=>{c.current=!0,a(!0)})),(0,u.useEffect)((()=>{c.current=!1}));const p=uE({contentElement:n?.current,clientId:e});return!t&&(0,s.createElement)(Op,{clientId:o||e,bottomClientId:i,className:oi()("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...p},(0,s.createElement)(AS,{focusOnMount:c.current,__experimentalInitialIndex:l.current,__experimentalOnIndexChange:e=>{l.current=e},variant:"toolbar"}))}var OS=function({clientId:e,rootClientId:t}){const n=Em(e),o=(0,d.useSelect)((n=>{const{getBlock:o,getBlockIndex:r,hasBlockMovingClientId:i,getBlockListSettings:l,__unstableGetEditorMode:s}=n(hr),a=r(e),{name:c,attributes:u}=o(e);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:l(t)?.orientation,editorMode:s()}}),[e,t]),{index:r,name:i,attributes:l,blockMovingMode:a,orientation:p,editorMode:m}=o,{setNavigationMode:h,removeBlock:f}=(0,d.useDispatch)(hr),g=(0,u.useRef)(),b=(0,c.getBlockType)(i),v=(0,c.__experimentalGetAccessibleBlockLabel)(b,l,r+1,p);(0,u.useEffect)((()=>{g.current.focus(),(0,Zn.speak)(v)}),[v]);const k=Hu(e),{hasBlockMovingClientId:_,getBlockIndex:y,getBlockRootClientId:w,getClientIdsOfDescendants:E,getSelectedBlockClientId:C,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:B,getNextBlockClientId:I}=(0,d.useSelect)(hr),{selectBlock:T,clearSelectedBlock:P,setBlockMovingClientId:M,moveBlockToPosition:R}=(0,d.useDispatch)(hr),A=oi()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!a}),N=(0,S.__)("Drag");return(0,s.createElement)("div",{className:A},(0,s.createElement)(ui.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(hh,{icon:n?.icon,showColors:!0})),(0,s.createElement)(ui.FlexItem,null,"zoom-out"===m&&(0,s.createElement)(wE,{clientIds:[e],hideDragHandle:!0}),"navigation"===m&&(0,s.createElement)(mE,{clientIds:[e]},(e=>(0,s.createElement)(ui.Button,{icon:W_,className:"block-selection-button_drag-handle","aria-hidden":"true",label:N,tabIndex:"-1",...e})))),(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(ui.Button,{ref:g,onClick:"navigation"===m?()=>h(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,o=n===xs.UP,r=n===xs.DOWN,i=n===xs.LEFT,l=n===xs.RIGHT,s=n===xs.TAB,a=n===xs.ESCAPE,c=n===xs.ENTER,u=n===xs.SPACE,d=t.shiftKey;if(n===xs.BACKSPACE||n===xs.DELETE)return f(e),void t.preventDefault();const p=C(),m=x(),h=B(m||p),g=I(m||p),b=s&&d||o,v=s&&!d||r,S=i,A=l;let N;if(b)N=h;else if(v)N=g;else if(S){var L;N=null!==(L=w(p))&&void 0!==L?L:p}else if(A){var O;N=null!==(O=E(p)[0])&&void 0!==O?O:p}const D=_();if(a&&D&&!t.defaultPrevented&&(M(null),t.preventDefault()),(c||u)&&D){const e=w(D),t=w(p),n=y(D);let o=y(p);n<o&&e===t&&(o-=1),R(D,e,t,o),T(D),M(null)}if((!D||p!==D||!A)&&(v||b||S||A))if(N)t.preventDefault(),T(N);else if(s&&p){let e;if(v){e=k;do{e=Es.focus.tabbable.findNext(e)}while(e&&k.contains(e));e||(e=k.ownerDocument.defaultView.frameElement,e=Es.focus.tabbable.findNext(e))}else e=Es.focus.tabbable.findPrevious(k);e&&(t.preventDefault(),e.focus(),P())}},label:v,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Cf,{clientId:e,maximumLength:35})))))};function DS({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:o,lastClientId:r,rootClientId:i}=dE(e),l=uE({contentElement:t?.current,clientId:e});return(0,s.createElement)(Op,{clientId:n||e,bottomClientId:r,className:oi()("block-editor-block-list__block-popover",{"is-insertion-point-visible":o}),resize:!1,...l},(0,s.createElement)(OS,{clientId:e,rootClientId:i}))}var zS=function({__unstableContentRef:e}){const[t,n]=(0,u.useState)(!1),o=(0,d.useSelect)((e=>e(hr).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)(Cw,{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)(gw,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function FS(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:o,getSettings:r,hasMultiSelection:i,__unstableGetEditorMode:l,isTyping:s}=e(hr),a=t()||n(),{name:u="",attributes:d={}}=o(a)||{},p=l(),m=a&&u,h=(0,c.isUnmodifiedDefaultBlock)({name:u,attributes:d}),f=a&&!s()&&"edit"===p&&(0,c.isUnmodifiedDefaultBlock)({name:u,attributes:d}),g=m&&!i()&&("navigation"===p||"zoom-out"===p);return{clientId:a,hasFixedToolbar:r().hasFixedToolbar,isTyping:s(),isZoomOutMode:"zoom-out"===p,showEmptyBlockSideInserter:f,showBreadcrumb:!f&&g,showBlockToolbar:!r().hasFixedToolbar&&!f&&m&&!h&&!g}}function VS({children:e,__unstableContentRef:t,...n}){const{clientId:o,hasFixedToolbar:r,isTyping:i,isZoomOutMode:l,showEmptyBlockSideInserter:a,showBreadcrumb:c,showBlockToolbar:p}=(0,d.useSelect)(FS,[]),m=(0,Qk.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:h,getBlockRootClientId:f}=(0,d.useSelect)(hr),{duplicateBlocks:g,removeBlocks:b,insertAfterBlock:v,insertBeforeBlock:k,clearSelectedBlock:_,selectBlock:y,moveBlocksUp:w,moveBlocksDown:E}=(0,d.useDispatch)(hr),S=Np(t),C=Np(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=f(t[0]);w(t,n)}}else if(m("core/block-editor/move-down",e)){const t=h();if(t.length){e.preventDefault();const n=f(t[0]);E(t,n)}}else if(m("core/block-editor/duplicate",e)){const t=h();t.length&&(e.preventDefault(),g(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 n=h();n.length&&(e.preventDefault(),n.length>1?y(n[0]):_(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),t?.current.focus())}}},(0,s.createElement)(Iw.Provider,{value:(0,u.useRef)(!1)},!i&&(0,s.createElement)(Pw,{__unstableContentRef:t}),a&&(0,s.createElement)(pE,{__unstableContentRef:t,clientId:o}),p&&(0,s.createElement)(LS,{__unstableContentRef:t,clientId:o,isTyping:i}),c&&(0,s.createElement)(DS,{__unstableContentRef:t,clientId:o}),!l&&!r&&(0,s.createElement)(ui.Popover.Slot,{name:"block-toolbar",ref:S}),e,(0,s.createElement)(ui.Popover.Slot,{name:"__unstable-block-tools-after",ref:C}),l&&(0,s.createElement)(zS,{__unstableContentRef:t})))}function HS({shouldIframe:e=!0,height:t="300px",children:n=(0,s.createElement)(oE,null),styles:o,contentRef:r,iframeProps:i}){const l=Xw(),a=o_(),c=(0,u.useRef)(),d=(0,p.useMergeRefs)([r,a,c]);return e?(0,s.createElement)(VS,{__unstableContentRef:c,style:{height:t,display:"flex"}},(0,s.createElement)(x_,{...i,ref:l,contentRef:d,style:{...i?.style},name:"editor-canvas"},(0,s.createElement)(O_,{styles:o}),n)):(0,s.createElement)(VS,{__unstableContentRef:c,style:{height:t,display:"flex"}},(0,s.createElement)(O_,{styles:o,scope:".editor-styles-wrapper"}),(0,s.createElement)(w_,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"}},n))}var US=function({children:e,height:t,styles:n}){return(0,s.createElement)(HS,{height:t,styles:n},e)};const GS=()=>(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(ui.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"})),$S=({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)(GS,null))),jS=({TextColor:e,BackgroundColor:t})=>({onToggle:n,isOpen:o})=>(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(ui.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,S.__)("Open Colors Selector"),onClick:n,onKeyDown:e=>{o||e.keyCode!==xs.DOWN||(e.preventDefault(),n())},icon:(0,s.createElement)(t,null,(0,s.createElement)(e,null,(0,s.createElement)($S,null)))}));var WS=({children:e,...t})=>(y()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(ui.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:jS(t),renderContent:()=>e})),KS=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));const ZS=(0,u.createContext)({}),qS=()=>(0,u.useContext)(ZS);function YS({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 XS=(0,u.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...o},r)=>{const{insertedBlock:i,setInsertedBlock:l}=qS(),a=(0,p.useInstanceId)(XS),c=(0,d.useSelect)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:o}=e(hr);return!!t(n)||"zoom-out"===o()}),[n]),m=Sf({clientId:n,context:"list-view"}),h=Sf({clientId:i?.clientId,context:"list-view"});if((0,u.useEffect)((()=>{h?.length&&(0,Zn.speak)((0,S.sprintf)(
// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)
(0,S.__)("%s block inserted"),h),"assertive")}),[h]),c)return null;const f=`list-view-appender__${a}`,g=(0,S.sprintf)(/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */
(0,S.__)("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)(gw,{ref:r,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...o,toggleProps:{"aria-describedby":f},onSelectOrClose:e=>{e?.clientId&&l(e)}}),(0,s.createElement)(YS,{id:f},g))})),QS=yk(ui.__experimentalTreeGridRow),JS=(0,u.forwardRef)((({isSelected:e,position:t,level:n,rowCount:o,children:r,className:i,path:l,...a},c)=>{const u=Ek({isSelected:e,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:l}),d=(0,p.useMergeRefs)([c,u]);return(0,s.createElement)(QS,{ref:d,className:oi()("block-editor-list-view-leaf",i),level:n,positionInSet:t,setSize:o,isExpanded:void 0,...a},r)}));var eC=JS,tC=(0,s.createElement)(W.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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"})),nC=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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 oC({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)(kl,{icon:(0,S.isRTL)()?Os:Ds}))}function rC(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}var iC=(0,u.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:o,onMouseDown:r,onToggleExpanded:i,tabIndex:l,onFocus:a,onDragStart:p,onDragEnd:m,draggable:h,isExpanded:f,ariaLabel:g,ariaDescribedBy:b,updateFocusAndSelection:v},k){const _=Em(t),y=Sf({clientId:t,context:"list-view"}),{isLocked:w}=Wm(t),{canInsertBlockType:E,getSelectedBlockClientIds:C,getPreviousBlockClientId:x,getBlockRootClientId:B,getBlockOrder:I,getBlocksByClientId:T,canRemoveBlocks:P}=(0,d.useSelect)(hr),{duplicateBlocks:M,multiSelect:R,removeBlocks:A}=(0,d.useDispatch)(hr),N=(0,Qk.__unstableUseShortcutEventMatch)(),L="sticky"===_?.positionType,O=function({clientId:e,isExpanded:t}){const{block:n}=(0,d.useSelect)((t=>({block:t(hr).getBlock(e)})),[e]);return(0,u.useMemo)((()=>function(e,t){const n=rC(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=rC(n);if(e&&t.push(e),t.length>=3)return t}return t}(e)}(n,t)),[n,t])}({clientId:t,isExpanded:f}),{rootClientId:D}=qS(),z=_?.positionLabel?(0,S.sprintf)(
// translators: 1: Position of selected block, e.g. "Sticky" or "Fixed".
(0,S.__)("Position: %1$s"),_.positionLabel):"";function F(){const e=C(),n=e.includes(t),o=n?e[0]:t,r=B(o);return{blocksToUpdate:n?e:[t],firstBlockClientId:o,firstBlockRootClientId:r,selectedBlockClientIds:e}}return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.Button,{className:oi()("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:o,onKeyDown:async function(e){if(e.keyCode===xs.ENTER||e.keyCode===xs.SPACE)n(e);else if(e.keyCode===xs.BACKSPACE||e.keyCode===xs.DELETE||N("core/block-editor/remove",e)){var t;const{blocksToUpdate:e,firstBlockClientId:n,firstBlockRootClientId:o,selectedBlockClientIds:r}=F();if(!P(e,o))return;let i=null!==(t=x(n))&&void 0!==t?t:o;A(e,!1);const l=r.length>0&&0===C().length;i||(i=I()[0]),v(i,l)}else if(N("core/block-editor/duplicate",e)){if(e.defaultPrevented)return;e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=F(),o=T(t).every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&E(e.name,n)));if(o){const e=await M(t,!1);e?.length&&v(e[0],!1)}}else if(N("core/block-editor/select-all",e)){if(e.defaultPrevented)return;e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=F(),o=I(t);if(!o.length)return;if(As()(n,o)&&t&&t!==D)return void v(t,!0);R(o[0],o[o.length-1],null)}},onMouseDown:r,ref:k,tabIndex:l,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),p?.(e)},onDragEnd:m,draggable:h,href:`#block-${t}`,"aria-label":g,"aria-describedby":b,"aria-expanded":f},(0,s.createElement)(oC,{onClick:i}),(0,s.createElement)(hh,{icon:_?.icon,showColors:!0,context:"list-view"}),(0,s.createElement)(ui.__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)(ui.__experimentalTruncate,{ellipsizeMode:"auto"},y)),_?.anchor&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper"},(0,s.createElement)(ui.__experimentalTruncate,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto"},_.anchor)),z&&L&&(0,s.createElement)(ui.Tooltip,{text:z},(0,s.createElement)(kl,{icon:tC})),O.length?(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0},O.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:O.length-t}})))):null,w&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(kl,{icon:nC})))))}));const lC=(0,u.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:o,position:r,siblingBlockCount:i,level:l,isExpanded:a,selectedClientIds:c,...u},p)=>{const{clientId:m}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:f}=(0,d.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(hr);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:g,insertedBlock:b,setInsertedBlock:v}=qS(),k=h&&f===m,_=oi()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=c.includes(m)?c:[m];return(0,s.createElement)(s.Fragment,null,g&&(0,s.createElement)(g,{block:n,insertedBlock:b,setInsertedBlock:v}),(0,s.createElement)(mE,{clientIds:y},(({draggable:c,onDragStart:d,onDragEnd:m})=>(0,s.createElement)(iC,{ref:p,className:_,block:n,onClick:e,onToggleExpanded:t,isSelected:o,position:r,siblingBlockCount:i,level:l,draggable:c,onDragStart:d,onDragEnd:m,isExpanded:a,...u}))))}));var sC=lC;function aC(e,t){const n=()=>{const n=t.current?.querySelector(`[role=row][data-block="${e}"]`);return n?Es.focus.focusable.find(n)[0]:null};let o=n();o?o.focus():window.requestAnimationFrame((()=>{o=n(),o&&o.focus()}))}var cC=(0,u.memo)((function e({block:{clientId:t},isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:i,position:l,level:a,rowCount:m,siblingBlockCount:h,showBlockMovers:f,path:g,isExpanded:b,selectedClientIds:v,isSyncedBranch:k}){const _=(0,u.useRef)(null),y=(0,u.useRef)(null),w=(0,u.useRef)(null),[E,C]=(0,u.useState)(!1),[x,B]=(0,u.useState)(),{isLocked:I,canEdit:T,canMove:P}=Wm(t),M=o&&v[0]===t,R=o&&v[v.length-1]===t,{toggleBlockHighlight:A}=(0,d.useDispatch)(hr),N=Em(t),L=N?.name||N?.title||(0,S.__)("Untitled"),{block:O,blockName:D,blockEditingMode:z}=(0,d.useSelect)((e=>{const{getBlock:n,getBlockName:o,getBlockEditingMode:r}=e(hr);return{block:n(t),blockName:o(t),blockEditingMode:r(t)}}),[t]),F=(0,d.useSelect)((e=>e(hr).getSettings().allowRightClickOverrides),[]),V=(0,c.hasBlockSupport)(D,"__experimentalToolbar",!0)&&"default"===z,H=`list-view-block-select-button__${(0,p.useInstanceId)(e)}`,U=((e,t,n)=>(0,S.sprintf)(/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
(0,S.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(l,h,a),G=I?(0,S.sprintf)(
// translators: %s: The title of the block. This string indicates a link to select the locked block.
(0,S.__)("%s (locked)"),L):L,$=(0,S.sprintf)(
// translators: %s: The title of the block.
(0,S.__)("Options for %s"),L),{expand:j,collapse:W,BlockSettingsMenu:K,listViewInstanceId:Z,expandedState:q,setInsertedBlock:Y,treeGridElementRef:X}=qS(),Q=f&&h>0,J=oi()("block-editor-list-view-block__mover-cell",{"is-visible":E||o}),ee=oi()("block-editor-list-view-block__menu-cell",{"is-visible":E||M}),te=(0,u.useCallback)((()=>{C(!0),A(t,!0)}),[t,C,A]),ne=(0,u.useCallback)((()=>{C(!1),A(t,!1)}),[t,C,A]),oe=(0,u.useCallback)((e=>{i(e,t),e.preventDefault()}),[t,i]),re=(0,u.useCallback)(((e,t)=>{t&&i(void 0,e,null,null),aC(e,X)}),[i,X]),ie=(0,u.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===b?W(t):!1===b&&j(t)}),[t,j,W,b]),le=(0,u.useCallback)((e=>{V&&F&&(w.current?.click(),B(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[F,w,V]),se=(0,u.useCallback)((e=>{F&&2===e.button&&e.preventDefault()}),[F]),ae=(0,u.useMemo)((()=>{const{ownerDocument:e}=y?.current||{};if(x&&e)return{ownerDocument:e,getBoundingClientRect(){return x}}}),[x]),ce=(0,u.useCallback)((()=>{B(void 0)}),[B]);let ue;Q?ue=2:V||(ue=3);const de=oi()({"is-selected":o,"is-first-selected":M,"is-last-selected":R,"is-branch-selected":r,"is-synced-branch":k,"is-dragging":n,"has-single-cell":!V,"is-synced":N?.isSynced,"is-draggable":P}),pe=v.includes(t)?v:[t];!function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const o=1===t.length;(0,u.useLayoutEffect)((()=>{if(!e||!o||!n.current)return;const t=(0,Es.getScrollContainer)(n.current),{ownerDocument:r}=n.current;if(t===r.body||t===r.documentElement||!t)return;const i=n.current.getBoundingClientRect(),l=t.getBoundingClientRect();(i.top<l.top||i.bottom>l.bottom)&&n.current.scrollIntoView()}),[e,o,n])}({isSelected:o,rowItemRef:y,selectedClientIds:v});const me=o&&1===v.length;return(0,s.createElement)(eC,{className:de,onKeyDown:e=>{e.keyCode===xs.ESCAPE&&!e.defaultPrevented&&v.length>0&&(e.stopPropagation(),e.preventDefault(),i(e,void 0))},onMouseEnter:te,onMouseLeave:ne,onFocus:te,onBlur:ne,level:a,position:l,rowCount:m,path:g,id:`list-view-${Z}-block-${t}`,"data-block":t,"data-expanded":T?b:void 0,ref:y},(0,s.createElement)(ui.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:ue,ref:_,"aria-selected":!!o},(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(sC,{block:O,onClick:oe,onContextMenu:le,onMouseDown:se,onToggleExpanded:ie,isSelected:o,position:l,siblingBlockCount:h,level:a,ref:e,tabIndex:me?0:t,onFocus:n,isExpanded:T?b:void 0,selectedClientIds:v,ariaLabel:G,ariaDescribedBy:H,updateFocusAndSelection:re}),(0,s.createElement)(YS,{id:H},U)))),Q&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.__experimentalTreeGridCell,{className:J,withoutGridItem:!0},(0,s.createElement)(ui.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,s.createElement)(_E,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))),(0,s.createElement)(ui.__experimentalTreeGridItem,null,(({ref:e,tabIndex:n,onFocus:o})=>(0,s.createElement)(yE,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:o}))))),V&&K&&(0,s.createElement)(ui.__experimentalTreeGridCell,{className:ee,"aria-selected":!!o,ref:w},(({ref:e,tabIndex:t,onFocus:n})=>(0,s.createElement)(K,{clientIds:pe,block:O,icon:Lf,label:$,popoverProps:{anchor:ae},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:ce,onFocus:n},disableOpenOnArrowDown:!0,expand:j,expandedState:q,setInsertedBlock:Y,__experimentalSelectBlock:re}))))}));function uC(e,t,n,o){var r;const i=n?.includes(e.clientId);return i?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(dC(t,n,o),0):1}const dC=(e,t,n)=>(o,r)=>{var i;const l=t?.includes(r.clientId);return l?o:(null!==(i=e[r.clientId])&&void 0!==i?i:n)&&r.innerBlocks.length>0?o+uC(r,e,t,n):o+1},pC=()=>{};var mC=(0,u.memo)((function e(t){const{blocks:n,selectBlock:o=pC,showBlockMovers:r,selectedClientIds:i,level:l=1,path:a="",isBranchDragged:c=!1,isBranchSelected:u=!1,listPosition:p=0,fixedListWindow:m,isExpanded:h,parentId:f,shouldShowInnerBlocks:g=!0,isSyncedBranch:b=!1,showAppender:v=!0}=t,k=Em(f),_=b||!!k?.isSynced,y=(0,d.useSelect)((e=>!f||e(hr).canEditBlock(f)),[f]),{expandedState:w,draggedClientIds:E}=qS();if(!y)return null;const S=v&&1===l,C=n.filter(Boolean),x=C.length,B=S?x+1:x;let I=p;return(0,s.createElement)(s.Fragment,null,C.map(((t,n)=>{var p;const{clientId:f,innerBlocks:b}=t;n>0&&(I+=uC(C[n-1],w,E,h));const{itemInView:v}=m,k=v(I),y=n+1,S=a.length>0?`${a}_${y}`:`${y}`,T=!!b?.length,P=T&&g?null!==(p=w[f])&&void 0!==p?p:h:void 0,M=!!E?.includes(f),R=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(f,i),A=u||R&&T,N=M||k||c||R&&f===i[0];return(0,s.createElement)(d.AsyncModeProvider,{key:f,value:!R},N&&(0,s.createElement)(cC,{block:t,selectBlock:o,isSelected:R,isBranchSelected:A,isDragged:M||c,level:l,position:y,rowCount:B,siblingBlockCount:x,showBlockMovers:r,path:S,isExpanded:P,listPosition:I,selectedClientIds:i,isSyncedBranch:_}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),T&&P&&(0,s.createElement)(e,{parentId:f,blocks:b,selectBlock:o,showBlockMovers:r,level:l+1,path:S,listPosition:I+1,fixedListWindow:m,isBranchSelected:A,isBranchDragged:M||c,selectedClientIds:i,isExpanded:h,isSyncedBranch:_}))})),S&&(0,s.createElement)(ui.__experimentalTreeGridRow,{level:l,setSize:B,positionInSet:B,isExpanded:!0},(0,s.createElement)(ui.__experimentalTreeGridCell,null,(e=>(0,s.createElement)(XS,{clientId:f,nestingLevel:l,blockCount:x,...e})))))}));function hC({listViewRef:e,blockDropTarget:t}){const{rootClientId:n,clientId:o,dropPosition:r}=t||{},[i,l]=(0,u.useMemo)((()=>e.current?[n?e.current.querySelector(`[data-block="${n}"]`):void 0,o?e.current.querySelector(`[data-block="${o}"]`):void 0]:[]),[n,o]),a=l||i,c=(0,S.isRTL)(),d=(0,u.useCallback)((e=>{if(!i)return 0;const t=i.querySelector(".block-editor-block-icon").getBoundingClientRect();return c?e.right-t.left:t.right-e.left}),[i,c]),p=(0,u.useCallback)(((e,t)=>{if(!a)return 0;let n=a.offsetWidth;const o=(0,Es.getScrollContainer)(a,"horizontal"),r=a.ownerDocument,i=o===r.body||o===r.documentElement;if(o&&!i){const r=o.getBoundingClientRect(),i=(0,S.isRTL)()?r.right-e.right:e.left-r.left,l=o.clientWidth;if(l<n+i&&(n=l-i),!c&&e.left+t<r.left)return n-=r.left-e.left,n;if(c&&e.right-t>r.right)return n-=e.right-r.right,n}return n-t}),[c,a]),m=(0,u.useMemo)((()=>{if(!a)return{};const e=a.getBoundingClientRect(),t=d(e);return{width:p(e,t)}}),[d,p,a]),h=(0,u.useMemo)((()=>{if(a&&("top"===r||"bottom"===r||"inside"===r))return{contextElement:a,getBoundingClientRect(){const e=a.getBoundingClientRect(),t=d(e);let n=c?e.left:e.left+t,o=0,i=0;const l=(0,Es.getScrollContainer)(a,"horizontal"),s=a.ownerDocument,u=l===s.body||l===s.documentElement;if(l&&!u){const e=l.getBoundingClientRect(),t=c?l.offsetWidth-l.clientWidth:0;n<e.left+t&&(n=e.left+t)}"top"===r?(o=e.top,i=e.top):(o=e.bottom,i=e.bottom);const m=p(e,t),h=i-o;return new window.DOMRect(n,o,m,h)}}}),[a,r,d,p,c]);return a?(0,s.createElement)(ui.Popover,{animate:!1,anchor:h,focusOnMount:!1,className:"block-editor-list-view-drop-indicator",variant:"unstyled"},(0,s.createElement)("div",{style:m,className:"block-editor-list-view-drop-indicator__line"})):null}const fC=28;function gC(e,t){const n=e[t+1];return n&&n.isDraggedBlock?gC(e,t+1):n}const bC=["top","bottom"];function vC(e,t,n=!1){let o,r,i,l,s;for(let n=0;n<e.length;n++){const a=e[n];if(a.isDraggedBlock)continue;const c=a.element.getBoundingClientRect(),[u,d]=Dw(t,c,bC),p=zw(t,c);if(void 0===i||u<i||p){i=u;const t=e.indexOf(a),n=e[t-1];if("top"===d&&n&&n.rootClientId===a.rootClientId&&!n.isDraggedBlock?(r=n,o="bottom",l=n.element.getBoundingClientRect(),s=t-1):(r=a,o=d,l=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*fC:t.left+n*fC;return(o?e.x<r-fC:e.x>r+fC)&&e.y<t.bottom}(t,l,a.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*fC:t.left+n*fC;return o?e.x>r:e.x<r}(t,l,a.length,n)){const i=gC(e,s),c=r.nestingLevel,u=i?i.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,o=!1){const r=o?t.right-n*fC:t.left+n*fC,i=o?r-e.x:e.x-r,l=Math.round(i/fC);return Math.abs(l)}(t,l,a.length,n),p=Math.max(Math.min(d,c-u),0);if(a[p]){let t=r.blockIndex;if(a[p].nestingLevel===i?.nestingLevel)t=i?.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 kC=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,_C=(0,u.forwardRef)((function e({id:t,blocks:n,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:i=!1,showAppender:l=!1,blockSettingsMenu:a=kS,rootClientId:m,description:h,onSelect:f,additionalBlockContent:g},b){n&&y()("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const v=(0,p.useInstanceId)(e),{clientIdsTree:k,draggedClientIds:_,selectedClientIds:w}=function({blocks:e,rootClientId:t}){return(0,d.useSelect)((n=>{const{getDraggedBlockClientIds:o,getSelectedBlockClientIds:r,getEnabledClientIdsTree:i}=pr(n(hr));return{selectedClientIds:r(),draggedClientIds:o(),clientIdsTree:null!=e?e:i(t)}}),[e,t])}({blocks:n,rootClientId:m}),{getBlock:E}=(0,d.useSelect)(hr),{visibleBlockCount:C,shouldShowInnerBlocks:x}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:o}=e(hr),r=_?.length>0?n(_).length+1:0;return{visibleBlockCount:t()-r,shouldShowInnerBlocks:"zoom-out"!==o()}}),[_]),{updateBlockSelection:B}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,d.useDispatch)(hr),{getBlockName:o,getBlockParents:r,getBlockSelectionStart:i,getSelectedBlockClientIds:l,hasMultiSelection:s,hasSelectedBlock:a}=(0,d.useSelect)(hr),{getBlockType:p}=(0,d.useSelect)(c.store),m=(0,u.useCallback)((async(c,u,d,m)=>{if(!c?.shiftKey&&c?.keyCode!==xs.ESCAPE)return void n(u,m);c.preventDefault();const h="keydown"===c.type&&c.keyCode===xs.ESCAPE,f="keydown"===c.type&&(c.keyCode===xs.UP||c.keyCode===xs.DOWN||c.keyCode===xs.HOME||c.keyCode===xs.END);if(!f&&!a()&&!s())return void n(u,null);const g=l(),b=[...r(u),u];if((h||f&&!g.some((e=>b.includes(e))))&&await e(),!h){let e=i(),n=u;f&&(a()||s()||(e=u),d&&(n=d));const o=r(e),l=r(n),{start:c,end:p}=function(e,t,n,o){const r=[...n,e],i=[...o,t],l=Math.min(r.length,i.length)-1;return{start:r[l],end:i[l]}}(e,n,o,l);await t(c,p,null)}const v=l();if((c.keyCode===xs.HOME||c.keyCode===xs.END)&&v.length>1)return;const k=g.filter((e=>!v.includes(e)));let _;if(1===k.length){const e=p(o(k[0]))?.title;e&&(_=(0,S.sprintf)(/* translators: %s: block name */
(0,S.__)("%s deselected."),e))}else k.length>1&&(_=(0,S.sprintf)(/* translators: %s: number of deselected blocks */
(0,S.__)("%s blocks deselected."),k.length));_&&(0,Zn.speak)(_,"assertive")}),[e,o,p,r,i,l,s,a,t,n]);return{updateBlockSelection:m}}(),[I,T]=(0,u.useReducer)(kC,{}),{ref:P,target:M}=function({dropZoneElement:e}){const{getBlockRootClientId:t,getBlockIndex:n,getBlockCount:o,getDraggedBlockClientIds:r,canInsertBlocks:i}=(0,d.useSelect)(hr),[l,s]=(0,u.useState)(),{rootClientId:a,blockIndex:c}=l||{},m=Ow(a,c),h=(0,S.isRTL)(),f=r(),g=(0,p.useThrottle)((0,u.useCallback)(((e,r)=>{const l={x:e.clientX,y:e.clientY},a=!!f?.length,c=vC(Array.from(r.querySelectorAll("[data-block]")).map((e=>{const r=e.dataset.block,l="true"===e.dataset.expanded,s=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=t(r);return{clientId:r,isExpanded:l,rootClientId:u,blockIndex:n(r),element:e,nestingLevel:c||void 0,isDraggedBlock:!!a&&s,innerBlockCount:o(r),canInsertDraggedBlocksAsSibling:!a||i(f,u),canInsertDraggedBlocksAsChild:!a||i(f,r)}})),l,h);c&&s(c)}),[i,f,o,n,t,h]),200);return{ref:(0,p.__experimentalUseDropZone)({dropZoneElement:e,onDrop(e){l&&m(e)},onDragLeave(){g.cancel(),s(null)},onDragOver(e){g(e,e.currentTarget)},onDragEnd(){g.cancel(),s(null)}}),target:l}}({dropZoneElement:o}),R=(0,u.useRef)(),A=(0,p.useMergeRefs)([R,P,b]),[N,L]=(0,u.useState)(null),{setSelectedTreeId:O}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,o]=(0,u.useState)(null),{selectedBlockParentClientIds:r}=(0,d.useSelect)((t=>{const{getBlockParents:n}=t(hr);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:w[0],setExpandedState:T}),D=(0,u.useCallback)(((e,t,n)=>{B(e,t,null,n),O(t),f&&f(E(t))}),[O,B,f,E]);(0,u.useEffect)((()=>{w?.length&&aC(w[0],R)}),[]);const z=(0,u.useCallback)((e=>{e&&T({type:"expand",clientIds:[e]})}),[T]),F=(0,u.useCallback)((e=>{e&&T({type:"collapse",clientIds:[e]})}),[T]),V=(0,u.useCallback)((e=>{z(e?.dataset?.block)}),[z]),H=(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]),G=(0,u.useMemo)((()=>({draggedClientIds:_,expandedState:I,expand:z,collapse:F,BlockSettingsMenu:a,listViewInstanceId:v,AdditionalBlockContent:g,insertedBlock:N,setInsertedBlock:L,treeGridElementRef:R,rootClientId:m})),[_,I,z,F,a,v,g,N,L,m]),[$]=(0,p.__experimentalUseFixedWindowList)(R,36,C,{expandedState:I,useWindowing:!0,windowOverscan:40});if(!k.length&&!l)return null;const j=h&&`block-editor-list-view-description-${v}`;return(0,s.createElement)(d.AsyncModeProvider,{value:!0},(0,s.createElement)(hC,{listViewRef:R,blockDropTarget:M}),h&&(0,s.createElement)(ui.VisuallyHidden,{id:j},h),(0,s.createElement)(ui.__experimentalTreeGrid,{id:t,className:"block-editor-list-view-tree","aria-label":(0,S.__)("Block navigation structure"),ref:A,onCollapseRow:H,onExpandRow:V,onFocusRow:U,applicationAriaLabel:(0,S.__)("Block navigation structure"),"aria-describedby":j},(0,s.createElement)(ZS.Provider,{value:G},(0,s.createElement)(mC,{blocks:k,parentId:m,selectBlock:D,showBlockMovers:r,fixedListWindow:$,selectedClientIds:w,isExpanded:i,shouldShowInnerBlocks:x,showAppender:l}))))}));var yC=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(_C,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function wC({isEnabled:e,onToggle:t,isOpen:n,innerRef:o,...r}){return(0,s.createElement)(ui.Button,{...r,ref:o,icon:KS,"aria-expanded":n,"aria-haspopup":"true",onClick:e?t:void 0
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,S.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}var EC=(0,u.forwardRef)((function({isDisabled:e,...t},n){y()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const o=(0,d.useSelect)((e=>!!e(hr).getBlockCount()),[])&&!e;return(0,s.createElement)(ui.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:e,onToggle:r})=>(0,s.createElement)(wC,{...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,S.__)("List view")),(0,s.createElement)(yC,null))})}));function SC({genericPreviewBlock:e,style:t,className:n,activeStyle:o}){const r=(0,c.getBlockType)(e.name)?.example,i=DE(n,o,t),l=(0,u.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:r})),[e,i]);return(0,s.createElement)(G_,{item:l})}const CC=()=>{};var xC=function({clientId:e,onSwitch:t=CC,onHoverClassName:n=CC}){const{onSelect:o,stylesToRender:r,activeStyle:i,genericPreviewBlock:l,className:a}=FE({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),f=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)(ui.Button,{__next40pxDefaultSize:!0,className:oi()("block-editor-block-styles__item",{"is-active":i.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>f(e),onFocus:()=>f(e),onMouseLeave:()=>f(null),onBlur:()=>f(null),onClick:()=>(e=>{o(e),n(null),d(null),h.cancel()})(e),"aria-current":i.name===e.name},(0,s.createElement)(ui.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!m&&(0,s.createElement)(ui.Popover,{placement:"left-start",offset:34,focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>f(null)},(0,s.createElement)(SC,{activeStyle:i,className:a,genericPreviewBlock:l,style:c}))))};const BC={0:(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})),2:(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})),5:(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 IC({level:e}){return BC[e]?(0,s.createElement)(ui.Icon,{icon:BC[e]}):null}const TC=[1,2,3,4,5,6],PC={className:"block-library-heading-level-dropdown"};function MC({options:e=TC,value:t,onChange:n}){return(0,s.createElement)(ui.ToolbarDropdownMenu,{popoverProps:PC,icon:(0,s.createElement)(IC,{level:t}),label:(0,S.__)("Change level"),controls:e.map((e=>{{const o=e===t;return{icon:(0,s.createElement)(IC,{level:e,isPressed:o}),title:0===e?(0,S.__)("Paragraph"):(0,S.sprintf)(
// translators: %s: heading level e.g: "1", "2", "3"
(0,S.__)("Heading %d"),e),isActive:o,onClick(){n(e)},role:"menuitemradio"}}}))})}var RC=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),AC=function({icon:e=RC,label:t=(0,S.__)("Choose variation"),instructions:n=(0,S.__)("Select a variation to start with."),variations:o,onSelect:r,allowSkip:i}){const l=oi()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,s.createElement)(ui.Placeholder,{icon:e,label:t,instructions:n,className:l},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,S.__)("Block variations")},o.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(ui.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))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(ui.Button,{variant:"link",onClick:()=>r()},(0,S.__)("Skip"))))},NC=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 LC="carousel",OC="grid",DC=({onBlockPatternSelect:e})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(ui.Button,{variant:"primary",onClick:e},(0,S.__)("Choose"))),zC=({handlePrevious:e,handleNext:t,activeSlide:n,totalSlides:o})=>(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(ui.Button,{icon:Kk,label:(0,S.__)("Previous pattern"),onClick:e,disabled:0===n,__experimentalIsFocusable:!0}),(0,s.createElement)(ui.Button,{icon:Wk,label:(0,S.__)("Next pattern"),onClick:t,disabled:n===o-1,__experimentalIsFocusable:!0}));var FC=({viewMode:e,setViewMode:t,handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i,onBlockPatternSelect:l})=>{const a=e===LC,c=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(ui.Button,{icon:Hl,label:(0,S.__)("Carousel view"),onClick:()=>t(LC),isPressed:a}),(0,s.createElement)(ui.Button,{icon:NC,label:(0,S.__)("Grid view"),onClick:()=>t(OC),isPressed:e===OC}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},a&&(0,s.createElement)(zC,{handlePrevious:n,handleNext:o,activeSlide:r,totalSlides:i}),c,a&&(0,s.createElement)(DC,{onBlockPatternSelect:l}))};const{CompositeV2:VC,CompositeItemV2:HC,useCompositeStoreV2:UC}=pr(ui.privateApis),GC=({viewMode:e,activeSlide:t,patterns:n,onBlockPatternSelect:o,showTitles:r})=>{const i=UC(),l="block-editor-block-pattern-setup__container";if(e===LC){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:l},(0,s.createElement)("div",{className:"carousel-container"},n.map(((n,o)=>(0,s.createElement)(jC,{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)(VC,{store:i,role:"listbox",className:l,"aria-label":(0,S.__)("Patterns list")},n.map((e=>(0,s.createElement)($C,{key:e.name,pattern:e,onSelect:o,showTitles:r})))))};function $C({pattern:e,onSelect:t,showTitles:n}){const o="block-editor-block-pattern-setup-list",{blocks:r,description:i,viewportWidth:l=700}=e,a=(0,p.useInstanceId)($C,`${o}__item-description`);return(0,s.createElement)("div",{className:`${o}__list-item`},(0,s.createElement)(HC,{render:(0,s.createElement)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${o}__item`}),id:`${o}__pattern__${e.name}`,role:"option",onClick:()=>t(r)},(0,s.createElement)(H_,{blocks:r,viewportWidth:l}),n&&(0,s.createElement)("div",{className:`${o}__item-title`},e.title),!!i&&(0,s.createElement)(ui.VisuallyHidden,{id:a},i)))}function jC({active:e,className:t,pattern:n,minHeight:o}){const{blocks:r,title:i,description:l}=n,a=(0,p.useInstanceId)(jC,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":l?a:void 0},(0,s.createElement)(H_,{blocks:r,minHeight:o}),!!l&&(0,s.createElement)(ui.VisuallyHidden,{id:a},l))}var WC=({clientId:e,blockName:t,filterPatternsFn:n,onBlockPatternSelect:o,initialViewMode:r=LC,showTitles:i=!1})=>{const[l,a]=(0,u.useState)(r),[p,m]=(0,u.useState)(0),{replaceBlock:h}=(0,d.useDispatch)(hr),f=function(e,t,n){return(0,d.useSelect)((o=>{const{getBlockRootClientId:r,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:l}=o(hr),s=r(e);return n?l(s).filter(n):i(t,s)}),[e,t,n])}(e,t,n);if(!f?.length)return null;const g=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-${l}`},(0,s.createElement)(GC,{viewMode:l,activeSlide:p,patterns:f,onBlockPatternSelect:g,showTitles:i}),(0,s.createElement)(FC,{viewMode:l,setViewMode:a,activeSlide:p,totalSlides:f.length,handleNext:()=>{m((e=>Math.min(e+1,f.length-1)))},handlePrevious:()=>{m((e=>Math.max(e-1,0)))},onBlockPatternSelect:()=>{g(f[p].blocks)}})))};function KC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,s.createElement)("fieldset",{className:e},(0,s.createElement)(ui.VisuallyHidden,{as:"legend"},(0,S.__)("Transform to variation")),o.map((e=>(0,s.createElement)(ui.Button,{key:e.name,icon:(0,s.createElement)(hh,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,S.sprintf)(/* translators: %s: Name of the block variation */
(0,S.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0}))))}function ZC({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)(ui.DropdownMenu,{className:e,label:(0,S.__)("Transform to variation"),text:(0,S.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:fE,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${e}__container`},(0,s.createElement)(ui.MenuGroup,null,(0,s.createElement)(ui.MenuItemsChoice,{choices:r,value:n,onSelect:t})))))}function qC({className:e,onSelectVariation:t,selectedValue:n,variations:o}){return(0,s.createElement)("div",{className:e},(0,s.createElement)(ui.__experimentalToggleGroupControl,{label:(0,S.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},o.map((e=>(0,s.createElement)(ui.__experimentalToggleGroupControlOptionIcon,{key:e.name,icon:e.icon,value:e.name,label:n===e.name?e.title:(0,S.sprintf)(/* translators: %s: Name of the block variation */
(0,S.__)("Transform to %s"),e.title)})))))}var YC=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,d.useDispatch)(hr),{activeBlockVariation:n,variations:o}=(0,d.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockVariations:o}=t(c.store),{getBlockName:r,getBlockAttributes:i}=t(hr),l=e&&r(e);return{activeBlockVariation:n(l,i(e)),variations:l&&o(l,"transform")}}),[e]),r=n?.name,i=(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 l=o.length>5,a=i?l?KC:qC:ZC;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})},XC=(0,p.createHigherOrderComponent)((e=>t=>{const[n,o]=Cr("color.palette","color.custom"),{colors:r=n,disableCustomColors:i=!o}=t,l=r&&r.length>0||!i;return(0,s.createElement)(e,{...t,colors:r,disableCustomColors:i,hasColorsToChoose:l})}),"withColorContext"),QC=XC(ui.ColorPalette);function JC({onChange:e,value:t,...n}){return(0,s.createElement)(yu,{...n,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var ex=window.wp.date;const tx=new Date(2022,0,25);function nx({format:e,defaultFormat:t,onChange:n}){return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(ui.VisuallyHidden,{as:"legend"},(0,S.__)("Date format")),(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Default format"),help:`${(0,S.__)("Example:")}  ${(0,ex.dateI18n)(t,tx)}`,checked:!e,onChange:e=>n(e?null:t)}),e&&(0,s.createElement)(ox,{format:e,onChange:n}))}function ox({format:e,onChange:t}){var n;const o=[...new Set([/* translators: See https://www.php.net/manual/datetime.format.php */
"Y-m-d",/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("n/j/Y","short date format"),/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("n/j/Y g:i A","short date format with time"),/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("M j, Y","medium date format"),/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("M j, Y g:i A","medium date format with time"),/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("F j, Y","long date format"),/* translators: See https://www.php.net/manual/datetime.format.php */
(0,S._x)("M j","short date format without the year")])],r=o.map(((e,t)=>({key:`suggested-${t}`,name:(0,ex.dateI18n)(e,tx),format:e}))),i={key:"custom",name:(0,S.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,S.__)("Enter your own date format")},[l,a]=(0,u.useState)((()=>!!e&&!o.includes(e)));return(0,s.createElement)(ui.__experimentalVStack,null,(0,s.createElement)(ui.CustomSelectControl,{__nextUnconstrainedWidth:!0,label:(0,S.__)("Choose a format"),options:[...r,i],value:l?i:null!==(n=r.find((t=>t.format===e)))&&void 0!==n?n:i,onChange:({selectedItem:e})=>{e===i?a(!0):(a(!1),t(e.format))}}),l&&(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Custom format"),hideLabelFromVision:!0,help:(0,u.createInterpolateElement)((0,S.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(ui.ExternalLink,{href:(0,S.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:e=>t(e)}))}const rx=({setting:e,children:t,panelId:n,...o})=>(0,s.createElement)(ui.__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),ix=({colorValue:e,label:t})=>(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(ui.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,s.createElement)(ui.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t)),lx=e=>({onToggle:t,isOpen:n})=>{const{colorValue:o,label:r}=e,i={onClick:t,className:oi()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,s.createElement)(ui.Button,{...i},(0,s.createElement)(ix,{colorValue:o,label:r}))};function sx({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradients:r,settings:i,__experimentalIsRenderedInSidebar:l,...a}){let c;return l&&(c={placement:"left-start",offset:36,shift:!0}),(0,s.createElement)(s.Fragment,null,i.map(((i,u)=>{var d;const p={clearable:!1,colorValue:i.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:o,gradientValue:i.gradientValue,gradients:r,label:i.label,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:l,...i},m={colorValue:null!==(d=i.gradientValue)&&void 0!==d?d:i.colorValue,label:i.label};return i&&(0,s.createElement)(rx,{key:u,setting:i,...a},(0,s.createElement)(ui.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:lx(m),renderContent:()=>(0,s.createElement)(ui.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(yu,{...p})))}))})))}const ax=["colors","disableCustomColors","gradients","disableCustomGradients"],cx=({className:e,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,children:i,settings:l,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:m})=>{const h=(0,p.useInstanceId)(cx),{batch:f}=(0,d.useRegistry)();return t&&0!==t.length||n&&0!==n.length||!o||!r||!l?.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)(ui.__experimentalToolsPanel,{className:oi()("block-editor-panel-color-gradient-settings",e),label:c?a:void 0,resetAll:()=>{f((()=>{l.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:o})=>{e?n():t&&o()}))}))},panelId:h,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,s.createElement)(sx,{settings:l,panelId:h,colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:u,enableAlpha:m}),!!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.__experimentalSpacer,{marginY:4})," ",i)):null},ux=e=>{const t=Mc();return(0,s.createElement)(cx,{...t,...e})};var dx=e=>ax.every((t=>e.hasOwnProperty(t)))?(0,s.createElement)(cx,{...e}):(0,s.createElement)(ux,{...e});const px=(0,u.createContext)({}),mx=()=>(0,u.useContext)(px);function hx({id:e,url:t,naturalWidth:n,naturalHeight:o,onFinishEditing:r,onSaveImage:i,children:l}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[o,r]=(0,u.useState)(),[i,l]=(0,u.useState)(),[s,a]=(0,u.useState)({x:0,y:0}),[c,d]=(0,u.useState)(100),[p,h]=(0,u.useState)(0),f=t/n,[g,b]=(0,u.useState)(f),v=(0,u.useCallback)((()=>{const t=(p+90)%360;let n=f;if(p%180==90&&(n=1/f),0===t)return r(),h(t),b(f),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 i=0,l=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||(i=o.width),270!==t&&180!==t||(l=o.height);const s=o.getContext("2d");s.translate(i,l),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 i=(0,m.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(o.crossOrigin=i)}),[p,f,e]);return(0,u.useMemo)((()=>({editedUrl:o,setEditedUrl:r,crop:i,setCrop:l,position:s,setPosition:a,zoom:c,setZoom:d,rotation:p,setRotation:h,rotateClockwise:v,aspect:g,setAspect:b,defaultAspect:f})),[o,i,s,c,p,v,g,f])}({url:t,naturalWidth:n,naturalHeight:o}),c=function({crop:e,rotation:t,url:n,id:o,onSaveImage:r,onFinishEditing:i}){const{createErrorNotice:l}=(0,d.useDispatch)(Ss.store),[s,a]=(0,u.useState)(!1),c=(0,u.useCallback)((()=>{a(!1),i()}),[i]),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}}),hf()({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=>{l((0,S.sprintf)(/* translators: 1. Error message */
(0,S.__)("Could not edit image. %s"),(0,Es.__unstableStripHTML)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{a(!1),i()}))}),[e,t,o,n,r,l,i]);return(0,u.useMemo)((()=>({isInProgress:s,apply:p,cancel:c})),[s,p,c])}({id:e,url:t,onSaveImage:i,onFinishEditing:r,...a}),p=(0,u.useMemo)((()=>({...a,...c})),[a,c]);return(0,s.createElement)(px.Provider,{value:p},l)}var fx=function(e,t){return fx=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])},fx(e,t)},gx=function(){return gx=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},gx.apply(this,arguments)};Object.create,Object.create;var bx=n(7970),vx=n.n(bx);function kx(e,t,n,o,r){void 0===r&&(r=0);var i=Bx(t.width,t.height,r),l=i.width,s=i.height;return{x:yx(e.x,l,n.width,o),y:yx(e.y,s,n.height,o)}}function yx(e,t,n,o){var r=t*o/2-n/2;return Ix(e,-r,r)}function wx(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Ex(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Sx(e,t){return Math.min(e,Math.max(0,t))}function Cx(e,t){return t}function xx(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Bx(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 Ix(e,t,n){return Math.min(Math.max(e,t),n)}function Tx(){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 Px=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.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=document,n.currentWindow=window,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped)},n.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,i){var l=Bx(t.width,t.height,n),s=Ix(o.width/l.width*(100/e.width),r,i);return{crop:{x:s*l.width/2-o.width/2-l.width*s*(e.x/100),y:s*l.height/2-o.height/2-l.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 i=function(e,t,n,o,r,i){void 0===n&&(n=0);var l=Bx(t.naturalWidth,t.naturalHeight,n),s=Ix(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,i),a=o.height>o.width?o.height/e.height:o.width/e.width;return{crop:{x:((l.width-e.width)/2-e.x)*a,y:((l.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=i.crop,r=i.zoom,n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(r)}},n.computeSizes=function(){var e,t,o,r,i,l,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=gx(gx({},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,i){void 0===i&&(i=0);var l=Bx(e,t,i),s=l.width,a=l.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===(i=n.state.cropSize)||void 0===i?void 0:i.height)===m.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.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.onDragStart=function(e){var t,o,r=e.x,i=e.y;n.dragStartPosition={x:r,y:i},n.dragStartCrop=gx({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},l=n.props.restrictPosition?kx(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(l)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(!n.props.onWheelRequest||n.props.onWheelRequest(e)){e.preventDefault();var o=t.getMousePoint(e),r=vx()(e).pixelY,i=n.props.zoom-r*n.props.zoomSpeed/200;n.setNewZoom(i,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,i=r.crop,l=r.zoom;return{x:(t+i.x)/l,y:(o+i.y)/l}},n.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition,i=void 0===r||r;if(n.state.cropSize&&n.props.onZoomChange){var l=n.getPointOnContainer(t),s=n.getPointOnMedia(l),a=Ix(e,n.props.minZoom,n.props.maxZoom),c={x:s.x*a-l.x,y:s.y*a-l.y};if(i){var u=n.props.restrictPosition?kx(c,n.mediaSize,n.state.cropSize,a,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,o,r,i,l){void 0===i&&(i=0),void 0===l&&(l=!0);var s=l?Sx:Cx,a=Bx(t.width,t.height,i),c=Bx(t.naturalWidth,t.naturalHeight,i),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:gx(gx({},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?kx(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?kx(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}fx(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef)},t.prototype.componentWillUnmount=function(){var e;this.currentWindow.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,o,r,i,l,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===(i=e.crop)||void 0===i?void 0:i.x)===(null===(l=this.props.crop)||void 0===l?void 0:l.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=wx(n,o),this.lastPinchRotation=Ex(n,o),this.onDragStart(xx(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),i=xx(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=wx(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var l=Ex(o,r),s=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=l}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,i=t.transform,l=t.crop,s=l.x,c=l.y,u=t.rotation,d=t.zoom,p=t.cropShape,m=t.showGrid,h=t.style,f=h.containerStyle,g=h.cropAreaStyle,b=h.mediaStyle,v=t.classes,k=v.containerClassName,_=v.cropAreaClassName,y=v.mediaClassName,w=t.objectFit;return a().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:Tx("reactEasyCrop_Container",k)},n?a().createElement("img",gx({alt:"",className:Tx("reactEasyCrop_Image","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical","auto-cover"===w&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),y)},r,{src:n,ref:this.imageRef,style:gx(gx({},b),{transform:i||"translate("+s+"px, "+c+"px) rotate("+u+"deg) scale("+d+")"}),onLoad:this.onMediaLoad})):o&&a().createElement("video",gx({autoPlay:!0,loop:!0,muted:!0,className:Tx("reactEasyCrop_Video","contain"===w&&"reactEasyCrop_Contain","horizontal-cover"===w&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===w&&"reactEasyCrop_Cover_Vertical","auto-cover"===w&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),y)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:gx(gx({},b),{transform:i||"translate("+s+"px, "+c+"px) rotate("+u+"deg) scale("+d+")"}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map((function(e){return a().createElement("source",gx({key:e.src},e))}))),this.state.cropSize&&a().createElement("div",{style:gx(gx({},g),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Tx("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),Mx=Px;const Rx=100,Ax=300,Nx={placement:"bottom-start"};function Lx({url:e,width:t,height:n,clientWidth:o,naturalHeight:r,naturalWidth:i,borderProps:l}){const{isInProgress:a,editedUrl:c,position:u,zoom:d,aspect:p,setPosition:m,setCrop:h,setZoom:f,rotation:g}=mx();let b=n||o*r/i;return g%180==90&&(b=o*i/r),(0,s.createElement)("div",{className:oi()("wp-block-image__crop-area",l?.className,{"is-applying":a}),style:{...l?.style,width:t||o,height:b}},(0,s.createElement)(Mx,{image:c||e,disabled:a,minZoom:Rx/100,maxZoom:Ax/100,crop:u,zoom:d/100,aspect:p,onCropChange:e=>{m(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{f(100*e)}}),a&&(0,s.createElement)(ui.Spinner,null))}var Ox=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 Dx(){const{isInProgress:e,zoom:t,setZoom:n}=mx();return(0,s.createElement)(ui.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Nx,renderToggle:({isOpen:t,onToggle:n})=>(0,s.createElement)(ui.ToolbarButton,{icon:Ox,label:(0,S.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,s.createElement)(ui.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Zoom"),min:Rx,max:Ax,value:Math.round(t),onChange:n})})}var zx=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 Fx({aspectRatios:e,isDisabled:t,label:n,onClick:o,value:r}){return(0,s.createElement)(ui.MenuGroup,{label:n},e.map((({title:e,aspect:n})=>(0,s.createElement)(ui.MenuItem,{key:n,disabled:t,onClick:()=>{o(n)},role:"menuitemradio",isSelected:n===r,icon:n===r?dp:void 0},e))))}function Vx({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:o,defaultAspect:r}=mx();return(0,s.createElement)(ui.DropdownMenu,{icon:zx,label:(0,S.__)("Aspect Ratio"),popoverProps:Nx,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fx,{isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,S.__)("Original"),aspect:r},{title:(0,S.__)("Square"),aspect:1}]}),(0,s.createElement)(Fx,{label:(0,S.__)("Landscape"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,S.__)("16:9"),aspect:16/9},{title:(0,S.__)("4:3"),aspect:4/3},{title:(0,S.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Fx,{label:(0,S.__)("Portrait"),isDisabled:t,onClick:t=>{o(t),e()},value:n,aspectRatios:[{title:(0,S.__)("9:16"),aspect:9/16},{title:(0,S.__)("3:4"),aspect:3/4},{title:(0,S.__)("2:3"),aspect:2/3}]}))))}var Hx=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 Ux(){const{isInProgress:e,rotateClockwise:t}=mx();return(0,s.createElement)(ui.ToolbarButton,{icon:Hx,label:(0,S.__)("Rotate"),onClick:t,disabled:e})}function Gx(){const{isInProgress:e,apply:t,cancel:n}=mx();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.ToolbarButton,{onClick:t,disabled:e},(0,S.__)("Apply")),(0,s.createElement)(ui.ToolbarButton,{onClick:n},(0,S.__)("Cancel")))}function $x({id:e,url:t,width:n,height:o,clientWidth:r,naturalHeight:i,naturalWidth:l,onSaveImage:a,onFinishEditing:c,borderProps:u}){return(0,s.createElement)(hx,{id:e,url:t,naturalWidth:l,naturalHeight:i,onSaveImage:a,onFinishEditing:c},(0,s.createElement)(Lx,{borderProps:u,url:t,width:n,height:o,clientWidth:r,naturalHeight:i,naturalWidth:l}),(0,s.createElement)(bi,null,(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(Dx,null),(0,s.createElement)(ui.ToolbarItem,null,(e=>(0,s.createElement)(Vx,{toggleProps:e}))),(0,s.createElement)(Ux,null)),(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(Gx,null))))}const jx=[25,50,75,100],Wx=()=>{};function Kx({imageSizeHelp:e,imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:i,width:l,height:a,onChange:c,onChangeImage:d=Wx}){const{currentHeight:p,currentWidth:m,updateDimension:h,updateDimensions:f}=function(e,t,n,o,r){var i,l;const[s,a]=(0,u.useState)(null!==(i=null!=t?t:o)&&void 0!==i?i:""),[c,d]=(0,u.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");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,l,n,t,c);return(0,s.createElement)(s.Fragment,null,o&&o.length>0&&(0,s.createElement)(ui.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Resolution"),value:i,options:o,onChange:d,help:e,size:"__unstable-large"}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)(ui.__experimentalHStack,{align:"baseline",spacing:"3"},(0,s.createElement)(ui.__experimentalNumberControl,{className:"block-editor-image-size-control__width",label:(0,S.__)("Width"),value:m,min:1,onChange:e=>h("width",e),size:"__unstable-large"}),(0,s.createElement)(ui.__experimentalNumberControl,{className:"block-editor-image-size-control__height",label:(0,S.__)("Height"),value:p,min:1,onChange:e=>h("height",e),size:"__unstable-large"})),(0,s.createElement)(ui.__experimentalHStack,null,(0,s.createElement)(ui.ButtonGroup,{"aria-label":(0,S.__)("Image size presets")},jx.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),i=m===o&&p===r;return(0,s.createElement)(ui.Button,{key:e,size:"small",variant:i?"primary":void 0,isPressed:i,onClick:()=>f(r,o)},e,"%")}))),(0,s.createElement)(ui.Button,{size:"small",onClick:()=>f()},(0,S.__)("Reset")))))}function Zx({url:e,urlLabel:t,className:n}){const o=oi()(n,"block-editor-url-popover__link-viewer-url");return e?(0,s.createElement)(ui.ExternalLink,{className:o,href:e},t||(0,Cs.filterURLForDisplay)((0,Cs.safeDecodeURI)(e))):(0,s.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:qx}=pr(ui.privateApis);function Yx({additionalControls:e,children:t,renderSettings:n,placement:o,focusOnMount:r="firstElement",position:i,...l}){let a;void 0!==i&&y()("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==o?a=o:void 0!==i&&(a=qx(i)),a=a||"bottom";const[c,d]=(0,u.useState)(!1),p=!!n&&c;return(0,s.createElement)(ui.Popover,{className:"block-editor-url-popover",focusOnMount:r,placement:a,shift:!0,...l},(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)(ui.Button,{className:"block-editor-url-popover__settings-toggle",icon:fE,label:(0,S.__)("Link settings"),onClick:()=>{d(!c)},"aria-expanded":c})),p&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!p&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}Yx.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:o,...r}){return(0,s.createElement)("form",{className:oi()("block-editor-url-popover__link-editor",t),...r},(0,s.createElement)(Gs,{__nextHasNoMarginBottom:!0,value:o,onChange:n,autocompleteRef:e}),(0,s.createElement)(ui.Button,{icon:Ls,label:(0,S.__)("Apply"),type:"submit"}))},Yx.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:o,urlLabel:r,...i}){return(0,s.createElement)("div",{className:oi()("block-editor-url-popover__link-viewer",e),...i},(0,s.createElement)(Zx,{url:o,urlLabel:r,className:t}),n&&(0,s.createElement)(ui.Button,{icon:ya,label:(0,S.__)("Edit"),onClick:n}))};var Xx=Yx;const Qx=()=>{},Jx=({src:e,onChange:t,onSubmit:n,onClose:o,popoverAnchor:r})=>(0,s.createElement)(Xx,{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,S.__)("URL"),placeholder:(0,S.__)("Paste or type URL"),onChange:t,value:e}),(0,s.createElement)(ui.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Ls,label:(0,S.__)("Apply"),type:"submit"}))),eB=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:o,openURLInput:r,closeURLInput:i})=>{const[l,a]=(0,u.useState)(null);return(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container",ref:a},(0,s.createElement)(ui.Button,{className:"block-editor-media-placeholder__button",onClick:r,isPressed:e,variant:"tertiary"},(0,S.__)("Insert from URL")),e&&(0,s.createElement)(Jx,{src:t,onChange:n,onSubmit:o,onClose:i,popoverAnchor:l}))};var tB=(0,ui.withFilters)("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:o,labels:r={},mediaPreview:i,notices:l,isAppender:a,accept:p,addToGallery:m,multiple:h=!1,handleUpload:f=!0,disableDropZone:g,disableMediaButtons:b,onError:v,onSelect:k,onCancel:_,onSelectURL:w,onToggleFeaturedImage:E,onDoubleClick:C,onFilesPreUpload:x=Qx,onHTMLDrop:B,children:I,mediaLibraryButton:T,placeholder:P,style:M}){B&&y()("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const R=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return t().mediaUpload}),[]),[A,N]=(0,u.useState)(""),[L,O]=(0,u.useState)(!1);(0,u.useEffect)((()=>{var t;N(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const D=e=>{N(e.target.value)},z=()=>{O(!0)},F=()=>{O(!1)},V=e=>{e.preventDefault(),A&&w&&(w(A),F())},H=n=>{if(!f)return k(n);let o;if(x(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 U(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 G=e=>{H(e.target.files)},$=null!=P?P:e=>{let{instructions:c,title:u}=r;if(R||w||(c=(0,S.__)("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,i=o&&"image"===n,l=o&&"video"===n;void 0===c&&R&&(c=(0,S.__)("Upload a media file or pick one from your media library."),r?c=(0,S.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?c=(0,S.__)("Upload an image file, pick one from your media library, or add one with a URL."):l&&(c=(0,S.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,S.__)("Media"),r?u=(0,S.__)("Audio"):i?u=(0,S.__)("Image"):l&&(u=(0,S.__)("Video")))}const d=oi()("block-editor-media-placeholder",n,{"is-appender":a});return(0,s.createElement)(ui.Placeholder,{icon:o,label:u,instructions:c,className:d,notices:l,onDoubleClick:C,preview:i,style:M},e,I)},j=()=>g?null:(0,s.createElement)(ui.DropZone,{onFilesDrop:H,onHTMLDrop:U}),W=()=>_&&(0,s.createElement)(ui.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,S.__)("Cancel"),variant:"link",onClick:_},(0,S.__)("Cancel")),K=()=>w&&(0,s.createElement)(eB,{isURLInputVisible:L,src:A,onChangeSrc:D,onSubmitSrc:V,openURLInput:z,closeURLInput:F}),Z=()=>E&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(ui.Button,{className:"block-editor-media-placeholder__button",onClick:E,variant:"tertiary"},(0,S.__)("Use featured image")));return b?(0,s.createElement)(Ms,null,j()):(0,s.createElement)(Ms,{fallback:$(K())},(()=>{const n=null!=T?T:({open:e})=>(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:()=>{e()}},(0,S.__)("Media Library")),o=(0,s.createElement)(Ps,{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)(ui.FormFileUpload,{onChange:G,accept:p,multiple:!!h,render:({openFileDialog:e})=>{const t=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.Button,{variant:"primary",className:oi()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e},(0,S.__)("Upload")),o,K(),Z(),W());return $(t)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(ui.FormFileUpload,{variant:"primary",className:oi()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:G,accept:p,multiple:!!h},(0,S.__)("Upload")),o,K(),Z(),W());return $(e)}return $(o)})())})),nB=({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)(dx,{settings:n,gradients:[],disableCustomGradients:!0,...t})};const oB={placement:"bottom-start"};var rB=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,s.createElement)(ui.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(ui.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)(ui.ToolbarItem,null,(n=>(0,s.createElement)(ui.DropdownMenu,{icon:fE
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,S.__)("More"),toggleProps:{...n,className:oi()(n.className,{"is-pressed":t}),describedBy:(0,S.__)("Displays more block tools")},controls:re(e.map((([{props:e}])=>e)),"title"),popoverProps:oB})))})));function iB({editableContentElement:e,activeFormats:t}){const n=t[t.length-1],o=n?.type,r=(0,d.useSelect)((e=>e(Z.store).getFormatType(o)),[o]),i=(0,Z.useAnchor)({editableContentElement:e,settings:r});return(0,s.createElement)(lB,{popoverAnchor:i})}function lB({popoverAnchor:e}){return(0,s.createElement)(ui.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)(MS,{className:"block-editor-rich-text__inline-format-toolbar-group"
/* translators: accessibility text for the inline format toolbar */,"aria-label":(0,S.__)("Format tools")},(0,s.createElement)(ui.ToolbarGroup,null,(0,s.createElement)(rB,null))))}var sB=({inline:e,editableContentElement:t,value:n})=>{const o=(0,d.useSelect)((e=>e(hr).getSettings().hasInlineToolbar),[]);if(e)return(0,s.createElement)(lB,{popoverAnchor:t});if(o){const e=(0,Z.getActiveFormats)(n);return(0,Z.isCollapsed)(n)&&!e.length?null:(0,s.createElement)(iB,{editableContentElement:t,activeFormats:e})}return(0,s.createElement)(bi,{group:"inline"},(0,s.createElement)(rB,null))};function aB(){const{didAutomaticChange:e,getSettings:t}=(0,d.useSelect)(hr);return(0,p.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;if(n.defaultPrevented)return;if(o!==xs.DELETE&&o!==xs.BACKSPACE&&o!==xs.ESCAPE)return;const{__experimentalUndo:r}=t();r&&e()&&(n.preventDefault(),r())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function cB(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function uB(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function dB({allowedFormats:e,disableFormats:t}){return t?dB.EMPTY_ARRAY:e}function pB({value:e,pastedBlocks:t=[],onReplace:n,onSplit:o}){if(!n||!o)return;const{start:r=0,end:i=0}=e,l={...e,start:r,end:i},s=[],[a,c]=(0,Z.split)(l),u=t.length>0;let d=-1;const p=(0,Z.isEmpty)(a)&&!(0,Z.isEmpty)(c);u&&(0,Z.isEmpty)(a)||(s.push(o((0,Z.toHTMLString)({value:a}),!p)),d+=1),u&&(s.push(...t),d+=t.length),u&&(0,Z.isEmpty)(c)||s.push(o((0,Z.toHTMLString)({value:c}),p)),n(s,u?d:1,u?-1:0)}function mB(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:i,formatTypes:l,tagName:s,onReplace:a,onSplit:u,__unstableEmbedURLOnPaste:d,pastePlainText:p}=t.current;if(!n)return;const{plainText:m,html:h,files:f}=b_(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,Z.insert)(i,m));if("true"===e.clipboardData.getData("rich-text")){const e=(0,Z.create)({html:h});return cB(e,i.activeFormats),void r((0,Z.insert)(i,e))}if(p)return void r((0,Z.insert)(i,(0,Z.create)({text:m})));if(f?.length){window.console.log("Received items:\n\n",f);const e=(0,c.getBlockTransforms)("from"),t=f.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,Z.isEmpty)(i)?a(t):pB({value:i,pastedBlocks:t,onReplace:a,onSplit:u}))}let g=a&&u?"AUTO":"INLINE";const b=m.trim();d&&(0,Z.isEmpty)(i)&&(0,Cs.isURL)(b)&&/^https?:/.test(b)&&(g="BLOCKS");const v=(0,c.pasteHandler)({HTML:h,plainText:m,mode:g,tagName:s});if("string"==typeof v){const e=l.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:h,plainText:m})),e)),i);if(e!==i)r(e);else{const e=(0,Z.create)({html:v});cB(e,i.activeFormats),r((0,Z.insert)(i,e))}}else v.length>0&&(a&&(0,Z.isEmpty)(i)?a(v,v.length-1,-1):pB({value:i,pastedBlocks:v,onReplace:a,onSplit:u}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}dB.EMPTY_ARRAY=[];const hB=["`",'"',"'","“”","‘’"];function fB(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(hr),o=(0,u.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(r){const{inputType:i,data:l}=r,{value:s,onChange:a}=o.current;if("insertText"!==i)return;if((0,Z.isCollapsed)(s))return;const c=(0,m.applyFilters)("blockEditor.wrapSelectionSettings",hB).find((([e,t])=>e===l||t===l));if(!c)return;const[u,d=u]=c,p=s.start,h=s.end+u.length;let f=(0,Z.insert)(s,u,p,p);f=(0,Z.insert)(f,d,h,h),t(),a(f),n();const g={};for(const e in r)g[e]=r[e];g.data=d;const{ownerDocument:b}=e,{defaultView:v}=b,k=new v.InputEvent("input",g);window.queueMicrotask((()=>{r.target.dispatchEvent(k)})),r.preventDefault()}return e.addEventListener("beforeinput",r),()=>{e.removeEventListener("beforeinput",r)}}),[])}function gB(e){let t=e.length;for(;t--;){const n=Yn(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(qn,""),[e[t].clientId,n,0,0];const o=gB(e[t].innerBlocks);if(o)return o}return[]}function bB(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(hr),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 i=e(),{start:l,text:s}=i;if(" "!==s.slice(l-1,l))return;const a=s.slice(0,l).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,Z.toHTMLString)({value:(0,Z.insert)(i,qn,0,l)}),m=d.transform(p);return r(...gB([m])),t([m]),n(),!0}function i(e){const{inputType:i,type:l}=e,{getValue:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==i&&"compositionend"!==l)return;if(c&&r())return;const d=s(),p=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),function(e){const{start:t,text:n}=e;return t<18||"tales of gutenberg"!==n.slice(t-18,t).toLowerCase()?e:(0,Z.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(function(e){if(!(0,Z.isCollapsed)(e))return e;const{text:t,start:n}=e,o=t.slice(n-2,n);return"  "===o?(0,Z.insert)(e," ",n-2,n):"  "===o?(0,Z.insert)(e," ",n-2,n):e}(d)));p!==d&&(t(),a({...p,activeFormats:d.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function vB(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:i}=t.current;if(n===xs.DELETE||n===xs.BACKSPACE){const{start:t,end:l,text:s}=o,a=n===xs.BACKSPACE,c=o.activeFormats&&!!o.activeFormats.length;if(!(0,Z.isCollapsed)(o)||c||a&&0!==t||!a&&l!==s.length)return;r?r(!a):i&&(0,Z.isEmpty)(o)&&a&&i(!a),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function kB(e){const t=(0,d.useRegistry)(),{__unstableMarkAutomaticChange:n}=(0,d.useDispatch)(hr),o=(0,u.useRef)(e);return o.current=e,(0,p.useRefEffect)((e=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==xs.ENTER)return;const{removeEditorOnlyFormats:r,value:i,onReplace:l,onSplit:s,onChange:a,disableLineBreaks:u,onSplitAtEnd:d,onSplitAtDoubleLineEnd:p}=o.current;e.preventDefault();const m={...i};m.formats=r(i);const h=l&&s;if(l){const e=(0,c.getBlockTransforms)("from").filter((({type:e})=>"enter"===e)),t=(0,c.findTransform)(e,(e=>e.regExp.test(m.text)));t&&(l([t.transform({content:m.text})]),n())}const{text:f,start:g,end:b}=m;e.shiftKey?u||a((0,Z.insert)(m,"\n")):h?pB({value:m,onReplace:l,onSplit:s}):d&&g===b&&b===f.length?d():p&&g===b&&b===f.length&&"\n\n"===f.slice(-2)?t.batch((()=>{m.start=m.end-2,a((0,Z.remove)(m)),p()})):u||a((0,Z.insert)(m,"\n"))}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function _B(e){return e(Z.store).getFormatTypes()}const yB=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function wB(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function EB(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 SB(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 CB(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 xB(){const{__unstableMarkLastChangeAsPersistent:e}=(0,d.useDispatch)(hr);return(0,p.useRefEffect)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function BB(){const{isMultiSelecting:e}=(0,d.useSelect)(hr);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 IB={},TB=Symbol("usesContext");function PB({onChange:e,onFocus:t,value:n,forwardedRef:o,settings:r}){const{name:i,edit:l,[TB]:a}=r,c=(0,u.useContext)(Pf),d=(0,u.useMemo)((()=>a?Object.fromEntries(Object.entries(c).filter((([e])=>a.includes(e)))):IB),[a,c]);if(!l)return null;const p=(0,Z.getActiveFormat)(n,i),m=void 0!==p,h=(0,Z.getActiveObject)(n),f=void 0!==h&&h.type===i;return(0,s.createElement)(l,{key:i,isActive:m,activeAttributes:m&&p.attributes||{},isObjectActive:f,activeObjectAttributes:f&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:o,context:d})}function MB({formatTypes:e,...t}){return e.map((e=>(0,s.createElement)(PB,{settings:e,...t,key:e.name})))}function RB({value:e,tagName:t,multiline:n,format:o,...r}){if(FB.isEmpty(e)){const t=uB(n);e=t?(0,s.createElement)(t,null):null}else Array.isArray(e)?(y()("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}var AB=(0,u.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:o="",onChange:r,multiline:i,...l},a){y()("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}=k(),{selectionChange:u}=(0,d.useDispatch)(hr),p=uB(i),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)(OB,{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)},...l}))))}));const NB=(0,u.createContext)(),LB=(0,u.createContext)();function OB({children:e,tagName:t="div",value:n="",onChange:o,isSelected:r,multiline:i,inlineToolbar:l,wrapperClassName:a,autocompleters:c,onReplace:m,placeholder:h,allowedFormats:f,withoutInteractiveFormatting:g,onRemove:b,onMerge:v,onSplit:_,__unstableOnSplitAtEnd:y,__unstableOnSplitAtDoubleLineEnd:w,identifier:E,preserveWhiteSpace:S,__unstablePastePlainText:C,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:B,disableLineBreaks:I,__unstableAllowPrefixTransformations:T,...P},M){P=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:o,textAlign:r,selectionColor:i,tagsToEliminate:l,disableEditingMenu:s,fontSize:a,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:p,maxWidth:m,setRef:h,disableSuggestions:f,disableAutocorrection:g,...b}=e;return b}(P);const R=(0,u.useRef)(),{clientId:A,isSelected:N}=k(),{selectionStart:L,selectionEnd:O,isSelected:D}=(0,d.useSelect)((e=>{if(!N)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(hr),o=t(),i=n();let l;return void 0===r?l=o.clientId===A&&i.clientId===A&&o.attributeKey===E:r&&(l=o.clientId===A),{selectionStart:l?o.offset:void 0,selectionEnd:l?i.offset:void 0,isSelected:l}}),[A,E,r,N]),{getSelectionStart:z,getSelectionEnd:F,getBlockRootClientId:V}=(0,d.useSelect)(hr),{selectionChange:H}=(0,d.useDispatch)(hr),U=dB({allowedFormats:f,disableFormats:B}),G=!U||U.length>0,$=(0,u.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;if("number"==typeof e||o){if(void 0===t&&V(A)!==V(F().clientId))return;n.start={clientId:A,attributeKey:E,offset:e}}if("number"==typeof t||o){if(void 0===e&&V(A)!==V(z().clientId))return;n.end={clientId:A,attributeKey:E,offset:t}}H(n)}),[A,E]),{formatTypes:j,prepareHandlers:W,valueHandlers:K,changeHandlers:q,dependencies:Y}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:o}){const r=(0,d.useSelect)(_B,[]),i=(0,u.useMemo)((()=>r.filter((({name:e,interactive:t,tagName:r})=>!(o&&!o.includes(e)||n&&(t||yB.has(r)))))),[r,o,n]),l=(0,d.useSelect)((n=>i.reduce(((o,r)=>r.__experimentalGetPropsForEditableTreePreparation?{...o,...wB(r.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),r.name)}:o),{})),[i,e,t]),s=(0,d.useDispatch)(),a=[],c=[],p=[],m=[];for(const e in l)m.push(l[e]);return i.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const o=n.__experimentalCreatePrepareEditableTree(EB(l,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=EB(l,n.name);p.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof r?r:{},...o},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:i,prepareHandlers:a,valueHandlers:c,changeHandlers:p,dependencies:m}}({clientId:A,identifier:E,withoutInteractiveFormatting:g,allowedFormats:U});function X(e){return j.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Z.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:Q,getValue:J,onChange:ee,ref:te}=(0,Z.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){o(e),Object.values(q).forEach((e=>{e(t,n)}))},selectionStart:L,selectionEnd:O,onSelectionChange:$,placeholder:h,__unstableIsSelected:D,__unstableDisableFormats:B,preserveWhiteSpace:S,__unstableDependencies:[...Y,t],__unstableAfterParse:function(e){return K.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:X,__unstableAddInvisibleFormats:function(e){return W.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ne=function(e){return(0,ui.__unstableUseAutocompleteProps)({...e,completers:vf(e)})}({onReplace:m,completers:c,record:Q,onChange:ee});!function({html:e,value:t}){const n=(0,u.useRef)(),o=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,d.useDispatch)(hr);(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:Q});const oe=(0,u.useRef)(new Set),re=(0,u.useRef)(new Set);function ie(){R.current?.focus()}const le=t;return(0,s.createElement)(s.Fragment,null,D&&(0,s.createElement)(NB.Provider,{value:oe},(0,s.createElement)(LB.Provider,{value:re},(0,s.createElement)(ui.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},e&&e({value:Q,onChange:ee,onFocus:ie}),(0,s.createElement)(MB,{value:Q,onChange:ee,onFocus:ie,formatTypes:j,forwardedRef:R})))),D&&G&&(0,s.createElement)(sB,{inline:l,editableContentElement:R.current,value:Q}),(0,s.createElement)(le,{role:"textbox","aria-multiline":!I,"aria-label":h,...P,...ne,ref:(0,p.useMergeRefs)([te,M,ne.ref,P.ref,fB({value:Q,onChange:ee}),bB({getValue:J,onChange:ee,__unstableAllowPrefixTransformations:T,formatTypes:j,onReplace:m,selectionChange:H}),xB(),(0,p.useRefEffect)((e=>{function t(e){(xs.isKeyboardEvent.primary(e,"z")||xs.isKeyboardEvent.primary(e,"y")||xs.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[]),SB(oe),CB(re),aB(),mB({isSelected:D,disableFormats:B,onChange:ee,value:Q,formatTypes:j,tagName:t,onReplace:m,onSplit:_,__unstableEmbedURLOnPaste:x,pastePlainText:C}),vB({value:Q,onMerge:v,onRemove:b}),kB({removeEditorOnlyFormats:X,value:Q,onReplace:m,onSplit:_,onChange:ee,disableLineBreaks:I,onSplitAtEnd:y,onSplitAtDoubleLineEnd:w}),BB(),R]),contentEditable:!0,suppressContentEditableWarning:!0,className:oi()("block-editor-rich-text__editable",P.className,"rich-text"),tabIndex:0===P.tabIndex?null:P.tabIndex,"data-wp-block-attribute-key":E}))}const DB=(zB=(0,u.forwardRef)(OB),(0,u.forwardRef)(((e,t)=>{let n=e.value,o=e.onChange;Array.isArray(n)&&(y()("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,Z.__unstableCreateElement)(document,t).childNodes)));const r=e.multiline?AB:zB,i=(0,p.useInstanceId)(r);return(0,s.createElement)(r,{...e,identifier:e.identifier||i,value:n,onChange:o,ref:t})})));var zB;DB.Content=RB,DB.isEmpty=e=>!e||0===e.length;var FB=DB;const VB=(0,u.forwardRef)(((e,t)=>(0,s.createElement)(FB,{ref:t,...e,__unstableDisableFormats:!0})));VB.Content=({value:e="",tagName:t="div",...n})=>(0,s.createElement)(t,{...n},e);var HB=VB,UB=(0,u.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,s.createElement)(HB,{ref:n,...t});const{className:o,onChange:r,...i}=t;return(0,s.createElement)(Wf.Z,{ref:n,className:oi()("block-editor-plain-text",o),onChange:e=>r(e.target.value),...i})}));function GB({property:e,viewport:t,desc:n}){const o=(0,p.useInstanceId)(GB),r=n||(0,S.sprintf)(/* translators: 1: property name. 2: viewport name. */
(0,S._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)(ui.VisuallyHidden,{as:"span",id:`rbc-desc-${o}`},r))}var $B=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:i,renderResponsiveControls:l,isResponsive:a=!1,defaultLabel:c={id:"all",
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
label:(0,S.__)("All")},viewports:d=[{id:"small",label:(0,S.__)("Small screens")},{id:"medium",label:(0,S.__)("Medium screens")},{id:"large",label:(0,S.__)("Large screens")}]}=e;if(!t||!n||!i)return null;const p=o||(0,S.sprintf)(/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
(0,S.__)("Use the same %s on all screensizes."),n),m=(0,S.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=i((0,s.createElement)(GB,{property:n,viewport:c}),c);
/* translators: 'Help text for the responsive mode toggle control.' */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)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,className:"block-editor-responsive-block-control__toggle",label:p,checked:!a,onChange:r,help:m}),(0,s.createElement)("div",{className:oi()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(l?l(d):d.map((e=>(0,s.createElement)(u.Fragment,{key:e.id},i((0,s.createElement)(GB,{property:n,viewport:e}),e))))))))};function jB({character:e,type:t,onUse:n}){const o=(0,u.useContext)(NB),r=(0,u.useRef)();return r.current=n,(0,u.useEffect)((()=>{function n(n){xs.isKeyboardEvent[t](n,e)&&(r.current(),n.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}}),[e,t]),null}function WB({name:e,shortcutType:t,shortcutCharacter:n,...o}){let r,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(r=xs.displayShortcut[t](n)),(0,s.createElement)(ui.Fill,{name:i},(0,s.createElement)(ui.ToolbarButton,{...o,shortcut:r}))}function KB({inputType:e,onInput:t}){const n=(0,u.useContext)(LB),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 ZB=(0,s.createElement)(ui.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(ui.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 qB=(0,u.forwardRef)((function(e,t){const n=(0,d.useSelect)((e=>e(hr).__unstableGetEditorMode()),[]),{__unstableSetEditorMode:o}=(0,d.useDispatch)(hr);return(0,s.createElement)(ui.Dropdown,{renderToggle:({isOpen:o,onToggle:r})=>(0,s.createElement)(ui.Button,{...e,ref:t,icon:"navigation"===n?ZB:ya,"aria-expanded":o,"aria-haspopup":"true",onClick:r
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,S.__)("Tools")}),popoverProps:{placement:"bottom-start"},renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.NavigableMenu,{role:"menu","aria-label":(0,S.__)("Tools")},(0,s.createElement)(ui.MenuItemsChoice,{value:"navigation"===n?"navigation":"edit",onSelect:o,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(kl,{icon:ya}),(0,S.__)("Edit"))},{value:"navigation",label:(0,s.createElement)(s.Fragment,null,ZB,(0,S.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,S.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function YB({units:e,...t}){const[n]=Cr("spacing.units"),o=(0,ui.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vw"],units:e});return(0,s.createElement)(ui.__experimentalUnitControl,{units:o,...t})}var XB=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}));class QB 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,S.__)("Edit link"):(0,S.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(ui.Button,{icon:Vc,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)(ui.Button,{className:"block-editor-url-input__back",icon:XB,label:(0,S.__)("Close"),onClick:this.toggle}),(0,s.createElement)(Gs,{__nextHasNoMarginBottom:!0,value:e||"",onChange:t}),(0,s.createElement)(ui.Button,{icon:Ls,label:(0,S.__)("Submit"),type:"submit"}))))}}var JB=QB,eI=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 tI="none",nI="custom",oI="media",rI="attachment",iI=["noreferrer","noopener"],lI=(0,s.createElement)(ui.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(ui.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(ui.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,s.createElement)(ui.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),sI=({linkDestination:e,onChangeUrl:t,url:n,mediaType:o="image",mediaUrl:r,mediaLink:i,linkTarget:l,linkClass:a,rel:c})=>{const[d,p]=(0,u.useState)(!1),[m,h]=(0,u.useState)(null),[f,g]=(0,u.useState)(!1),[b,v]=(0,u.useState)(null),k=(0,u.useRef)(null),_=()=>{g(!1)},y=()=>{const e=[{linkDestination:oI,title:(0,S.__)("Media File"),url:"image"===o?r:void 0,icon:lI}];return"image"===o&&i&&e.push({linkDestination:rI,title:(0,S.__)("Attachment Page"),url:"image"===o?i:void 0,icon:(0,s.createElement)(ui.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(ui.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(ui.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,s.createElement)(ui.__experimentalVStack,{spacing:"3"},(0,s.createElement)(ui.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("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(" ");iI.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===iI.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===l}),(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Link rel"),value:null!=c?c:"",onChange:e=>{t({rel:e})}}),(0,s.createElement)(ui.TextControl,{__nextHasNoMarginBottom:!0,label:(0,S.__)("Link CSS Class"),value:a||"",onChange:e=>{t({linkClass:e})}})),E=null!==b?b:n,C=(y().find((t=>t.linkDestination===e))||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.ToolbarButton,{icon:Vc,className:"components-toolbar__control",label:n?(0,S.__)("Edit link"):(0,S.__)("Insert link"),"aria-expanded":d,onClick:()=>{p(!0)},ref:h,isActive:!!n}),d&&(0,s.createElement)(Xx,{anchor:m,onFocusOutside:e=>{const t=k.current;t&&t.contains(e.target)||(p(!1),v(null),_())},onClose:()=>{v(null),_(),p(!1)},renderSettings:()=>w,additionalControls:!E&&(0,s.createElement)(ui.NavigableMenu,null,y().map((e=>(0,s.createElement)(ui.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{v(null),(e=>{const n=y();let o;o=e?(n.find((t=>t.url===e))||{linkDestination:nI}).linkDestination:tI,t({linkDestination:o,href:e})})(e.url),_()}},e.title))))},(!n||f)&&(0,s.createElement)(Xx.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:E,onChangeInputValue:v,onSubmit:e=>{if(b){const e=y().find((e=>e.url===b))?.linkDestination||nI;t({href:b,linkDestination:e})}_(),v(null),e.preventDefault()},autocompleteRef:k}),n&&!f&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xx.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==oI&&e!==rI||v(""),g(!0)},urlLabel:C}),(0,s.createElement)(ui.Button,{icon:eI,label:(0,S.__)("Remove link"),onClick:()=>{t({linkDestination:tI,href:""})}}))))};function aI(){return y()("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}function cI(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)}var uI=(0,d.withSelect)((e=>({selectedBlockClientId:e(hr).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=Vu(e);return e?(0,s.createElement)(ui.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},(0,S.__)("Skip to the selected block")):null})),dI=window.wp.wordcount,pI=(0,d.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(hr);return{blocks:t()}}))((function({blocks:e}){const t=(0,dI.count)((0,c.serialize)(e),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(hh,{icon:TE,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,S.sprintf)(/* translators: %d: number of blocks */
(0,S._n)("%d Block","%d Blocks",e.length),e.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,S.sprintf)(/* translators: %d: number of words */
(0,S._n)("%d word selected.","%d words selected.",t),t))))}));function mI({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:o}=(0,d.useSelect)((t=>{var n;const o=t(hr).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,S.__)("Not set"),value:""},...o.map((({label:e,name:t})=>({label:e,value:t})))]),[o]),i=(0,u.useMemo)((()=>zE(o)?.name),[o]),l=(0,u.useCallback)((t=>{n(e,t)}),[e,n]);return t&&t!==i?n&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(ui.SelectControl,{__nextHasNoMarginBottom:!0,options:r,value:t||"",label:(0,S.__)("Default Style"),onChange:l})):null}var hI=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),fI=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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 gI={name:"settings",title:(0,S.__)("Settings"),value:"settings",icon:hI,className:"block-editor-block-inspector__tab-item"},bI={name:"styles",title:(0,S.__)("Styles"),value:"styles",icon:fI,className:"block-editor-block-inspector__tab-item"},vI={name:"list",title:(0,S.__)("List View"),value:"list-view",icon:KS,className:"block-editor-block-inspector__tab-item"};var kI=()=>{const e=(0,ui.__experimentalUseSlotFills)(hs.slotName);return Boolean(e&&e.length)?(0,s.createElement)(ui.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,S.__)("Advanced"),initialOpen:!1},(0,s.createElement)(fs.Slot,{group:"advanced"})):null};const _I=()=>{const[e,t]=(0,u.useState)(),{multiSelectedBlocks:n}=(0,d.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(hr);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)(ui.PanelBody,{className:"block-editor-block-inspector__position",title:(0,S.__)("Position"),initialOpen:null!=e&&e},(0,s.createElement)(fs.Slot,{group:"position"}))};var yI=()=>{const e=(0,ui.__experimentalUseSlotFills)(ls.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,s.createElement)(_I,null):null};const wI="isInspectorControlsTabsHintVisible";function EI(){const e=(0,d.useSelect)((e=>{var t;return null===(t=e(Ns.store).get("core",wI))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,d.useDispatch)(Ns.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,S.__)("Looking for other block settings? They've moved to the styles tab.")),(0,s.createElement)(ui.Button,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:eI,iconSize:"16",label:(0,S.__)("Dismiss hint"),onClick:()=>{const e=Es.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",wI,!1)},showTooltip:!1})):null}var SI=({showAdvancedControls:e=!1})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fs.Slot,null),(0,s.createElement)(yI,null),e&&(0,s.createElement)("div",null,(0,s.createElement)(kI,null)),(0,s.createElement)(EI,null)),CI=({blockName:e,clientId:t,hasBlockStyles:n})=>(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)("div",null,(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Styles")},(0,s.createElement)(xC,{clientId:t}),(0,c.hasBlockSupport)(e,"defaultStylePicker",!0)&&(0,s.createElement)(mI,{blockName:e}))),(0,s.createElement)(fs.Slot,{group:"color",label:(0,S.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(fs.Slot,{group:"background",label:(0,S.__)("Background")}),(0,s.createElement)(fs.Slot,{group:"filter"}),(0,s.createElement)(fs.Slot,{group:"typography",label:(0,S.__)("Typography")}),(0,s.createElement)(fs.Slot,{group:"dimensions",label:(0,S.__)("Dimensions")}),(0,s.createElement)(fs.Slot,{group:"border",label:(0,S.__)("Border")}),(0,s.createElement)(fs.Slot,{group:"styles"}));const xI=["core/navigation"];var BI=e=>!xI.includes(e);const{Tabs:II}=pr(ui.privateApis);function TI({blockName:e,clientId:t,hasBlockStyles:n,tabs:o}){const r=BI(e)?void 0:vI.name;return(0,s.createElement)("div",{className:"block-editor-block-inspector__tabs"},(0,s.createElement)(II,{initialTabId:r,key:t},(0,s.createElement)(II.TabList,null,o.map((e=>(0,s.createElement)(II.Tab,{key:e.name,tabId:e.name,render:(0,s.createElement)(ui.Button,{icon:e.icon,label:e.title,className:e.className})})))),(0,s.createElement)(II.TabPanel,{tabId:gI.name,focusable:!1},(0,s.createElement)(SI,{showAdvancedControls:!!e})),(0,s.createElement)(II.TabPanel,{tabId:bI.name,focusable:!1},(0,s.createElement)(CI,{blockName:e,clientId:t,hasBlockStyles:n})),(0,s.createElement)(II.TabPanel,{tabId:vI.name,focusable:!1},(0,s.createElement)(fs.Slot,{group:"list"}))))}const PI=[];function MI(e){const t=[],{border:n,color:o,default:r,dimensions:i,list:l,position:s,styles:a,typography:c}=ls,u=BI(e),p=(0,ui.__experimentalUseSlotFills)(l.Slot.__unstableName),m=!u&&!!p&&p.length,h=[...(0,ui.__experimentalUseSlotFills)(n.Slot.__unstableName)||[],...(0,ui.__experimentalUseSlotFills)(o.Slot.__unstableName)||[],...(0,ui.__experimentalUseSlotFills)(i.Slot.__unstableName)||[],...(0,ui.__experimentalUseSlotFills)(a.Slot.__unstableName)||[],...(0,ui.__experimentalUseSlotFills)(c.Slot.__unstableName)||[]].length,f=(0,ui.__experimentalUseSlotFills)(hs.slotName)||[],g=[...(0,ui.__experimentalUseSlotFills)(r.Slot.__unstableName)||[],...(0,ui.__experimentalUseSlotFills)(s.Slot.__unstableName)||[],...m&&h>1?f:[]];m&&t.push(vI),g.length&&t.push(gI),h&&t.push(bI);const b=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,d.useSelect)((e=>e(hr).getSettings().blockInspectorTabs),[]));return b?t:PI}const{createPrivateSlotFill:RI}=pr(ui.privateApis),{Fill:AI,Slot:NI}=RI("BlockInformation"),LI=e=>k()[h]?(0,s.createElement)(AI,{...e}):null;LI.Slot=e=>(0,s.createElement)(NI,{...e});var OI=LI;function DI({clientIds:e}){return e.length?(0,s.createElement)(ui.__experimentalVStack,{spacing:1},e.map((e=>(0,s.createElement)(zI,{key:e,clientId:e})))):null}function zI({clientId:e}){const{name:t,icon:n,isSelected:o}=(0,d.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o,isBlockSelected:r,hasSelectedInnerBlock:i}=t(hr),{getBlockType:l}=t(c.store),s=l(n(e)),a=o(e);return{name:s&&(0,c.__experimentalGetBlockLabel)(s,a,"list-view"),icon:s?.icon,isSelected:r(e)||i(e,!0)}}),[e]),{selectBlock:r}=(0,d.useDispatch)(hr);return(0,s.createElement)(ui.Button,{isPressed:o,onClick:()=>r(e)},(0,s.createElement)(ui.Flex,null,(0,s.createElement)(ui.FlexItem,null,(0,s.createElement)(hh,{icon:n})),(0,s.createElement)(ui.FlexBlock,{style:{textAlign:"left"}},(0,s.createElement)(ui.__experimentalTruncate,null,t))))}function FI({topLevelLockedBlock:e}){const t=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:n,getBlockName:o,getBlockEditingMode:r}=t(hr);return n(e).filter((e=>"core/list-item"!==o(e)&&"contentOnly"===r(e)))}),[e]),n=Em(e);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Zk,{...n,className:n.isSynced&&"is-synced"}),(0,s.createElement)(YC,{blockClientId:e}),(0,s.createElement)(OI.Slot,null),(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Content")},(0,s.createElement)(DI,{clientIds:t})))}const VI=({animate:e,wrapper:t,children:n})=>e?t(n):n,HI=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const o=e&&"leftToRight"===e.enterDirection?-50:50;return(0,s.createElement)(ui.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:t},n)},UI=({clientId:e,blockName:t})=>{const n=MI(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]),i=Em(e);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Zk,{...i,className:i.isSynced&&"is-synced"}),(0,s.createElement)(YC,{blockClientId:e}),(0,s.createElement)(OI.Slot,null),o&&(0,s.createElement)(TI,{hasBlockStyles:r,clientId:e,blockName:t,tabs:n}),!o&&(0,s.createElement)(s.Fragment,null,r&&(0,s.createElement)("div",null,(0,s.createElement)(ui.PanelBody,{title:(0,S.__)("Styles")},(0,s.createElement)(xC,{clientId:e}),(0,c.hasBlockSupport)(t,"defaultStylePicker",!0)&&(0,s.createElement)(mI,{blockName:t}))),(0,s.createElement)(fs.Slot,null),(0,s.createElement)(fs.Slot,{group:"list"}),(0,s.createElement)(fs.Slot,{group:"color",label:(0,S.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(fs.Slot,{group:"typography",label:(0,S.__)("Typography")}),(0,s.createElement)(fs.Slot,{group:"dimensions",label:(0,S.__)("Dimensions")}),(0,s.createElement)(fs.Slot,{group:"border",label:(0,S.__)("Border")}),(0,s.createElement)(fs.Slot,{group:"styles"}),(0,s.createElement)(fs.Slot,{group:"background",label:(0,S.__)("Background")}),(0,s.createElement)(yI,null),(0,s.createElement)("div",null,(0,s.createElement)(kI,null))),(0,s.createElement)(uI,{key:"back"}))};var GI=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:o,blockType:r,topLevelLockedBlock:i}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o,__unstableGetContentLockingParent:r,getTemplateLock:i}=e(hr),l=t(),s=l&&o(l),a=s&&(0,c.getBlockType)(s);return{count:n(),selectedBlockClientId:l,selectedBlockName:s,blockType:a,topLevelLockedBlock:r(l)||("contentOnly"===i(l)||"core/block"===s&&window.__experimentalPatternPartialSyncing?l:void 0)}}),[]),l=MI(r?.name),a=l?.length>1,u=function(e,t){return(0,d.useSelect)((t=>{if(e){const n=t(hr).getSettings().blockInspectorAnimation,o=n?.animationParent,{getSelectedBlockClientId:r,getBlockParentsByBlockName:i}=t(hr);return i(r(),o,!0)[0]||e.name===o?n?.[e.name]:null}return null}),[t,e])}(r,o);if(t>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(pI,null),a?(0,s.createElement)(TI,{tabs:l}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fs.Slot,null),(0,s.createElement)(fs.Slot,{group:"color",label:(0,S.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(fs.Slot,{group:"typography",label:(0,S.__)("Typography")}),(0,s.createElement)(fs.Slot,{group:"dimensions",label:(0,S.__)("Dimensions")}),(0,s.createElement)(fs.Slot,{group:"border",label:(0,S.__)("Border")}),(0,s.createElement)(fs.Slot,{group:"styles"})));const p=n===(0,c.getUnregisteredTypeHandlerName)();return r&&o&&!p?i?(0,s.createElement)(FI,{topLevelLockedBlock:i}):(0,s.createElement)(VI,{animate:u,wrapper:e=>(0,s.createElement)(HI,{blockInspectorAnimationSettings:u,selectedBlockClientId:o},e)},(0,s.createElement)(UI,{clientId:o,blockName:r.name})):e?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,S.__)("No block selected.")):null};const $I=()=>(y()("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),k_());function jI(e){return y()("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,s.createElement)("div",{...e,ref:k_()})}const WI=()=>{};var KI=(0,u.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r=!1,__experimentalInsertionIndex:i,__experimentalFilterValue:l,onSelect:a=WI,shouldFocusBlock:c=!1},u){const{destinationRootClientId:p}=(0,d.useSelect)((n=>{const{getBlockRootClientId:o}=n(hr);return{destinationRootClientId:e||o(t)||void 0}}),[t,e]);return(0,s.createElement)(dw,{onSelect:a,rootClientId:p,clientId:t,isAppender:n,showInserterHelpPanel:o,showMostUsedBlocks:r,__experimentalInsertionIndex:i,__experimentalFilterValue:l,shouldFocusBlock:c,ref:u})}));function ZI(){return y()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const qI=-1!==window.navigator.userAgent.indexOf("Trident"),YI=new Set([xs.UP,xs.DOWN,xs.LEFT,xs.RIGHT]),XI=.75;function QI(){const e=(0,d.useSelect)((e=>e(hr).hasSelectedBlock()),[]);return(0,p.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,i,l;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){i&&o.cancelAnimationFrame(i),i=o.requestAnimationFrame((()=>{c(e),i=null}))}function c({keyCode:e}){if(!m())return;const r=(0,Es.computeCaretRect)(o);if(!r)return;if(!l)return void(l=r);if(YI.has(e))return void(l=r);const i=r.top-l.top;if(0===i)return;const s=(0,Es.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?l.top/o.innerHeight:(l.top-u)/(o.innerHeight-u);if(0===c&&d<XI&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(l=r);const p=a?o.innerHeight:s.clientHeight;l.top+l.height>u+p||l.top<u?l=r:a?o.scrollBy(0,i):s.scrollTop+=i}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(l=(0,Es.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(i)}}),[e])}var JI=qI?e=>e.children:function({children:e}){return(0,s.createElement)("div",{ref:QI(),className:"block-editor__typewriter"},e)};const eT=(0,u.createContext)({});function tT({children:e,uniqueId:t,blockName:n=""}){const o=(0,u.useContext)(eT),{name:r}=k();n=n||r;const i=(0,u.useMemo)((()=>function(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}(o,n,t)),[o,n,t]);return(0,s.createElement)(eT.Provider,{value:i},e)}function nT(e,t=""){const n=(0,u.useContext)(eT),{name:o}=k();return t=t||o,Boolean(n[t]?.has(e))}var oT=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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 rT({title:e,help:t,actions:n=[],onClose:o}){return(0,s.createElement)(ui.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4},(0,s.createElement)(ui.__experimentalHStack,{alignment:"center"},(0,s.createElement)(ui.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13},e),(0,s.createElement)(ui.__experimentalSpacer,null),n.map((({label:e,icon:t,onClick:n})=>(0,s.createElement)(ui.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)(ui.Button,{className:"block-editor-inspector-popover-header__action",label:(0,S.__)("Close"),icon:oT,onClick:o})),t&&(0,s.createElement)(ui.__experimentalText,null,t))}var iT=(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)(rT,{title:(0,S.__)("Publish"),actions:[{label:(0,S.__)("Now"),onClick:()=>t?.(null)}],onClose:e}),(0,s.createElement)(ui.DateTimePicker,{startOfWeek:(0,ex.getSettings)().l10n.startOfWeek,onChange:t,...n}))})),lT=window.wp.commands,sT=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),aT=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"})),cT=(0,s.createElement)(W.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(W.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"}));const uT=()=>{const{replaceBlocks:e,multiSelect:t}=(0,d.useDispatch)(hr),{blocks:n,clientIds:o,canRemove:r,possibleBlockTransformations:i}=(0,d.useSelect)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:o,getBlocksByClientId:r,canRemoveBlocks:i}=e(hr),l=o(),s=r(l),a=t(l[0]);return{blocks:s,clientIds:l,possibleBlockTransformations:n(s,a),canRemove:i(l,a)}}),[]),l=1===n.length&&(0,c.isTemplatePart)(n[0]);const a=!!i.length&&r&&!l;if(!o||o.length<1||!a)return{isLoading:!1,commands:[]};const u=i.map((r=>{const{name:i,title:l,icon:a}=r;return{name:"core/block-editor/transform-to-"+i.replace("/","-"),
// translators: %s: block title/name.
label:(0,S.sprintf)((0,S.__)("Transform to %s"),l),icon:(0,s.createElement)(hh,{icon:a}),callback:({close:r})=>{(function(r){const i=(0,c.switchToBlockType)(n,r);var l;e(o,i),(l=i).length>1&&t(l[0].clientId,l[l.length-1].clientId)})(i),r()}}}));return{isLoading:!1,commands:u}},dT=()=>{const{clientIds:e}=(0,d.useSelect)((e=>{const{getSelectedBlockClientIds:t}=e(hr);return{clientIds:t()}}),[]),{getBlockRootClientId:t,canMoveBlocks:n,getBlockCount:o}=(0,d.useSelect)(hr),{setBlockMovingClientId:r,setNavigationMode:i,selectBlock:l}=(0,d.useDispatch)(hr);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,S.__)("Move to"),callback:()=>{i(!0),l(e[0]),r(e[0])},icon:sT}),{isLoading:!1,commands:a.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},pT=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,d.useSelect)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:o}=e(hr);return{clientIds:t(),isUngroupable:n(),isGroupable:o()}}),[]),{canInsertBlockType:o,getBlockRootClientId:r,getBlocksByClientId:i,canRemoveBlocks:l}=(0,d.useSelect)(hr),{getDefaultBlockName:s,getGroupingBlockName:a}=(0,d.useSelect)(c.store),u=i(e),{removeBlocks:p,replaceBlocks:m,duplicateBlocks:h,insertAfterBlock:f,insertBeforeBlock:g}=(0,d.useDispatch)(hr);if(!e||e.length<1)return{isLoading:!1,commands:[]};const b=r(e[0]),v=o(s(),b),k=u.every((e=>!!e&&(0,c.hasBlockSupport)(e.name,"multiple",!0)&&o(e.name,b))),_=l(e,b),y=[];return k&&y.push({name:"duplicate",label:(0,S.__)("Duplicate"),callback:()=>h(e,!0),icon:TE}),v&&y.push({name:"add-before",label:(0,S.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;g(t)},icon:$s},{name:"add-after",label:(0,S.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;f(t)},icon:$s}),n&&y.push({name:"Group",label:(0,S.__)("Group"),callback:()=>{if(!u.length)return;const t=a(),n=(0,c.switchToBlockType)(u,t);n&&m(e,n)},icon:ES}),t&&y.push({name:"ungroup",label:(0,S.__)("Ungroup"),callback:()=>{if(!u.length)return;const t=u[0].innerBlocks;t.length&&m(e,t)},icon:aT}),_&&y.push({name:"remove",label:(0,S.__)("Delete"),callback:()=>p(e,!0),icon:cT}),{isLoading:!1,commands:y.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},mT=()=>{(0,lT.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:uT}),(0,lT.useCommandLoader)({name:"core/block-editor/blockActions",hook:dT}),(0,lT.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:pT,context:"block-selection-edit"})},hT="isResuableBlocksrRenameHintVisible";function fT(){const e=(0,d.useSelect)((e=>{var t;return null===(t=e(Ns.store).get("core",hT))||void 0===t||t}),[]),t=(0,u.useRef)(),{set:n}=(0,d.useDispatch)(Ns.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,S.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")),(0,s.createElement)(ui.Button,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:eI,iconSize:"16",label:(0,S.__)("Dismiss hint"),onClick:()=>{const e=Es.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",hT,!1)},showTooltip:!1})):null}const gT={button:"wp-element-button",caption:"wp-element-caption"},bT=e=>gT[e]?gT[e]:"";function vT(e,t){return Object.entries(t).every((([t,n])=>"object"==typeof n&&"object"==typeof e[t]?vT(e[t],n):e[t]===n))}const kT=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&vT(e,t)));return 1===n.length?n[0]:void 0};var _T=()=>"";const yT={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"};function wT(e){return e?.startsWith?.("var:")?`var(--wp--${e.slice(4).split("|").join("--")})`:e}function ET(e={},t,n){const{kebabCase:o}=pr(ui.privateApis);let r=[];return Object.keys(e).forEach((i=>{const l=t+o(i.replace("/","-")),s=e[i];if(s instanceof Object){const e=l+n;r=[...r,...ET(s,e,n)]}else r.push(`${l}: ${s}`)})),r}const ST=(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 i=CT({[e]:{[o]:t[e][o]}});n[r]=[...n[r]||[],...i],delete t[e][o]})),r||o.root){const i=r?o:o.root,l=CT({[e]:t[e]});n[i]=[...n[i]||[],...l],delete t[e]}})),n};function CT(e={},t="",n,o={},r=!0){const{kebabCase:i}=pr(ui.privateApis),l=Fr===t,s=Object.entries(c.__EXPERIMENTAL_STYLE_PROPERTY).reduce(((t,[o,{value:r,properties:s,useEngine:a,rootOnly:c}])=>{if(c&&!l)return t;const u=r;if("elements"===u[0]||a)return t;const d=br(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(!br(d,[o],!1))return;const r=n.startsWith("--")?n:i(n);t.push(`${r}: ${wT(br(d,[o]))}`)}));else if(br(e,u,!1)){const n=o.startsWith("--")?o:i(o);t.push(`${n}: ${wT(br(e,u))}`)}return t}),[]);return(0,wl.getCSSRules)(e).forEach((e=>{if(l&&(n||!r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:i(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=br(o,e),!a||a?.ref)return}"font-size"===t&&(a=Or({size:a},zr(o?.settings))),s.push(`${t}: ${a}`)})),s}function xT({layoutDefinitions:e=Ci,style:t,selector:n,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:i}){let l="",s=o?Ki(t?.spacing?.blockGap):"";if(r&&(n===Fr?s=s||"0.5em":!o&&i&&(s=i)),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 i="";i=o?n===Fr?`:where(${n} .${e})${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===Fr?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,l+=`${i} { ${r.join("; ")}; }`}}))})),n===Fr&&o&&(l+=`${n} { --wp--style--block-gap: ${s}; }`)),n===Fr&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:o,baseStyles:r})=>{o&&t.includes(o)&&(l+=`${n} .${e} { display:${o}; }`),r?.length&&r.forEach((t=>{const o=[];t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t}`)})),o.length&&(l+=`${n} .${e}${t?.selector||""} { ${o.join("; ")}; }`)}))}))}return l}const BT=["border","color","dimensions","spacing","typography","filter","outline","shadow"];function IT(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>BT.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const TT=(e,t)=>{var n;const o=[];if(!e?.settings)return o;const r=e=>{let t={};return Vr.forEach((({path:n})=>{const o=br(e,n,!1);!1!==o&&(t=gr(t,n,o))})),t},i=r(e.settings),l=e.settings?.custom;return(Object.keys(i).length>0||l)&&o.push({presets:i,custom:l,selector:Fr}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=r(n),l=n.custom;(Object.keys(i).length>0||l)&&o.push({presets:i,custom:l,selector:t[e]?.selector})})),o},PT=(e,t)=>{const n=TT(e,t);let o="";return n.forEach((({presets:t,custom:n,selector:r})=>{const i=function(e={},t){const{kebabCase:n}=pr(ui.privateApis);return Vr.reduce(((o,{path:r,valueKey:i,valueFunc:l,cssVarInfix:s})=>{const a=br(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{i&&!l?o.push(`--wp--preset--${s}--${n(e.slug)}: ${e[i]}`):l&&"function"==typeof l&&o.push(`--wp--preset--${s}--${n(e.slug)}: ${l(e,t)}`)}))})),o}),[])}(t,e?.settings),l=ET(n,"--wp--custom--","--");l.length>0&&i.push(...l),i.length>0&&(o+=`${r}{${i.join(";")};}`)})),o},MT=(e,t,n,o,r=!1,i=!0)=>{const l=((e,t)=>{var n;const o=[];if(!e?.styles)return o;const r=IT(e.styles);return r&&o.push({styles:r,selector:Fr}),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 i=IT(n);if(n?.variations){const e={};Object.keys(n.variations).forEach((t=>{e[t]=IT(n.variations[t])})),i.variations=e}i&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,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=TT(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&&i&&(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+="}",l.forEach((({selector:t,duotoneSelector:l,styles:s,fallbackGapValue:c,hasLayoutSupport:u,featureSelectors:d,styleVariationSelectors:m})=>{if(d){const e=ST(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=ST(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=CT(o,n,a,e);t.length&&(p+=`${n}{${t.join(";")};}`)}})),l){const e={};s?.filter&&(e.filter=s.filter,delete s.filter);const t=CT(e);t.length&&(p+=`${l}{${t.join(";")};}`)}r||Fr!==t&&!u||(p+=xT({style:s,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:o,fallbackGapValue:c}));const h=CT(s,t,a,e,i);h?.length&&(p+=`${t}{${h.join(";")};}`);const f=Object.entries(s).filter((([e])=>e.startsWith(":")));f?.length&&f.forEach((([e,n])=>{const o=CT(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=Ki(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})=>{Fr===e&&(e="");const n=function(e="*",t={}){const{kebabCase:n}=pr(ui.privateApis);return Vr.reduce(((o,{path:r,cssVarInfix:i,classes:l})=>{if(!l)return o;const s=br(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{l.forEach((({classSuffix:r,propertyName:l})=>{const s=`.has-${n(t)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),c=`var(--wp--preset--${i}--${n(t)})`;o+=`${a}{${l}: ${c} !important;}`}))}))})),o}),"")}(e,t);n.length>0&&(p+=n)})),p};const RT=(e,t)=>{const n={};return e.forEach((e=>{const o=e.name,r=am(e);let i=am(e,"filter.duotone");if(!i){const t=am(e),n=(0,c.getBlockSupport)(e,"color.__experimentalDuotone",!1);i=n&&jr(t,n)}const l=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,s=e?.supports?.spacing?.blockGap?.__experimentalDefault,a=t(o),u={};a?.length&&a.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(yT).forEach((([t,o])=>{const r=am(e,t);r&&(n[o]=r)})),n})(e,r);n[o]={duotoneSelector:i,fallbackGapValue:s,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:l,name:o,selector:r,styleVariationSelectors:Object.keys(u).length?u:void 0}})),n};function AT(e,t){let n="";return e.split("&").forEach((e=>{if(e.includes("{")){const o=e.replace("}","").split("{");if(2!==o.length)return;const[r,i]=o,l=r.startsWith(" ")?jr(t,r):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,r);n+=`${l}{${i.trim()}}`}else n+=`${t}{${e.trim()}}`})),n}function NT(e={}){const[t]=Xr("spacing.blockGap"),n=null!==t,o=!n,r=(0,d.useSelect)((e=>{const{getSettings:t}=e(hr);return!!t().disableLayoutStyles})),i=(0,u.useContext)(Pf),l=void 0!==i?.templateSlug,s=(0,d.useSelect)((e=>e(c.store).getBlockStyles),[]);return(0,u.useMemo)((()=>{var t,i;if(!e?.styles||!e?.settings)return[];i=e,e=i.styles?.blocks?.["core/separator"]&&i.styles?.blocks?.["core/separator"].color?.background&&!i.styles?.blocks?.["core/separator"].color?.text&&!i.styles?.blocks?.["core/separator"].border?.color?{...i,styles:{...i.styles,blocks:{...i.styles.blocks,"core/separator":{...i.styles.blocks["core/separator"],color:{...i.styles.blocks["core/separator"].color,text:i.styles?.blocks["core/separator"].color.background}}}}}:i;const a=RT((0,c.getBlockTypes)(),s),u=PT(e,a),d=MT(e,a,n,o,r,l),p=function(e,t){return TT(e,t).flatMap((({presets:e})=>function(e={}){return Vr.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=br(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>sm(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(e,a),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,c.getBlockTypes)().forEach((t=>{if(e.styles.blocks[t.name]?.css){const n=a[t.name].selector;m.push({css:AT(e.styles.blocks[t.name]?.css,n),isGlobalStyles:!0})}})),[m,e.settings]}),[n,o,e,r])}function LT(){const{merged:e}=(0,u.useContext)(Kr);return NT(e)}var OT=(0,s.createElement)(W.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(W.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 DT(e){return zT(e)}function zT(e){return!!e?.shadow}function FT({resetAllFilter:e,onChange:t,value:n,panelId:o,children:r}){return(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S.__)("Effects"),resetAll:()=>{const o=e(n);t(o)},panelId:o,dropdownMenuProps:Ur},r)}const VT={shadow:!0};function HT({as:e=FT,value:t,onChange:n,inheritedValue:o=t,settings:r,panelId:i,defaultControls:l=VT}){const a=zT(r),c=(d=o?.shadow,$r({settings:r},"",d));var d;const p=e=>{n(gr(t,["shadow"],e))},m=(0,u.useCallback)((e=>({...e,shadow:void 0})),[]);return(0,s.createElement)(e,{resetAllFilter:m,value:t,onChange:n,panelId:i},a&&(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>p(void 0),isShownByDefault:l.shadow,panelId:i},(0,s.createElement)(ui.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,s.createElement)(UT,{shadow:c,onShadowChange:p,settings:r}))))}const UT=({shadow:e,onShadowChange:t,settings:n})=>(0,s.createElement)(ui.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:oi()({"is-open":t}),"aria-expanded":t};return(0,s.createElement)(ui.Button,{...n},(0,s.createElement)(ui.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(kl,{className:"block-editor-global-styles-effects-panel__toggle-icon",icon:OT,size:24}),(0,s.createElement)(ui.FlexItem,null,(0,S.__)("Shadow"))))},renderContent:()=>(0,s.createElement)(ui.__experimentalDropdownContentWrapper,{paddingSize:"medium"},(0,s.createElement)(GT,{shadow:e,onShadowChange:t,settings:n}))});function GT({shadow:e,onShadowChange:t,settings:n}){const o=n?.shadow?.presets?.default,r=n?.shadow?.presets?.theme,i=n?.shadow?.defaultPresets,l=[...i?o:[],...r||[]];return(0,s.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-popover-container"},(0,s.createElement)(ui.__experimentalVStack,{spacing:4},(0,s.createElement)(ui.__experimentalHeading,{level:5},(0,S.__)("Shadow")),(0,s.createElement)($T,{presets:l,activeShadow:e,onSelect:t})))}function $T({presets:e,activeShadow:t,onSelect:n}){return e?(0,s.createElement)(ui.__experimentalGrid,{columns:6,gap:0,align:"center",justify:"center"},e.map((({name:e,slug:o,shadow:r})=>(0,s.createElement)(jT,{key:o,label:e,isActive:r===t,onSelect:()=>n(r===t?void 0:r),shadow:r})))):null}function jT({label:e,isActive:t,onSelect:n,shadow:o}){return(0,s.createElement)("div",{className:"block-editor-global-styles-effects-panel__shadow-indicator-wrapper"},(0,s.createElement)(ui.Button,{className:"block-editor-global-styles-effects-panel__shadow-indicator",onClick:n,label:e,style:{boxShadow:o},showTooltip:!0},t&&(0,s.createElement)(kl,{icon:dp})))}function WT(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function KT({onChange:e,value:t,inheritedValue:n,panelId:o}){const r=()=>{e(void 0)};let i=!1;return n?.lightbox?.enabled&&(i=n.lightbox.enabled),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ui.__experimentalToolsPanel,{label:(0,S._x)("Settings","Image settings"),resetAll:r,panelId:o,dropdownMenuProps:Ur},(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,S.__)("Expand on click"),onDeselect:r,isShownByDefault:!0,panelId:o},(0,s.createElement)(ui.ToggleControl,{label:(0,S.__)("Expand on click"),checked:i,onChange:t=>{e({enabled:t})}}))))}function ZT({value:e,onChange:t,inheritedValue:n=e}){const[o,r]=(0,u.useState)(null),i=n?.css;return(0,s.createElement)(ui.__experimentalVStack,{spacing:3},(0,s.createElement)(ui.TextareaControl,{label:(0,S.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),o){const[e]=N_([{css:n}],".editor-styles-wrapper");e&&r(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void r(null);const[t]=N_([{css:e.target.value}],".editor-styles-wrapper");r(null===t?(0,S.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1}),o&&(0,s.createElement)(ui.Tooltip,{text:o},(0,s.createElement)("div",{className:"block-editor-global-styles-advanced-panel__custom-css-validation-wrapper"},(0,s.createElement)(kl,{icon:_a,className:"block-editor-global-styles-advanced-panel__custom-css-validation-icon"}))))}const qT=new Map,YT=[],XT={caption:(0,S.__)("Caption"),link:(0,S.__)("Link"),button:(0,S.__)("Button"),heading:(0,S.__)("Heading"),h1:(0,S.__)("H1"),h2:(0,S.__)("H2"),h3:(0,S.__)("H3"),h4:(0,S.__)("H4"),h5:(0,S.__)("H5"),h6:(0,S.__)("H6"),"settings.color":(0,S.__)("Color settings"),"settings.typography":(0,S.__)("Typography settings"),"styles.color":(0,S.__)("Colors"),"styles.spacing":(0,S.__)("Spacing"),"styles.typography":(0,S.__)("Typography")},QT=function(e,t){var n,o,r=0;function i(){var i,l,s=n,a=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(l=0;l<a;l++)if(s.args[l]!==arguments[l]){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(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];return s={args:i,val:e.apply(null,i)},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||{},i.clear=function(){n=null,o=null,r=0},i}((()=>(0,c.getBlockTypes)().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),JT=e=>null!==e&&"object"==typeof e;function eP(e,t,n=""){if(!JT(e)&&!JT(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=JT(e)?e:{},t=JT(t)?t:{};const o=new Set([...Object.keys(e),...Object.keys(t)]);let r=[];for(const i of o){const o=n?n+"."+i:i,l=eP(e[i],t[i],o);l&&(r=r.concat(l))}return r}function tP(e,t){const n=JSON.stringify({next:e,previous:t});if(qT.has(n))return qT.get(n);const o=eP({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 qT.set(n,YT),YT;const r=[...new Set(o)].reduce(((e,t)=>{const n=function(e){if(XT[e])return XT[e];const t=e.split(".");if("blocks"===t?.[0]){const e=QT()?.[t[1]];return e?(0,S.sprintf)(
// translators: %s: block name.
(0,S.__)("%s block"),e):t[1]}if("elements"===t?.[0]){const e=XT[t[1]]||t[1];return(0,S.sprintf)(
// translators: %s: element name, e.g., heading button, link, caption.
(0,S.__)("%s element"),e)}}(t);return n&&!e.includes(n)&&e.push(n),e}),[]);return qT.set(n,r),r}function nP(e,t,n={}){const o=tP(e,t),r=o.length,{maxResults:i}=n;if(i&&r&&r>i){const e=r-i,t=(0,S.sprintf)(
// translators: %d: number of global styles changes that are not displayed in the UI.
(0,S._n)("…and %d more change.","…and %d more changes.",e),e);o.splice(i,e,t)}return o}function oP(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return rP(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 rP(r.children,t,n);case u.RawHTML:return;case qw.Content:return iP(t,n);case RB:return void t.push(r.value)}switch(typeof o){case"string":return void 0!==r.children?rP(r.children,t,n):void 0;case"function":return oP(o.prototype&&"function"==typeof o.prototype.render?new o(r).render():o(r),t,n)}}function rP(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)oP(e[n],...t)}function iP(e,t){for(let n=0;n<t.length;n++){const{name:o,attributes:r,innerBlocks:i}=t[n];oP((0,c.getSaveElement)(o,r,(0,s.createElement)(qw.Content,null)),e,i)}}const lP=[{label:(0,S._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},{label:(0,S._x)("Square - 1:1","Aspect ratio option for dimensions control"),value:"1"},{label:(0,S._x)("Standard - 4:3","Aspect ratio option for dimensions control"),value:"4/3"},{label:(0,S._x)("Portrait - 3:4","Aspect ratio option for dimensions control"),value:"3/4"},{label:(0,S._x)("Classic - 3:2","Aspect ratio option for dimensions control"),value:"3/2"},{label:(0,S._x)("Classic Portrait - 2:3","Aspect ratio option for dimensions control"),value:"2/3"},{label:(0,S._x)("Wide - 16:9","Aspect ratio option for dimensions control"),value:"16/9"},{label:(0,S._x)("Tall - 9:16","Aspect ratio option for dimensions control"),value:"9/16"},{label:(0,S._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];function sP({panelId:e,value:t,onChange:n=(()=>{}),options:o=lP,defaultValue:r=lP[0].value,isShownByDefault:i=!0}){const l=null!=t?t:"auto";return(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>l!==r,label:(0,S.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:i,panelId:e},(0,s.createElement)(ui.SelectControl,{label:(0,S.__)("Aspect ratio"),value:l,options:o,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0}))}const aP=[{value:"fill",label:(0,S._x)("Fill","Scale option for dimensions control"),help:(0,S.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,S._x)("Contain","Scale option for dimensions control"),help:(0,S.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,S._x)("Cover","Scale option for dimensions control"),help:(0,S.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,S._x)("None","Scale option for dimensions control"),help:(0,S.__)("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,S._x)("Scale down","Scale option for dimensions control"),help:(0,S.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function cP({panelId:e,value:t,onChange:n,options:o=aP,defaultValue:r=aP[0].value,isShownByDefault:i=!0}){const l=null!=t?t:"fill",a=(0,u.useMemo)((()=>o.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[o]);return(0,s.createElement)(ui.__experimentalToolsPanelItem,{label:(0,S.__)("Scale"),isShownByDefault:i,hasValue:()=>l!==r,onDeselect:()=>n(r),panelId:e},(0,s.createElement)(ui.__experimentalToggleGroupControl,{label:(0,S.__)("Scale"),isBlock:!0,help:a[l],value:l,onChange:n,size:"__unstable-large"},o.map((e=>(0,s.createElement)(ui.__experimentalToggleGroupControlOption,{key:e.value,...e})))))}function uP(){return uP=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},uP.apply(this,arguments)}function dP(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var pP=/^((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)-.*))$/,mP=dP((function(e){return pP.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),hP=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){}}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}(),fP=Math.abs,gP=String.fromCharCode,bP=Object.assign;function vP(e){return e.trim()}function kP(e,t,n){return e.replace(t,n)}function _P(e,t){return e.indexOf(t)}function yP(e,t){return 0|e.charCodeAt(t)}function wP(e,t,n){return e.slice(t,n)}function EP(e){return e.length}function SP(e){return e.length}function CP(e,t){return t.push(e),e}var xP=1,BP=1,IP=0,TP=0,PP=0,MP="";function RP(e,t,n,o,r,i,l){return{value:e,root:t,parent:n,type:o,props:r,children:i,line:xP,column:BP,length:l,return:""}}function AP(e,t){return bP(RP("",null,null,"",null,null,0),e,{length:-e.length},t)}function NP(){return PP=TP>0?yP(MP,--TP):0,BP--,10===PP&&(BP=1,xP--),PP}function LP(){return PP=TP<IP?yP(MP,TP++):0,BP++,10===PP&&(BP=1,xP++),PP}function OP(){return yP(MP,TP)}function DP(){return TP}function zP(e,t){return wP(MP,e,t)}function FP(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 VP(e){return xP=BP=1,IP=EP(MP=e),TP=0,[]}function HP(e){return MP="",e}function UP(e){return vP(zP(TP-1,jP(91===e?e+2:40===e?e+1:e)))}function GP(e){for(;(PP=OP())&&PP<33;)LP();return FP(e)>2||FP(PP)>3?"":" "}function $P(e,t){for(;--t&&LP()&&!(PP<48||PP>102||PP>57&&PP<65||PP>70&&PP<97););return zP(e,DP()+(t<6&&32==OP()&&32==LP()))}function jP(e){for(;LP();)switch(PP){case e:return TP;case 34:case 39:34!==e&&39!==e&&jP(PP);break;case 40:41===e&&jP(e);break;case 92:LP()}return TP}function WP(e,t){for(;LP()&&e+PP!==57&&(e+PP!==84||47!==OP()););return"/*"+zP(t,TP-1)+"*"+gP(47===e?e:LP())}function KP(e){for(;!FP(OP());)LP();return zP(e,TP)}var ZP="-ms-",qP="-moz-",YP="-webkit-",XP="comm",QP="rule",JP="decl",eM="@keyframes";function tM(e,t){for(var n="",o=SP(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function nM(e,t,n,o){switch(e.type){case"@import":case JP:return e.return=e.return||e.value;case XP:return"";case eM:return e.return=e.value+"{"+tM(e.children,o)+"}";case QP:e.value=e.props.join(",")}return EP(n=tM(e.children,o))?e.return=e.value+"{"+n+"}":""}function oM(e,t){switch(function(e,t){return(((t<<2^yP(e,0))<<2^yP(e,1))<<2^yP(e,2))<<2^yP(e,3)}(e,t)){case 5103:return YP+"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 YP+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return YP+e+qP+e+ZP+e+e;case 6828:case 4268:return YP+e+ZP+e+e;case 6165:return YP+e+ZP+"flex-"+e+e;case 5187:return YP+e+kP(e,/(\w+).+(:[^]+)/,YP+"box-$1$2"+ZP+"flex-$1$2")+e;case 5443:return YP+e+ZP+"flex-item-"+kP(e,/flex-|-self/,"")+e;case 4675:return YP+e+ZP+"flex-line-pack"+kP(e,/align-content|flex-|-self/,"")+e;case 5548:return YP+e+ZP+kP(e,"shrink","negative")+e;case 5292:return YP+e+ZP+kP(e,"basis","preferred-size")+e;case 6060:return YP+"box-"+kP(e,"-grow","")+YP+e+ZP+kP(e,"grow","positive")+e;case 4554:return YP+kP(e,/([^-])(transform)/g,"$1"+YP+"$2")+e;case 6187:return kP(kP(kP(e,/(zoom-|grab)/,YP+"$1"),/(image-set)/,YP+"$1"),e,"")+e;case 5495:case 3959:return kP(e,/(image-set\([^]*)/,YP+"$1$`$1");case 4968:return kP(kP(e,/(.+:)(flex-)?(.*)/,YP+"box-pack:$3"+ZP+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+YP+e+e;case 4095:case 3583:case 4068:case 2532:return kP(e,/(.+)-inline(.+)/,YP+"$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(EP(e)-1-t>6)switch(yP(e,t+1)){case 109:if(45!==yP(e,t+4))break;case 102:return kP(e,/(.+:)(.+)-([^]+)/,"$1"+YP+"$2-$3$1"+qP+(108==yP(e,t+3)?"$3":"$2-$3"))+e;case 115:return~_P(e,"stretch")?oM(kP(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==yP(e,t+1))break;case 6444:switch(yP(e,EP(e)-3-(~_P(e,"!important")&&10))){case 107:return kP(e,":",":"+YP)+e;case 101:return kP(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+YP+(45===yP(e,14)?"inline-":"")+"box$3$1"+YP+"$2$3$1"+ZP+"$2box$3")+e}break;case 5936:switch(yP(e,t+11)){case 114:return YP+e+ZP+kP(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return YP+e+ZP+kP(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return YP+e+ZP+kP(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return YP+e+ZP+e+e}return e}function rM(e){return HP(iM("",null,null,null,[""],e=VP(e),0,[0],e))}function iM(e,t,n,o,r,i,l,s,a){for(var c=0,u=0,d=l,p=0,m=0,h=0,f=1,g=1,b=1,v=0,k="",_=r,y=i,w=o,E=k;g;)switch(h=v,v=LP()){case 40:if(108!=h&&58==E.charCodeAt(d-1)){-1!=_P(E+=kP(UP(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:E+=UP(v);break;case 9:case 10:case 13:case 32:E+=GP(h);break;case 92:E+=$P(DP()-1,7);continue;case 47:switch(OP()){case 42:case 47:CP(sM(WP(LP(),DP()),t,n),a);break;default:E+="/"}break;case 123*f:s[c++]=EP(E)*b;case 125*f:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:m>0&&EP(E)-d&&CP(m>32?aM(E+";",o,n,d-1):aM(kP(E," ","")+";",o,n,d-2),a);break;case 59:E+=";";default:if(CP(w=lM(E,t,n,c,u,r,s,k,_=[],y=[],d),i),123===v)if(0===u)iM(E,t,w,w,_,i,d,s,y);else switch(p){case 100:case 109:case 115:iM(e,w,w,o&&CP(lM(e,w,w,0,0,r,s,k,r,_=[],d),y),r,y,d,s,o?_:y);break;default:iM(E,w,w,w,[""],y,0,s,y)}}c=u=m=0,f=b=1,k=E="",d=l;break;case 58:d=1+EP(E),m=h;default:if(f<1)if(123==v)--f;else if(125==v&&0==f++&&125==NP())continue;switch(E+=gP(v),v*f){case 38:b=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(EP(E)-1)*b,b=1;break;case 64:45===OP()&&(E+=UP(LP())),p=OP(),u=d=EP(k=E+=KP(DP())),v++;break;case 45:45===h&&2==EP(E)&&(f=0)}}return i}function lM(e,t,n,o,r,i,l,s,a,c,u){for(var d=r-1,p=0===r?i:[""],m=SP(p),h=0,f=0,g=0;h<o;++h)for(var b=0,v=wP(e,d+1,d=fP(f=l[h])),k=e;b<m;++b)(k=vP(f>0?p[b]+" "+v:kP(v,/&\f/g,p[b])))&&(a[g++]=k);return RP(e,t,n,0===r?QP:s,a,c,u)}function sM(e,t,n){return RP(e,t,n,XP,gP(PP),wP(e,2,-2),0)}function aM(e,t,n,o){return RP(e,t,n,JP,wP(e,0,o),wP(e,o+1,-1),o)}var cM=function(e,t,n){for(var o=0,r=0;o=r,r=OP(),38===o&&12===r&&(t[n]=1),!FP(r);)LP();return zP(e,TP)},uM=new WeakMap,dM=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)||uM.get(n))&&!o){uM.set(e,!0);for(var r=[],i=function(e,t){return HP(function(e,t){var n=-1,o=44;do{switch(FP(o)){case 0:38===o&&12===OP()&&(t[n]=1),e[n]+=cM(TP-1,t,n);break;case 2:e[n]+=UP(o);break;case 4:if(44===o){e[++n]=58===OP()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=gP(o)}}while(o=LP());return e}(VP(e),t))}(t,r),l=n.props,s=0,a=0;s<i.length;s++)for(var c=0;c<l.length;c++,a++)e.props[a]=r[s]?i[s].replace(/&\f/g,l[c]):l[c]+" "+i[s]}}},pM=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},mM=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case JP:e.return=oM(e.value,e.length);break;case eM:return tM([AP(e,{value:kP(e.value,"@","@"+YP)})],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=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return tM([AP(e,{props:[kP(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return tM([AP(e,{props:[kP(t,/:(plac\w+)/,":"+YP+"input-$1")]}),AP(e,{props:[kP(t,/:(plac\w+)/,":-moz-$1")]}),AP(e,{props:[kP(t,/:(plac\w+)/,ZP+"input-$1")]})],o)}return""}))}}],hM=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,r,i=e.stylisPlugins||mM,l={},s=[];o=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++)l[t[n]]=!0;s.push(e)}));var a,c,u,d,p=[nM,(d=function(e){a.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],m=(c=[dM,pM].concat(i,p),u=SP(c),function(e,t,n,o){for(var r="",i=0;i<u;i++)r+=c[i](e,t,n,o)||"";return r});r=function(e,t,n,o){a=n,tM(rM(e?e+"{"+t.styles+"}":t.styles),m),o&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new hP({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:l,registered:{},insert:r};return h.sheet.hydrate(s),h},fM={animationIterationCount:1,aspectRatio: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 gM(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var bM=/[A-Z]|^ms/g,vM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,kM=function(e){return 45===e.charCodeAt(1)},_M=function(e){return null!=e&&"boolean"!=typeof e},yM=gM((function(e){return kM(e)?e:e.replace(bM,"-$&").toLowerCase()})),wM=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(vM,(function(e,t,n){return SM={name:t,styles:n,next:SM},t}))}return 1===fM[e]||kM(e)||"number"!=typeof t||0===t?t:t+"px"};function EM(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 SM={name:n.name,styles:n.styles,next:SM},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)SM={name:o.name,styles:o.styles,next:SM},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+=EM(e,t,n[r])+";";else for(var i in n){var l=n[i];if("object"!=typeof l)null!=t&&void 0!==t[l]?o+=i+"{"+t[l]+"}":_M(l)&&(o+=yM(i)+":"+wM(i,l)+";");else if(!Array.isArray(l)||"string"!=typeof l[0]||null!=t&&void 0!==t[l[0]]){var s=EM(e,t,l);switch(i){case"animation":case"animationName":o+=yM(i)+":"+s+";";break;default:o+=i+"{"+s+"}"}}else for(var a=0;a<l.length;a++)_M(l[a])&&(o+=yM(i)+":"+wM(i,l[a])+";")}return o}(e,t,n);case"function":if(void 0!==e){var r=SM,i=n(e);return SM=r,EM(e,t,i)}}if(null==t)return n;var l=t[n];return void 0!==l?l:n}var SM,CM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,xM=(0,s.createContext)("undefined"!=typeof HTMLElement?hM({key:"css"}):null);xM.Provider;var BM=(0,s.createContext)({}),IM=mP,TM=function(e){return"theme"!==e},PM=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?IM:TM},MM=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},RM=function(){return null},AM=function e(t,n){var o,r,i=t.__emotion_real===t,l=i&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var a=MM(t,n,i),c=a||PM(l),u=!c("as");return function(){var d=arguments,p=i&&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{p.push(d[0][0]);for(var m=d.length,h=1;h<m;h++)p.push(d[h],d[0][h])}var f,g=(f=function(e,t,n){var o=u&&e.as||l,i="",d=[],m=e;if(null==e.theme){for(var h in m={},e)m[h]=e[h];m.theme=(0,s.useContext)(BM)}"string"==typeof e.className?i=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&&(i=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="";SM=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,r+=EM(n,t,i)):r+=i[0];for(var l=1;l<e.length;l++)r+=EM(n,t,e[l]),o&&(r+=i[l]);CM.lastIndex=0;for(var s,a="";null!==(s=CM.exec(r));)a+="-"+s[1];var c=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)}(r)+a;return{name:c,styles:r,next:SM}}(p.concat(d),t.registered,m);!function(e,t,n){!function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)}(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,f,"string"==typeof o),i+=t.key+"-"+f.name,void 0!==r&&(i+=" "+r);var g=u&&void 0===a?PM(o):c,b={};for(var v in e)u&&"as"===v||g(v)&&(b[v]=e[v]);b.className=i,b.ref=n;var k=(0,s.createElement)(o,b),_=(0,s.createElement)(RM,null);return(0,s.createElement)(s.Fragment,null,_,k)},(0,s.forwardRef)((function(e,t){var n=(0,s.useContext)(xM);return f(e,n,t)})));return g.displayName=void 0!==o?o:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=l,g.__emotion_styles=p,g.__emotion_forwardProp=a,Object.defineProperty(g,"toString",{value:function(){return"."+r}}),g.withComponent=function(t,o){return e(t,uP({},n,o,{shouldForwardProp:MM(g,o,!0)})).apply(void 0,p)},g}};const NM=AM(ui.__experimentalToolsPanelItem,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function LM({panelId:e,value:t={},onChange:n=(()=>{}),units:o,isShownByDefault:r=!0}){var i,l;const a="auto"===t.width?"":null!==(i=t.width)&&void 0!==i?i:"",c="auto"===t.height?"":null!==(l=t.height)&&void 0!==l?l:"",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)(NM,{label:(0,S.__)("Width"),isShownByDefault:r,hasValue:()=>""!==a,onDeselect:u("width"),panelId:e},(0,s.createElement)(ui.__experimentalUnitControl,{label:(0,S.__)("Width"),placeholder:(0,S.__)("Auto"),labelPosition:"top",units:o,min:0,value:a,onChange:u("width"),size:"__unstable-large"})),(0,s.createElement)(NM,{label:(0,S.__)("Height"),isShownByDefault:r,hasValue:()=>""!==c,onDeselect:u("height"),panelId:e},(0,s.createElement)(ui.__experimentalUnitControl,{label:(0,S.__)("Height"),placeholder:(0,S.__)("Auto"),labelPosition:"top",units:o,min:0,value:c,onChange:u("height"),size:"__unstable-large"})))}const OM=[{label:(0,S._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,S._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,S._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,S._x)("Full Size","Image size option for resolution control"),value:"full"}],DM={};dr(DM,{...l,ExperimentalBlockCanvas:HS,ExperimentalBlockEditorProvider:t_,getDuotoneFilter:sm,getRichTextValues:function(e=[]){c.__unstableGetBlockProps.skipFilters=!0;const t=[];return iP(t,e),c.__unstableGetBlockProps.skipFilters=!1,t.map((e=>e instanceof Z.RichTextData?e:Z.RichTextData.fromHTMLString(e)))},PrivateInserter:fw,PrivateListView:_C,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,s.createElement)(Op,{clientId:e,__unstableCoverTarget:!0,__unstablePopoverSlot:"__unstable-block-tools-after",shift:!1,...n},(0,s.createElement)(ui.ResizableBox,{...t}))},BlockInfo:OI,useCanBlockToolbarBeFocused:function(){return(0,d.useSelect)((e=>{const{__unstableGetEditorMode:t,getBlock:n,getSettings:o,getSelectedBlockClientId:r,getFirstMultiSelectedBlockClientId:i}=pr(e(hr)),l=i()||r(),s=(0,c.isUnmodifiedDefaultBlock)(n(l)||{});return!!l&&(o().hasFixedToolbar||"edit"===t()&&!s)}),[])},cleanEmptyObject:ri,useStyleOverride:si,BlockQuickNavigation:DI,LayoutStyle:function({layout:e={},css:t,...n}){const o=Tl(e.type),[r]=Cr("spacing.blockGap"),i=null!==r;if(o){if(t)return(0,s.createElement)("style",null,t);const r=o.getLayoutStyle?.({hasBlockGapSupport:i,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}=(0,d.useSelect)((e=>pr(e(hr)).getRemovalPromptData())),{clearBlockRemovalPrompt:r,setBlockRemovalRules:i,privateRemoveBlocks:l}=pr((0,d.useDispatch)(hr));if((0,u.useEffect)((()=>(i(e),()=>{i()})),[e,i]),o)return(0,s.createElement)(ui.Modal,{title:(0,S.__)("Be careful!"),onRequestClose:r},(0,s.createElement)("p",null,(0,S._n)("Post or page content will not be displayed if you delete this block.","Post or page content will not be displayed if you delete these blocks.",o.length)),(0,s.createElement)(ui.__experimentalHStack,{justify:"right"},(0,s.createElement)(ui.Button,{variant:"tertiary",onClick:r},(0,S.__)("Cancel")),(0,s.createElement)(ui.Button,{variant:"primary",onClick:()=>{l(t,n,!0),r()}},(0,S.__)("Delete"))))},useLayoutClasses:zm,useLayoutStyles:function(e={},t,n){const{layout:o={},style:r={}}=e,i=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||{},l=Tl(i?.type||"default"),[s]=Cr("spacing.blockGap"),a=null!==s,c=l?.getLayoutStyle?.({blockName:t,selector:n,layout:o,style:r,hasBlockGapSupport:a});return c},DimensionsTool:function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:o,defaultAspectRatio:r="auto",scaleOptions:i,defaultScale:l="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,f]=(0,u.useState)(m),[g,b]=(0,u.useState)(p),v=c&&d?"custom":g,k=p||c&&d;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sP,{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=l,f(l)):delete o.scale,"custom"!==e&&c&&d&&delete o.height,n(o)}}),(0,s.createElement)(LM,{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:g&&(r.aspectRatio=g),g||!!e==!!o?h?r.scale=h:(r.scale=l,f(l)):delete r.scale,n(r)}}),k&&(0,s.createElement)(cP,{panelId:e,options:i,defaultValue:l,value:h,onChange:e=>{const o={...t};f(e="fill"===e?null:e),e?o.scale=e:delete o.scale,n(o)}}))},ResolutionTool:function({panelId:e,value:t,onChange:n,options:o=OM,defaultValue:r=OM[0].value,isShownByDefault:i=!0}){const l=null!=t?t:r;return(0,s.createElement)(ui.__experimentalToolsPanelItem,{hasValue:()=>l!==r,label:(0,S.__)("Resolution"),onDeselect:()=>n(r),isShownByDefault:i,panelId:e},(0,s.createElement)(ui.SelectControl,{label:(0,S.__)("Resolution"),value:l,options:o,onChange:n,help:(0,S.__)("Select the size of the source image."),size:"__unstable-large"}))},ReusableBlocksRenameHint:fT,useReusableBlocksRenameHint:function(){return(0,d.useSelect)((e=>{var t;return null===(t=e(Ns.store).get("core",hT))||void 0===t||t}),[])},usesContextKey:TB})}(),(window.wp=window.wp||{}).blockEditor=o}();
//# sourceMappingURL=index.min.js.map